Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 936587e

Browse files
committed
Add more config entries Closes #27
1 parent 71492b3 commit 936587e

5 files changed

Lines changed: 29 additions & 3 deletions

File tree

src/main/java/net/F53/HorseBuff/config/ModConfig.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ public class ModConfig implements ConfigData{
2424
@ConfigEntry.Gui.Tooltip
2525
public boolean portalPatch = true;
2626

27+
@ConfigEntry.Category("Server")
28+
@ConfigEntry.Gui.Tooltip
29+
public boolean rubberBand = true;
30+
31+
@ConfigEntry.Category("Server")
32+
@ConfigEntry.Gui.Tooltip
33+
public boolean breakSpeed = true;
34+
35+
@ConfigEntry.Category("Server")
36+
@ConfigEntry.Gui.Tooltip
37+
public boolean stepHeight = false;
38+
2739
@ConfigEntry.Category("Client")
2840
@ConfigEntry.Gui.Tooltip
2941
@ConfigEntry.Gui.CollapsibleObject

src/main/java/net/F53/HorseBuff/mixin/Server/BreakSpeed.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.F53.HorseBuff.mixin.Server;
22

3+
import net.F53.HorseBuff.config.ModConfig;
34
import net.minecraft.entity.EntityType;
45
import net.minecraft.entity.LivingEntity;
56
import net.minecraft.entity.passive.HorseBaseEntity;
@@ -18,7 +19,7 @@ protected BreakSpeed(EntityType<? extends LivingEntity> entityType, World world)
1819

1920
@ModifyConstant(method = "getBlockBreakingSpeed(Lnet/minecraft/block/BlockState;)F", constant = @Constant(floatValue = 5.0F))
2021
private float HorseBreakSpeed(float speedMultiplier){
21-
if (this.getRootVehicle() instanceof HorseBaseEntity)
22+
if (this.getRootVehicle() instanceof HorseBaseEntity && ModConfig.getInstance().breakSpeed)
2223
return 1.0F;
2324
return speedMultiplier;
2425
}

src/main/java/net/F53/HorseBuff/mixin/Server/MovementCheck.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.F53.HorseBuff.mixin.Server;
22

3+
import net.F53.HorseBuff.config.ModConfig;
34
import net.minecraft.server.network.ServerPlayNetworkHandler;
45
import net.minecraft.server.network.ServerPlayerEntity;
56
import org.spongepowered.asm.mixin.Mixin;
@@ -15,7 +16,7 @@ public class MovementCheck {
1516

1617
@ModifyConstant(method = "onVehicleMove(Lnet/minecraft/network/packet/c2s/play/VehicleMoveC2SPacket;)V", constant = @Constant(doubleValue = 0.0625D))
1718
private double horseNoMovementCheck(double value){
18-
if (this.player.getRootVehicle() instanceof HorseBaseEntity)
19+
if (this.player.getRootVehicle() instanceof HorseBaseEntity && ModConfig.getInstance().rubberBand)
1920
return Double.POSITIVE_INFINITY;
2021
return value;
2122
}

src/main/java/net/F53/HorseBuff/mixin/Server/StepHeight.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.F53.HorseBuff.mixin.Server;
22

3+
import net.F53.HorseBuff.config.ModConfig;
34
import net.minecraft.entity.passive.HorseBaseEntity;
45
import org.spongepowered.asm.mixin.Mixin;
56
import org.spongepowered.asm.mixin.injection.Constant;
@@ -11,6 +12,9 @@
1112
public class StepHeight {
1213
@ModifyConstant(method = "<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V", constant = @Constant(floatValue = 1.0f))
1314
private float horseHigherStepHeight(float value){
14-
return 1.1f;
15+
if (ModConfig.getInstance().stepHeight) {
16+
return 1.1f;
17+
}
18+
return value;
1519
}
1620
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
"text.autoconfig.HorseBuff.option.portalPatch": "Ride Through Portals",
1616
"text.autoconfig.HorseBuff.option.portalPatch.@Tooltip": "Yes - Allows you to travel through nether and end portals while mounted on horseback.\nNo - vanilla behavior",
1717

18+
"text.autoconfig.HorseBuff.option.rubberBand": "Fix Rubberbanding on Stairs",
19+
"text.autoconfig.HorseBuff.option.rubberBand.@Tooltip": "Yes - Increases server tolerance for Horse movement speed, fixing rubberbanding.\nNo - vanilla behavior",
20+
21+
"text.autoconfig.HorseBuff.option.breakSpeed": "Remove Riding Breakspeed Debuff",
22+
"text.autoconfig.HorseBuff.option.breakSpeed.@Tooltip": "Yes - Allows mining at full speed while on horseback.\nNo - Dramatically slows mining speed while on horseback (vanilla behavior)",
23+
24+
"text.autoconfig.HorseBuff.option.stepHeight": "Buff Stepheight",
25+
"text.autoconfig.HorseBuff.option.stepHeight.@Tooltip": "Yes - Increases horse stepheight from 1 block to 1.1 blocks, making travel much smoother around path blocks.\nNo - vanilla behavior",
1826

1927

2028
"text.autoconfig.HorseBuff.option.pitchFade": "Horse Fade",

0 commit comments

Comments
 (0)