more stuff #1
@@ -15,6 +15,9 @@ public class Tweaks implements ModInitializer {
|
|||||||
public static final GameRules.Key<GameRules.IntRule> SHIELD_AXE_COOLDOWN =
|
public static final GameRules.Key<GameRules.IntRule> SHIELD_AXE_COOLDOWN =
|
||||||
GameRuleRegistry.register("shieldAxeCooldown", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(100, 0, Integer.MAX_VALUE));
|
GameRuleRegistry.register("shieldAxeCooldown", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(100, 0, Integer.MAX_VALUE));
|
||||||
|
|
||||||
|
public static final GameRules.Key<GameRules.IntRule> CRITICAL_MULTIPLIER =
|
||||||
|
GameRuleRegistry.register("criticalHitMultiplier", GameRules.Category.PLAYER, GameRuleFactory.createIntRule(150, 0, Integer.MAX_VALUE));
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,4 +26,17 @@ public abstract class PlayerEntityMixin {
|
|||||||
}
|
}
|
||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyConstant(
|
||||||
|
method = "attack",
|
||||||
|
constant = @Constant(floatValue = 1.5F)
|
||||||
|
)
|
||||||
|
private float modifyCriticalMultiplier(float original) {
|
||||||
|
PlayerEntity player = (PlayerEntity)(Object)this;
|
||||||
|
if (player.getWorld() != null && player.getWorld() instanceof ServerWorld serverWorld) {
|
||||||
|
GameRules.IntRule rule = serverWorld.getGameRules().get(Tweaks.CRITICAL_MULTIPLIER);
|
||||||
|
return rule.get() / 100.0F;
|
||||||
|
}
|
||||||
|
return original;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user