Format source
This commit is contained in:
parent
4d8acdd76f
commit
01f6fb54e9
|
@ -5,10 +5,10 @@ import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
public class TrampleDisabler implements ModInitializer {
|
public class TrampleDisabler implements ModInitializer {
|
||||||
public static final Logger LOGGER = LogManager.getLogger("trample-disabler");
|
public static final Logger LOGGER = LogManager.getLogger("trample-disabler");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
LOGGER.info("TrampleDisabler enabled!");
|
LOGGER.info("TrampleDisabler enabled!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,13 +13,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(FarmlandBlock.class)
|
@Mixin(FarmlandBlock.class)
|
||||||
public class MixinFarmlandBlock extends Block {
|
public class MixinFarmlandBlock extends Block {
|
||||||
public MixinFarmlandBlock(Settings settings) {
|
public MixinFarmlandBlock(Settings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = {"onLandedUpon(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;F)V"}, at = {@At("HEAD")}, cancellable = true)
|
@Inject(method = {"onLandedUpon(Lnet/minecraft/world/World;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;F)V"},
|
||||||
private void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance, CallbackInfo info) {
|
at = {@At("HEAD")}, cancellable = true)
|
||||||
super.onLandedUpon(world, state, pos, entity, fallDistance); // Don't cancel fall damage
|
private void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity,
|
||||||
info.cancel();
|
float fallDistance, CallbackInfo info) {
|
||||||
}
|
super.onLandedUpon(world, state, pos, entity, fallDistance); // Don't cancel fall damage
|
||||||
|
info.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue