Skip to content

Commit 881fbff

Browse files
committed
particles
1 parent a01ecdd commit 881fbff

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

src/main/java/wide/cat/squake/SquakeClientPlayer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private static void spawnBunnyhopParticles(PlayerEntity player, int numParticles
193193
Random random = player.getRandom();
194194

195195
if (blockState.getRenderType() != BlockRenderType.INVISIBLE) {
196-
for (int iParticle = 0; iParticle < numParticles; iParticle++) {
196+
for (int iParticle = 0; iParticle < (int)(numParticles * configValues.particleMultiplier); iParticle++) {
197197
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);
198198
}
199199
}

src/main/java/wide/cat/squake/config/ConfigValues.java

+1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ public class ConfigValues {
2424
public Boolean drawSpeed = true;
2525
public Integer xPosition = 10;
2626
public Integer yPosition = 10;
27+
public Double particleMultiplier = 1d;
2728
}

src/main/java/wide/cat/squake/config/ModConfigScreen.java

+7
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ public ModConfigScreen(Screen parent, ConfigValues configValues) {
132132
.setTooltip(Text.translatable("tooltip.squake.posY"))
133133
.setSaveConsumer(newValue -> configValues.yPosition = newValue)
134134
.build());
135+
cRender.addEntry(entryBuilder.startDoubleField(Text.translatable("config_value.squake.particleMultiplier"), configValues.particleMultiplier)
136+
.setDefaultValue(1)
137+
.setMin(0)
138+
.setMax(32)
139+
.setTooltip(Text.translatable("tooltip.squake.particleMultiplier"))
140+
.setSaveConsumer(newValue -> configValues.particleMultiplier = newValue)
141+
.build());
135142

136143
builder.setSavingRunnable(ConfigHandler::save);
137144
this.configScreen = builder.build();

src/main/resources/assets/squake/lang/en_us.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"config_value.squake.drawSpeed": "Draw speed",
2727
"config_value.squake.posX": "X position",
2828
"config_value.squake.posY": "Y position",
29+
"config_value.squake.particleMultiplier": "Particle multiplier",
2930

3031

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

4647
"tooltip.squake.drawSpeed": "Whether or not to draw the speedometer",
4748
"tooltip.squake.posX": "The X position of the speedometer",
48-
"tooltip.squake.posY": "The Y position of the speedometer"
49+
"tooltip.squake.posY": "The Y position of the speedometer",
50+
"tooltip.squake.particleMultiplier": "Multiplier to the number of particles spawned"
4951
}

0 commit comments

Comments
 (0)