old-bugs

Minecraft: Better than Adventure! mod that brings back bugs from older versions
git clone git://memoryshards.xyz/old-bugs.git
Log | Files | Refs | README | LICENSE

commit f6479686506d92a502b8dbb5f4236a9f1ce7a266
parent ec79528f343cbf2cdc1d83873c82da0611617290
Author: Amb0s <ambos@disroot.org>
Date:   Sun, 21 Jan 2024 14:10:05 +0100

Changed formatting

Diffstat:
Msrc/main/java/turniplabs/oldbugs/OldBugs.java | 12++++++------
Msrc/main/java/turniplabs/oldbugs/mixin/BlockFireMixin.java | 28++++++++++++++--------------
Msrc/main/java/turniplabs/oldbugs/mixin/EntityBoatMixin.java | 8++++----
Msrc/main/java/turniplabs/oldbugs/mixin/EntityLivingMixin.java | 18+++++++++---------
Msrc/main/java/turniplabs/oldbugs/mixin/EntityMinecartMixin.java | 8++++----
Msrc/main/java/turniplabs/oldbugs/mixin/EntityMixin.java | 14+++++++-------
6 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/src/main/java/turniplabs/oldbugs/OldBugs.java b/src/main/java/turniplabs/oldbugs/OldBugs.java @@ -5,11 +5,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class OldBugs implements ModInitializer { - public static final String MOD_ID = "oldbugs"; - public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); + public static final String MOD_ID = "oldbugs"; + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); - @Override - public void onInitialize() { - LOGGER.info("OldBugs initialized"); - } + @Override + public void onInitialize() { + LOGGER.info("Old Bugs initialized"); + } } diff --git a/src/main/java/turniplabs/oldbugs/mixin/BlockFireMixin.java b/src/main/java/turniplabs/oldbugs/mixin/BlockFireMixin.java @@ -8,23 +8,23 @@ import org.spongepowered.asm.mixin.injection.*; @Mixin(value = BlockFire.class, remap = false) final class BlockFireMixin { - @ModifyConstant(method = "tickRate", constant = @Constant(intValue = 40)) - private int changeTickRate(int a) { - return 10; - } + @ModifyConstant(method = "tickRate", constant = @Constant(intValue = 40)) + private int changeTickRate(int a) { + return 10; + } - @Redirect(method = "tryToCatchBlockOnFire", at = @At(value = "INVOKE", - target = "Lnet/minecraft/core/world/World;setBlockAndMetadataWithNotify(IIIII)Z")) - private boolean infiniteSpreading(World world, int x, int y, int z, int id, int meta) { - world.setBlockAndMetadataWithNotify(x, y, z, Block.fire.id, 0); + @Redirect(method = "tryToCatchBlockOnFire", at = @At(value = "INVOKE", + target = "Lnet/minecraft/core/world/World;setBlockAndMetadataWithNotify(IIIII)Z")) + private boolean infiniteSpreading(World world, int x, int y, int z, int id, int meta) { + world.setBlockAndMetadataWithNotify(x, y, z, Block.fire.id, 0); - return false; - } + return false; + } - @Redirect(method = "tryToCatchBlockOnFire", at = @At(value = "INVOKE", - target = "Lnet/minecraft/core/block/BlockFire;setBurnResult(Lnet/minecraft/core/world/World;III)V")) - private void cancelSetBurnResult(BlockFire instance, World world, int x, int y, int z) { + @Redirect(method = "tryToCatchBlockOnFire", at = @At(value = "INVOKE", + target = "Lnet/minecraft/core/block/BlockFire;setBurnResult(Lnet/minecraft/core/world/World;III)V")) + private void cancelSetBurnResult(BlockFire instance, World world, int x, int y, int z) { - } + } } diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityBoatMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityBoatMixin.java @@ -7,8 +7,8 @@ import org.spongepowered.asm.mixin.injection.ModifyConstant; @Mixin(value = EntityBoat.class, remap = false) final class EntityBoatMixin { - @ModifyConstant(method = "tick", constant = @Constant(doubleValue = 1.0, ordinal = 1)) - private double change(double d) { - return Double.MAX_VALUE; - } + @ModifyConstant(method = "tick", constant = @Constant(doubleValue = 1.0, ordinal = 1)) + private double change(double d) { + return Double.MAX_VALUE; + } } diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityLivingMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityLivingMixin.java @@ -11,15 +11,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(value = EntityLiving.class, remap = false) final class EntityLivingMixin { - @Inject(method = "canClimb", at = @At("HEAD"), cancellable = true) - public void increaseLadderCoverage(CallbackInfoReturnable<Boolean> cir) { - EntityLiving self = ((EntityLiving) ((Object) this)); + @Inject(method = "canClimb", at = @At("HEAD"), cancellable = true) + public void increaseLadderCoverage(CallbackInfoReturnable<Boolean> cir) { + EntityLiving self = ((EntityLiving) ((Object) this)); - int x = MathHelper.floor_double(self.x); - int y = MathHelper.floor_double(self.bb.minY); - int z = MathHelper.floor_double(self.z); + int x = MathHelper.floor_double(self.x); + int y = MathHelper.floor_double(self.bb.minY); + int z = MathHelper.floor_double(self.z); - cir.setReturnValue(self.world.getBlockId(x, y, z) == Block.ladderOak.id || - self.world.getBlockId(x, y + 1, z) == Block.ladderOak.id); - } + cir.setReturnValue(self.world.getBlockId(x, y, z) == Block.ladderOak.id || + self.world.getBlockId(x, y + 1, z) == Block.ladderOak.id); + } } diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityMinecartMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityMinecartMixin.java @@ -7,8 +7,8 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable; @Mixin(value = EntityMinecart.class, remap = false) final class EntityMinecartMixin { - @ModifyVariable(method = "push", at = @At(value = "STORE"), ordinal = 6) - private double change(double d6) { - return 0; - } + @ModifyVariable(method = "push", at = @At(value = "STORE"), ordinal = 6) + private double change(double d6) { + return 0; + } } diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityMixin.java @@ -10,13 +10,13 @@ import net.minecraft.core.util.phys.AABB; @Mixin(value = Entity.class, remap = false) final class EntityMixin { - @Inject(method = "checkAndHandleWater", at = @At("HEAD"), cancellable = true) - private void onCheckAndHandleWater(CallbackInfoReturnable<Boolean> cir) { - Entity self = ((Entity) ((Object) this)); + @Inject(method = "checkAndHandleWater", at = @At("HEAD"), cancellable = true) + private void onCheckAndHandleWater(CallbackInfoReturnable<Boolean> cir) { + Entity self = ((Entity) ((Object) this)); - AABB aabb = self.bb.expand(0.0, -0.4000000059604645, 0.0); - boolean res = self.world.handleMaterialAcceleration(aabb, Material.water, self); + AABB aabb = self.bb.expand(0.0, -0.4000000059604645, 0.0); + boolean res = self.world.handleMaterialAcceleration(aabb, Material.water, self); - cir.setReturnValue(res); - } + cir.setReturnValue(res); + } }