Skip to content

Commit

Permalink
particles
Browse files Browse the repository at this point in the history
  • Loading branch information
Wide-Cat committed Jan 2, 2023
1 parent a01ecdd commit 881fbff
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/wide/cat/squake/SquakeClientPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static void spawnBunnyhopParticles(PlayerEntity player, int numParticles
Random random = player.getRandom();

if (blockState.getRenderType() != BlockRenderType.INVISIBLE) {
for (int iParticle = 0; iParticle < numParticles; iParticle++) {
for (int iParticle = 0; iParticle < (int)(numParticles * configValues.particleMultiplier); iParticle++) {
player.world.addParticle(new BlockStateParticleEffect(ParticleTypes.BLOCK, blockState), player.getX() + (random.nextFloat() - 0.5D) * player.getWidth(), player.getBoundingBox().minY + 0.1D, player.getZ() + (random.nextFloat() - 0.5D) * player.getWidth(), -motion.x * 4.0D, 1.5D, -motion.z * 4.0D);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/wide/cat/squake/config/ConfigValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public class ConfigValues {
public Boolean drawSpeed = true;
public Integer xPosition = 10;
public Integer yPosition = 10;
public Double particleMultiplier = 1d;
}
7 changes: 7 additions & 0 deletions src/main/java/wide/cat/squake/config/ModConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ public ModConfigScreen(Screen parent, ConfigValues configValues) {
.setTooltip(Text.translatable("tooltip.squake.posY"))
.setSaveConsumer(newValue -> configValues.yPosition = newValue)
.build());
cRender.addEntry(entryBuilder.startDoubleField(Text.translatable("config_value.squake.particleMultiplier"), configValues.particleMultiplier)
.setDefaultValue(1)
.setMin(0)
.setMax(32)
.setTooltip(Text.translatable("tooltip.squake.particleMultiplier"))
.setSaveConsumer(newValue -> configValues.particleMultiplier = newValue)
.build());

builder.setSavingRunnable(ConfigHandler::save);
this.configScreen = builder.build();
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/squake/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"config_value.squake.drawSpeed": "Draw speed",
"config_value.squake.posX": "X position",
"config_value.squake.posY": "Y position",
"config_value.squake.particleMultiplier": "Particle multiplier",


"tooltip.squake.uncappedBunnyhopEnabled": "If enabled, the soft and hard caps will not be applied at all",
Expand All @@ -45,5 +46,6 @@

"tooltip.squake.drawSpeed": "Whether or not to draw the speedometer",
"tooltip.squake.posX": "The X position of the speedometer",
"tooltip.squake.posY": "The Y position of the speedometer"
"tooltip.squake.posY": "The Y position of the speedometer",
"tooltip.squake.particleMultiplier": "Multiplier to the number of particles spawned"
}

0 comments on commit 881fbff

Please sign in to comment.