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 59bec811e855e7d964042cb9956c0ee67c92a6de
parent 4ebb6602cf38d9efb38480a986f5a28eb8644896
Author: Amb0s <ambos@disroot.org>
Date:   Tue, 23 Jan 2024 21:14:36 +0100

Changed mod group and bumped version

Diffstat:
Mgradle.properties | 4++--
Asrc/main/java/ambos/oldbugs/OldBugs.java | 15+++++++++++++++
Asrc/main/java/ambos/oldbugs/mixin/BlockFireMixin.java | 30++++++++++++++++++++++++++++++
Asrc/main/java/ambos/oldbugs/mixin/EntityBoatMixin.java | 14++++++++++++++
Asrc/main/java/ambos/oldbugs/mixin/EntityLivingMixin.java | 25+++++++++++++++++++++++++
Asrc/main/java/ambos/oldbugs/mixin/EntityMinecartMixin.java | 14++++++++++++++
Asrc/main/java/ambos/oldbugs/mixin/EntityMixin.java | 22++++++++++++++++++++++
Dsrc/main/java/turniplabs/oldbugs/OldBugs.java | 15---------------
Dsrc/main/java/turniplabs/oldbugs/mixin/BlockFireMixin.java | 30------------------------------
Dsrc/main/java/turniplabs/oldbugs/mixin/EntityBoatMixin.java | 14--------------
Dsrc/main/java/turniplabs/oldbugs/mixin/EntityLivingMixin.java | 25-------------------------
Dsrc/main/java/turniplabs/oldbugs/mixin/EntityMinecartMixin.java | 14--------------
Dsrc/main/java/turniplabs/oldbugs/mixin/EntityMixin.java | 22----------------------
Msrc/main/resources/fabric.mod.json | 2+-
Msrc/main/resources/oldbugs.mixins.json | 2+-
15 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/gradle.properties b/gradle.properties @@ -7,6 +7,6 @@ bta_version=7.1-pre1a loader_version=0.14.19-babric.3-bta # Mod -mod_version=2.0.1 -mod_group=turniplabs +mod_version=3.0.0 +mod_group=amb0s mod_name=old-bugs diff --git a/src/main/java/ambos/oldbugs/OldBugs.java b/src/main/java/ambos/oldbugs/OldBugs.java @@ -0,0 +1,15 @@ +package ambos.oldbugs; + +import net.fabricmc.api.ModInitializer; +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); + + @Override + public void onInitialize() { + LOGGER.info("Old Bugs initialized"); + } +} diff --git a/src/main/java/ambos/oldbugs/mixin/BlockFireMixin.java b/src/main/java/ambos/oldbugs/mixin/BlockFireMixin.java @@ -0,0 +1,30 @@ +package ambos.oldbugs.mixin; + +import net.minecraft.core.block.Block; +import net.minecraft.core.block.BlockFire; +import net.minecraft.core.world.World; +import org.spongepowered.asm.mixin.Mixin; +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; + } + + + @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; + } + + @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/ambos/oldbugs/mixin/EntityBoatMixin.java b/src/main/java/ambos/oldbugs/mixin/EntityBoatMixin.java @@ -0,0 +1,14 @@ +package ambos.oldbugs.mixin; + +import net.minecraft.core.entity.vehicle.EntityBoat; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +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; + } +} diff --git a/src/main/java/ambos/oldbugs/mixin/EntityLivingMixin.java b/src/main/java/ambos/oldbugs/mixin/EntityLivingMixin.java @@ -0,0 +1,25 @@ +package ambos.oldbugs.mixin; + +import net.minecraft.core.block.Block; +import net.minecraft.core.entity.EntityLiving; +import net.minecraft.core.util.helper.MathHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +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)); + + 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); + } +} diff --git a/src/main/java/ambos/oldbugs/mixin/EntityMinecartMixin.java b/src/main/java/ambos/oldbugs/mixin/EntityMinecartMixin.java @@ -0,0 +1,14 @@ +package ambos.oldbugs.mixin; + +import net.minecraft.core.entity.vehicle.EntityMinecart; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +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; + } +} diff --git a/src/main/java/ambos/oldbugs/mixin/EntityMixin.java b/src/main/java/ambos/oldbugs/mixin/EntityMixin.java @@ -0,0 +1,22 @@ +package ambos.oldbugs.mixin; + +import net.minecraft.core.block.material.Material; +import net.minecraft.core.entity.Entity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +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)); + + AABB aabb = self.bb.expand(0.0, -0.4000000059604645, 0.0); + boolean res = self.world.handleMaterialAcceleration(aabb, Material.water, self); + + cir.setReturnValue(res); + } +} diff --git a/src/main/java/turniplabs/oldbugs/OldBugs.java b/src/main/java/turniplabs/oldbugs/OldBugs.java @@ -1,15 +0,0 @@ -package turniplabs.oldbugs; - -import net.fabricmc.api.ModInitializer; -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); - - @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 @@ -1,30 +0,0 @@ -package turniplabs.oldbugs.mixin; - -import net.minecraft.core.block.Block; -import net.minecraft.core.block.BlockFire; -import net.minecraft.core.world.World; -import org.spongepowered.asm.mixin.Mixin; -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; - } - - - @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; - } - - @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 @@ -1,14 +0,0 @@ -package turniplabs.oldbugs.mixin; - -import net.minecraft.core.entity.vehicle.EntityBoat; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.Constant; -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; - } -} diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityLivingMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityLivingMixin.java @@ -1,25 +0,0 @@ -package turniplabs.oldbugs.mixin; - -import net.minecraft.core.block.Block; -import net.minecraft.core.entity.EntityLiving; -import net.minecraft.core.util.helper.MathHelper; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -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)); - - 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); - } -} diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityMinecartMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityMinecartMixin.java @@ -1,14 +0,0 @@ -package turniplabs.oldbugs.mixin; - -import net.minecraft.core.entity.vehicle.EntityMinecart; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -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; - } -} diff --git a/src/main/java/turniplabs/oldbugs/mixin/EntityMixin.java b/src/main/java/turniplabs/oldbugs/mixin/EntityMixin.java @@ -1,22 +0,0 @@ -package turniplabs.oldbugs.mixin; - -import net.minecraft.core.block.material.Material; -import net.minecraft.core.entity.Entity; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -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)); - - AABB aabb = self.bb.expand(0.0, -0.4000000059604645, 0.0); - boolean res = self.world.handleMaterialAcceleration(aabb, Material.water, self); - - cir.setReturnValue(res); - } -} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json @@ -18,7 +18,7 @@ "environment": "*", "entrypoints": { "main": [ - "turniplabs.oldbugs.OldBugs" + "ambos.oldbugs.OldBugs" ] }, "mixins": [ diff --git a/src/main/resources/oldbugs.mixins.json b/src/main/resources/oldbugs.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "turniplabs.oldbugs.mixin", + "package": "ambos.oldbugs.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ "BlockFireMixin",