From 3e0297c8afd77a461f12aed585d8c43a8852165e Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 8 May 2023 22:47:11 +0200 Subject: [PATCH] Fix bamboo block reflect wrapper --- .../pandacube/lib/paper/reflect/PandalibPaperReflect.java | 4 ++-- .../lib/paper/reflect/util/BedrockBambooCollisionFixer.java | 4 ++-- .../world/block/{BambooBlock.java => BambooStalkBlock.java} | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/{BambooBlock.java => BambooStalkBlock.java} (89%) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/PandalibPaperReflect.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/PandalibPaperReflect.java index 6dbcdf7..001d5a7 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/PandalibPaperReflect.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/PandalibPaperReflect.java @@ -66,7 +66,7 @@ import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.PlayerDataStorage; import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.SavedData; import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.Vec3; import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.VoxelShape; -import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.block.BambooBlock; +import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.block.BambooStalkBlock; import fr.pandacube.lib.paper.reflect.wrapper.netty.ByteBuf; import fr.pandacube.lib.paper.reflect.wrapper.netty.Unpooled; import fr.pandacube.lib.paper.reflect.wrapper.paper.AABBVoxelShape; @@ -164,7 +164,7 @@ public class PandalibPaperReflect { // minecraft.util initWrapper(ProgressListener.class, ProgressListener.MAPPING.runtimeClass()); // minecraft.world.block - initWrapper(BambooBlock.class, BambooBlock.MAPPING.runtimeClass()); + initWrapper(BambooStalkBlock.class, BambooStalkBlock.MAPPING.runtimeClass()); // minecraft.world initWrapper(AABB.class, AABB.MAPPING.runtimeClass()); initWrapper(ChunkPos.class, ChunkPos.MAPPING.runtimeClass()); diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/util/BedrockBambooCollisionFixer.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/util/BedrockBambooCollisionFixer.java index cac0e41..c8b5932 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/util/BedrockBambooCollisionFixer.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/util/BedrockBambooCollisionFixer.java @@ -2,7 +2,7 @@ package fr.pandacube.lib.paper.reflect.util; import fr.pandacube.lib.paper.PandaLibPaper; import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.AABB; -import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.block.BambooBlock; +import fr.pandacube.lib.paper.reflect.wrapper.minecraft.world.block.BambooStalkBlock; import fr.pandacube.lib.paper.reflect.wrapper.paper.AABBVoxelShape; import fr.pandacube.lib.util.Log; import org.bukkit.Bukkit; @@ -21,7 +21,7 @@ public final class BedrockBambooCollisionFixer implements Listener { public BedrockBambooCollisionFixer() { // Make the bamboo block have zero collision. try { - BambooBlock.COLLISION_SHAPE(new AABBVoxelShape(new AABB(0.5, 0, 0.5, 0.5, 0, 0.5))); + BambooStalkBlock.COLLISION_SHAPE(new AABBVoxelShape(new AABB(0.5, 0, 0.5, 0.5, 0, 0.5))); Log.info("Bamboo block collision box removed succesfully."); } catch (Exception e) { Log.severe("Unable to remove the collision box of the Bamboo block.", e); diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/BambooBlock.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/BambooStalkBlock.java similarity index 89% rename from pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/BambooBlock.java rename to pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/BambooStalkBlock.java index d00af14..e94c80c 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/BambooBlock.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/reflect/wrapper/minecraft/world/block/BambooStalkBlock.java @@ -8,8 +8,8 @@ import fr.pandacube.lib.reflect.ReflectField; import static fr.pandacube.lib.util.ThrowableUtil.wrapEx; import static fr.pandacube.lib.util.ThrowableUtil.wrapReflectEx; -public class BambooBlock extends ReflectWrapper { - public static final NMSReflect.ClassMapping MAPPING = wrapEx(() -> NMSReflect.mojClass("net.minecraft.world.level.block.BambooBlock")); +public class BambooStalkBlock extends ReflectWrapper { + public static final NMSReflect.ClassMapping MAPPING = wrapEx(() -> NMSReflect.mojClass("net.minecraft.world.level.block.BambooStalkBlock")); public static final ReflectField COLLISION_SHAPE = wrapEx(() -> MAPPING.mojField("COLLISION_SHAPE")); public static VoxelShape COLLISION_SHAPE() { @@ -20,7 +20,7 @@ public class BambooBlock extends ReflectWrapper { wrapReflectEx(() -> COLLISION_SHAPE.setStaticValue(unwrap(shape))); } - protected BambooBlock(Object obj) { + protected BambooStalkBlock(Object obj) { super(obj); } }