From 0caf8359eb7b97505314ef2725b4640715693050 Mon Sep 17 00:00:00 2001 From: 54M44R <26176694+54M44R@users.noreply.github.com> Date: Tue, 5 Nov 2024 05:25:44 -0500 Subject: [PATCH] Fix Ancient Blocks being Invalid Stabilisers (#42) * Reassign TBSidedBlock extend to TBBlockDeco TBBLock & TBBLockDeco are identical. All instances of TBBLock & TBSidedBlock are valid stabilisers * Remove redundant TBBlock class * Implement IInfusionStabiliser in TBSidedBlock Adds the proper tooltip to blocks which are valid stabilisers --- src/main/java/tb/common/block/TBBlock.java | 53 ------------------- .../java/tb/common/block/TBSidedBlock.java | 3 +- src/main/java/tb/init/TBBlocks.java | 13 ++--- 3 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 src/main/java/tb/common/block/TBBlock.java diff --git a/src/main/java/tb/common/block/TBBlock.java b/src/main/java/tb/common/block/TBBlock.java deleted file mode 100644 index 1577f3d..0000000 --- a/src/main/java/tb/common/block/TBBlock.java +++ /dev/null @@ -1,53 +0,0 @@ -package tb.common.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.boss.EntityDragon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import tb.init.TBBlocks; -import thaumcraft.api.crafting.IInfusionStabiliser; - -public class TBBlock extends Block implements IInfusionStabiliser { - - boolean isGlass; - boolean stabilise; - - public TBBlock(Material m, boolean b) { - super(m); - isGlass = b; - } - - public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { - if (entity instanceof EntityDragon) return this != TBBlocks.enderPlanks; - - return super.canEntityDestroy(world, x, y, z, entity); - } - - public Block stabilise() { - stabilise = true; - return this; - } - - public boolean isOpaqueCube() { - return !isGlass; - } - - public int getLightOpacity() { - return isGlass ? 7 : 15; - } - - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isGlass ? 1 : 0; - } - - @Override - public boolean canStabaliseInfusion(World world, int x, int y, int z) { - return stabilise; - } -} diff --git a/src/main/java/tb/common/block/TBSidedBlock.java b/src/main/java/tb/common/block/TBSidedBlock.java index e491d43..63dd1dd 100644 --- a/src/main/java/tb/common/block/TBSidedBlock.java +++ b/src/main/java/tb/common/block/TBSidedBlock.java @@ -6,8 +6,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import thaumcraft.api.crafting.IInfusionStabiliser; -public class TBSidedBlock extends TBBlock { +public class TBSidedBlock extends TBBlockDeco implements IInfusionStabiliser { public IIcon sideIcon; diff --git a/src/main/java/tb/init/TBBlocks.java b/src/main/java/tb/init/TBBlocks.java index ad1813d..9b40486 100644 --- a/src/main/java/tb/init/TBBlocks.java +++ b/src/main/java/tb/init/TBBlocks.java @@ -41,7 +41,6 @@ import tb.common.block.BlockThaumicAnvil; import tb.common.block.BlockVoid; import tb.common.block.BlockVoidAnvil; -import tb.common.block.TBBlock; import tb.common.block.TBBlockDeco; import tb.common.block.TBSidedBlock; import tb.common.itemblock.ItemBlockCrystal; @@ -61,25 +60,21 @@ public class TBBlocks { public static final Class core = TBCore.class; - public static Block quicksilverBlock = new TBBlock(Material.iron, false).stabilise() - .setBlockName("quicksilverBlock") + public static Block quicksilverBlock = new TBBlockDeco(Material.iron, false).setBlockName("quicksilverBlock") .setBlockTextureName("thaumicbases:quicksilverBlock") .setHardness(1F); - public static Block quicksilverBrick = new TBBlock(Material.rock, true).stabilise() - .setBlockName("quicksilverBrick") + public static Block quicksilverBrick = new TBBlockDeco(Material.rock, true).setBlockName("quicksilverBrick") .setBlockTextureName("thaumicbases:quicksilverBrick") .setHardness(1F); public static Block crystalBlock = new BlockCrystalBlock().setBlockName("crystalBlock") .setBlockTextureName("thaumicbases:crystal/mixed"); - public static Block dustBlock = new TBBlock(Material.sand, false).stabilise() - .setStepSound(Block.soundTypeSand) + public static Block dustBlock = new TBBlockDeco(Material.sand, false).setStepSound(Block.soundTypeSand) .setBlockName("salisMundusBlock") .setBlockTextureName("thaumicbases:dust_block") .setHardness(1F); public static Block pyrofluid = new BlockPyrofluid().setBlockName("pyrofluid") .setLightLevel(1); - public static Block thauminiteBlock = new TBBlock(Material.iron, false).stabilise() - .setBlockName("thauminiteBlock") + public static Block thauminiteBlock = new TBBlockDeco(Material.iron, false).setBlockName("thauminiteBlock") .setBlockTextureName("thaumicbases:thauminiteblock") .setHardness(2F); public static Block eldritchArk = new TBBlockDeco(Material.rock, false).setBlockName("eldritchArk")