diff options
author | Appability <appable@icloud.com> | 2022-10-12 14:30:01 -0700 |
---|---|---|
committer | Appability <appable@icloud.com> | 2022-10-12 14:30:01 -0700 |
commit | 4e81e91a7aea23b81347accf56f89121451f7e0c (patch) | |
tree | 8d75d2db1961b70a1a5c4155570d0daeee1cd94e /src/main/java/com | |
parent | 42fb54e0eaedc44d22a8c86fc539e46c68af3dab (diff) | |
download | AmbientAddons-4e81e91a7aea23b81347accf56f89121451f7e0c.tar.gz AmbientAddons-4e81e91a7aea23b81347accf56f89121451f7e0c.tar.bz2 AmbientAddons-4e81e91a7aea23b81347accf56f89121451f7e0c.zip |
ignore carpet (this time stolen from floppa) + surprisingly annoying lateinit stuff
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/ambientaddons/mixin/MixinBlock.java | 12 | ||||
-rw-r--r-- | src/main/java/com/ambientaddons/mixin/MixinCarpet.java | 20 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/com/ambientaddons/mixin/MixinBlock.java b/src/main/java/com/ambientaddons/mixin/MixinBlock.java new file mode 100644 index 0000000..a30b15d --- /dev/null +++ b/src/main/java/com/ambientaddons/mixin/MixinBlock.java @@ -0,0 +1,12 @@ +package com.ambientaddons.mixin; + +import net.minecraft.block.Block; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +// credit Floppa Client +@Mixin(Block.class) +public abstract class MixinBlock { + @Shadow + public abstract void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ); +} diff --git a/src/main/java/com/ambientaddons/mixin/MixinCarpet.java b/src/main/java/com/ambientaddons/mixin/MixinCarpet.java new file mode 100644 index 0000000..20de47c --- /dev/null +++ b/src/main/java/com/ambientaddons/mixin/MixinCarpet.java @@ -0,0 +1,20 @@ +package com.ambientaddons.mixin; + +import com.ambientaddons.features.dungeon.IgnoreCarpet; +import net.minecraft.block.BlockCarpet; +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.CallbackInfo; + +// credit Floppa Client +@Mixin(BlockCarpet.class) +public abstract class MixinCarpet extends MixinBlock { + @Inject(method = "setBlockBoundsFromMeta", at = @At("HEAD"), cancellable = true) + protected void setBlockBoundsFromMeta(int meta, CallbackInfo ci) { + if (IgnoreCarpet.INSTANCE.shouldIgnoreCarpet()) { + setBlockBounds(0F, 0F, 0F, 1F, 0F, 1F); + ci.cancel(); + } + } +} |