Attack damage builds from 0 instead of 0.2
This commit is contained in:
parent
f72fe4b778
commit
4efacd691c
|
|
@ -10,9 +10,7 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.*;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
|
@ -45,4 +43,14 @@ public abstract class PlayerTweaks extends LivingEntity {
|
||||||
// Lose no XP for levelling up
|
// Lose no XP for levelling up
|
||||||
@ModifyVariable(method = "onEnchantmentPerformed", at = @At("HEAD"), ordinal = 0, argsOnly = true)
|
@ModifyVariable(method = "onEnchantmentPerformed", at = @At("HEAD"), ordinal = 0, argsOnly = true)
|
||||||
private int onEnchantmentPerformed(int i){return 0;}
|
private int onEnchantmentPerformed(int i){return 0;}
|
||||||
|
|
||||||
|
// Start attack damage buildup from 0.0 instead of 0.2
|
||||||
|
@ModifyConstant(method="attack", constant=@Constant(floatValue = 0.2F))
|
||||||
|
private float attackBuildupLow(float constant){
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
@ModifyConstant(method="attack", constant=@Constant(floatValue = 0.8F))
|
||||||
|
private float attackBuildupHigh(float constant){
|
||||||
|
return 1.0F;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue