From ed5825b11773ce614de91301559fdbdf8b7d0461 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Fri, 19 Jan 2024 19:00:35 +0100 Subject: [PATCH] add compatiblity with CarpentersBlocks --- dependencies.gradle | 1 + .../java/bl4ckscor3/mod/sit/SitHandler.java | 31 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 96602fd..12471b4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -35,4 +35,5 @@ */ dependencies { implementation(rfg.deobf(fileTree(dir: 'libs/implementation', include: ['*.jar']))) + implementation("com.github.GTNewHorizons:CarpentersBlocks:3.5.1-GTNH:dev"); } diff --git a/src/main/java/bl4ckscor3/mod/sit/SitHandler.java b/src/main/java/bl4ckscor3/mod/sit/SitHandler.java index a4cf5bc..2f0e6ad 100644 --- a/src/main/java/bl4ckscor3/mod/sit/SitHandler.java +++ b/src/main/java/bl4ckscor3/mod/sit/SitHandler.java @@ -27,16 +27,41 @@ public void onPlayerInteract(PlayerInteractEvent event) { if (!EntitySit.OCCUPIED.containsKey(p) && e.getHeldItem() == null) { if (b instanceof BlockSlab) { if ((w.getBlockMetadata(p.x, p.y, p.z) & 8) != 0) return; - } else if (b instanceof BlockStairs) { + } + else if (b instanceof BlockStairs) { if ((w.getBlockMetadata(p.x, p.y, p.z) & 4) != 0) return; - } else if (Loader.isModLoaded("ImmersiveEngineering") + } + else if (Loader.isModLoaded("ImmersiveEngineering") && b instanceof blusunrize.immersiveengineering.common.blocks.BlockIESlabs) { TileEntity te = w.getTileEntity(event.x, event.y, event.z); if ((te instanceof blusunrize.immersiveengineering.common.blocks.TileEntityIESlab) && ((blusunrize.immersiveengineering.common.blocks.TileEntityIESlab) te).slabType != 0) return; - } else return; + } + else if (Loader.isModLoaded("CarpentersBlocks")) + { + if (b instanceof com.carpentersblocks.block.BlockCarpentersStairs) + { + } + else if (b instanceof com.carpentersblocks.block.BlockCarpentersSlope) + { + } + else if (b instanceof com.carpentersblocks.block.BlockCarpentersBlock) + { + TileEntity te = w.getTileEntity(event.x, event.y, event.z); + + if (te instanceof com.carpentersblocks.tileentity.TEBase) + { + com.carpentersblocks.tileentity.TEBase TE = (com.carpentersblocks.tileentity.TEBase)te; + if (TE.getData() != com.carpentersblocks.data.Slab.SLAB_Y_NEG) + return; + } + } + else + return; + } + else return; EntitySit sit = new EntitySit(w, p);