From e6fbb4ded7c946a03796de54afa2a3e58ecf9a7b Mon Sep 17 00:00:00 2001 From: alltra101ify Date: Wed, 18 Nov 2015 09:10:32 -0600 Subject: [PATCH] Returned back to normal state and no multiple types of Stabilizers. --- .../modblocks/CoreStabilizer.java | 8 +++----- .../modblocks/EnderCoreGenerator.java | 2 +- .../modblocks/ModBlocks.java | 7 ++----- .../modblocks/NetherCoreGenerator.java | 10 +++++----- .../tileentities/TileEntityCoreStabilizer.java | 8 +++++++- .../proxy/ClientProxy.java | 7 +++---- .../renderer/RenderCoreStabilizer.java | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java index 043dd5c..2ace878 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java @@ -16,8 +16,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class CoreStabilizer extends ModMachineBlock { - byte type; - protected CoreStabilizer(byte type) { + protected CoreStabilizer() { super(Material.rock); setBlockName("CoreStabilizer"); setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5)); @@ -25,12 +24,11 @@ public class CoreStabilizer extends ModMachineBlock { setResistance(8); setHardness(8); setHarvestLevel("pickaxe", 2); - this.type = type; } @Override public TileEntity createNewTileEntity(World world, int var) { - return new TileEntityCoreStabilizer(world); + return new TileEntityCoreStabilizer(); } public int getRenderType() { @@ -51,7 +49,7 @@ public class CoreStabilizer extends ModMachineBlock { isMultBlock(world, x, y, z); } if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) { - int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer_default, 1)); + int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer, 1)); } return true; } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java index 76d49d6..9f4d9cb 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/EnderCoreGenerator.java @@ -86,7 +86,7 @@ public class EnderCoreGenerator extends ModMachineBlock { } public void isMultiBlock(World world, int x, int y, int z) { - if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { + if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java index c598266..335cef8 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java @@ -11,9 +11,7 @@ public class ModBlocks { public static Block creditsBlock = new Blocker(); public static Block ASUPedestal = new ASUPedestal(); public static Block EnderCoreGenerator = new EnderCoreGenerator(); - public static Block CoreStabilizer_default = new CoreStabilizer((byte) 0); - public static Block CoreStabilizer_nether = new CoreStabilizer((byte) 1); - public static Block CoreStabilizer_ender = new CoreStabilizer((byte) 2); + public static Block CoreStabilizer = new CoreStabilizer(); public static Block quaridiumOre = new QuaridiumOre(Material.iron); public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron); public static Block netherCoreGenerator = new NetherCoreGenerator(); @@ -23,8 +21,7 @@ public class ModBlocks { ASURegistryHelper.registerBlock(creditsBlock); ASURegistryHelper.registerBlock(ASUPedestal); ASURegistryHelper.registerBlock(EnderCoreGenerator); - ASURegistryHelper.registerBlock(CoreStabilizer_default); - ASURegistryHelper.registerBlock(CoreStabilizer_nether); + ASURegistryHelper.registerBlock(CoreStabilizer); ASURegistryHelper.registerBlock(quaridiumOre); ASURegistryHelper.registerBlock(blockofashadwithquaridium); ASURegistryHelper.registerBlock(netherCoreGenerator); diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java index 54e5e73..3962ce4 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java @@ -78,9 +78,9 @@ public class NetherCoreGenerator extends ModMachineBlock { } public void isMultiBlock(World world, int x, int y, int z) { - if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { - world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer_nether); - world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer_nether); + if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { + world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer); + world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer); ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; @@ -90,12 +90,12 @@ public class NetherCoreGenerator extends ModMachineBlock { ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false; if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) { ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = false; - world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer_default); + world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer); world.markBlockForUpdate(x, y+1, z); } if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) { ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = false; - world.setBlock(x, y, z, ModBlocks.CoreStabilizer_default); + world.setBlock(x, y, z, ModBlocks.CoreStabilizer); world.markBlockForUpdate(x, y-1, z); } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java index eb03923..1ae8f66 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/tileentities/TileEntityCoreStabilizer.java @@ -8,8 +8,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class TileEntityCoreStabilizer extends TileEntity { + byte type; - public TileEntityCoreStabilizer(World world) { + public TileEntityCoreStabilizer (byte type) { + this.type = type; } public TileEntityCoreStabilizer() { @@ -62,4 +64,8 @@ public class TileEntityCoreStabilizer extends TileEntity { readFromNBT(pkt.func_148857_g()); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } + + public byte getType() { + return type; + } } diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/proxy/ClientProxy.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/proxy/ClientProxy.java index f5afca7..2e6da19 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/proxy/ClientProxy.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/proxy/ClientProxy.java @@ -32,10 +32,9 @@ public class ClientProxy extends CommonProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnderCoreGenerator.class, renderEnderCore); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator())); - TileEntitySpecialRenderer renderCoreStabilizer_default = new RenderCoreStabilizer((byte) 0); - TileEntitySpecialRenderer renderCoreStabilizer_nether = new RenderCoreStabilizer((byte) 2); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer_default); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer_default), new ItemRenderCoreStabilizer(renderCoreStabilizer_default, new TileEntityCoreStabilizer())); + TileEntitySpecialRenderer renderCoreStabilizer = new RenderCoreStabilizer(); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer), new ItemRenderCoreStabilizer(renderCoreStabilizer, new TileEntityCoreStabilizer())); TileEntitySpecialRenderer renderNetherCore = new RenderNetherCoreGenerator(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNetherCoreGenerator.class, renderNetherCore); diff --git a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java index bff07f2..bb2f701 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java @@ -36,7 +36,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer { } - public RenderCoreStabilizer(byte type) { + public RenderCoreStabilizer() { for (int i = 0; i < texture.length; i++) { texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png"); }