Skip to content

Commit

Permalink
Add more config entries Closes #27
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeF53 committed May 24, 2022
1 parent 71492b3 commit 936587e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/main/java/net/F53/HorseBuff/config/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ public class ModConfig implements ConfigData{
@ConfigEntry.Gui.Tooltip
public boolean portalPatch = true;

@ConfigEntry.Category("Server")
@ConfigEntry.Gui.Tooltip
public boolean rubberBand = true;

@ConfigEntry.Category("Server")
@ConfigEntry.Gui.Tooltip
public boolean breakSpeed = true;

@ConfigEntry.Category("Server")
@ConfigEntry.Gui.Tooltip
public boolean stepHeight = false;

@ConfigEntry.Category("Client")
@ConfigEntry.Gui.Tooltip
@ConfigEntry.Gui.CollapsibleObject
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/F53/HorseBuff/mixin/Server/BreakSpeed.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.F53.HorseBuff.mixin.Server;

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

@ModifyConstant(method = "getBlockBreakingSpeed(Lnet/minecraft/block/BlockState;)F", constant = @Constant(floatValue = 5.0F))
private float HorseBreakSpeed(float speedMultiplier){
if (this.getRootVehicle() instanceof HorseBaseEntity)
if (this.getRootVehicle() instanceof HorseBaseEntity && ModConfig.getInstance().breakSpeed)
return 1.0F;
return speedMultiplier;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.F53.HorseBuff.mixin.Server;

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

@ModifyConstant(method = "onVehicleMove(Lnet/minecraft/network/packet/c2s/play/VehicleMoveC2SPacket;)V", constant = @Constant(doubleValue = 0.0625D))
private double horseNoMovementCheck(double value){
if (this.player.getRootVehicle() instanceof HorseBaseEntity)
if (this.player.getRootVehicle() instanceof HorseBaseEntity && ModConfig.getInstance().rubberBand)
return Double.POSITIVE_INFINITY;
return value;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/net/F53/HorseBuff/mixin/Server/StepHeight.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.F53.HorseBuff.mixin.Server;

import net.F53.HorseBuff.config.ModConfig;
import net.minecraft.entity.passive.HorseBaseEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
Expand All @@ -11,6 +12,9 @@
public class StepHeight {
@ModifyConstant(method = "<init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V", constant = @Constant(floatValue = 1.0f))
private float horseHigherStepHeight(float value){
return 1.1f;
if (ModConfig.getInstance().stepHeight) {
return 1.1f;
}
return value;
}
}
8 changes: 8 additions & 0 deletions src/main/resources/assets/horsebuff/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"text.autoconfig.HorseBuff.option.portalPatch": "Ride Through Portals",
"text.autoconfig.HorseBuff.option.portalPatch.@Tooltip": "Yes - Allows you to travel through nether and end portals while mounted on horseback.\nNo - vanilla behavior",

"text.autoconfig.HorseBuff.option.rubberBand": "Fix Rubberbanding on Stairs",
"text.autoconfig.HorseBuff.option.rubberBand.@Tooltip": "Yes - Increases server tolerance for Horse movement speed, fixing rubberbanding.\nNo - vanilla behavior",

"text.autoconfig.HorseBuff.option.breakSpeed": "Remove Riding Breakspeed Debuff",
"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)",

"text.autoconfig.HorseBuff.option.stepHeight": "Buff Stepheight",
"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",


"text.autoconfig.HorseBuff.option.pitchFade": "Horse Fade",
Expand Down

0 comments on commit 936587e

Please sign in to comment.