From 90ae47bc9c94310caabea09ec8fb9dad0a3f48b4 Mon Sep 17 00:00:00 2001 From: alltra101ify Date: Mon, 16 Nov 2015 16:30:32 -0600 Subject: [PATCH] Partially done textures per core setup... --- .../modblocks/CoreStabilizer.java | 6 ++++-- .../modblocks/EnderCoreGenerator.java | 2 +- .../advancedsatelliteutilization/modblocks/ModBlocks.java | 7 +++++-- .../modblocks/NetherCoreGenerator.java | 6 +++++- .../advancedsatelliteutilization/proxy/ClientProxy.java | 7 ++++--- .../renderer/RenderCoreStabilizer.java | 6 ++++-- 6 files changed, 23 insertions(+), 11 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 6a461be..043dd5c 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/CoreStabilizer.java @@ -16,7 +16,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class CoreStabilizer extends ModMachineBlock { - protected CoreStabilizer() { + byte type; + protected CoreStabilizer(byte type) { super(Material.rock); setBlockName("CoreStabilizer"); setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5)); @@ -24,6 +25,7 @@ public class CoreStabilizer extends ModMachineBlock { setResistance(8); setHardness(8); setHarvestLevel("pickaxe", 2); + this.type = type; } @Override @@ -49,7 +51,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, 1)); + int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer_default, 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 9f4d9cb..76d49d6 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 && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && 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_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) { ((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 335cef8..c598266 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/ModBlocks.java @@ -11,7 +11,9 @@ 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 = new CoreStabilizer(); + 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 quaridiumOre = new QuaridiumOre(Material.iron); public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron); public static Block netherCoreGenerator = new NetherCoreGenerator(); @@ -21,7 +23,8 @@ public class ModBlocks { ASURegistryHelper.registerBlock(creditsBlock); ASURegistryHelper.registerBlock(ASUPedestal); ASURegistryHelper.registerBlock(EnderCoreGenerator); - ASURegistryHelper.registerBlock(CoreStabilizer); + ASURegistryHelper.registerBlock(CoreStabilizer_default); + ASURegistryHelper.registerBlock(CoreStabilizer_nether); 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 0a822b1..54e5e73 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/modblocks/NetherCoreGenerator.java @@ -78,7 +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 && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && 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_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); ((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; @@ -88,10 +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.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.markBlockForUpdate(x, y-1, z); } } 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 2e6da19..f5afca7 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/proxy/ClientProxy.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/proxy/ClientProxy.java @@ -32,9 +32,10 @@ public class ClientProxy extends CommonProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnderCoreGenerator.class, renderEnderCore); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator())); - TileEntitySpecialRenderer renderCoreStabilizer = new RenderCoreStabilizer(); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer), new ItemRenderCoreStabilizer(renderCoreStabilizer, new TileEntityCoreStabilizer())); + 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 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 ba6a4b9..bff07f2 100644 --- a/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java +++ b/src/main/java/org/bitbucket/alltra101ify/advancedsatelliteutilization/renderer/RenderCoreStabilizer.java @@ -13,6 +13,8 @@ import net.minecraft.util.ResourceLocation; public class RenderCoreStabilizer extends TileEntitySpecialRenderer { + byte type; + private ModelCoreStabilizer modelASU = new ModelCoreStabilizer(); public static ResourceLocation[] texture = new ResourceLocation[3]; public void renderTileEntityAt(TileEntityCoreStabilizer tileentity, double x, @@ -26,7 +28,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer { GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); GL11.glRotatef(180, 0f, 0f, 1f); - this.bindTexture(texture[1]); + this.bindTexture(texture[type]); modelASU.renderModel(0.0625f); @@ -34,7 +36,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer { } - public RenderCoreStabilizer() { + public RenderCoreStabilizer(byte type) { for (int i = 0; i < texture.length; i++) { texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png"); }