diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 9437356db..218f17767 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -8,6 +8,8 @@ import com.hbm.blocks.generic.*; import com.hbm.blocks.generic.BlockHazard.ExtDisplayEffect; import com.hbm.blocks.machine.*; import com.hbm.blocks.machine.albion.*; +import com.hbm.blocks.machine.fusion.MachineFusionBreeder; +import com.hbm.blocks.machine.fusion.MachineFusionKlystron; import com.hbm.blocks.machine.fusion.MachineFusionTorus; import com.hbm.blocks.machine.pile.*; import com.hbm.blocks.machine.rbmk.*; @@ -908,6 +910,12 @@ public class ModBlocks { public static Block fusion_component; public static Block fusion_torus; + public static Block fusion_klystron; + public static Block fusion_breeder; + public static Block fusion_collector; + public static Block fusion_boiler; + public static Block fusion_mhdt; + public static Block fusion_coupler; public static Block machine_icf_press; public static Block icf_component; @@ -2051,6 +2059,8 @@ public class ModBlocks { fusion_component = new BlockFusionComponent().setBlockName("fusion_component").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_component"); fusion_torus = new MachineFusionTorus().setBlockName("fusion_torus").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); + fusion_klystron = new MachineFusionKlystron().setBlockName("fusion_klystron").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); + fusion_breeder = new MachineFusionBreeder().setBlockName("fusion_breeder").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); machine_icf_press = new MachineICFPress().setBlockName("machine_icf_press").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); icf = new MachineICF().setBlockName("icf").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); @@ -3436,6 +3446,8 @@ public class ModBlocks { register(fusion_component); register(fusion_torus); + register(fusion_klystron); + register(fusion_breeder); register(watz_element); register(watz_cooler); diff --git a/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionBreeder.java b/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionBreeder.java new file mode 100644 index 000000000..af9421e30 --- /dev/null +++ b/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionBreeder.java @@ -0,0 +1,44 @@ +package com.hbm.blocks.machine.fusion; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.tileentity.TileEntityProxyCombo; +import com.hbm.tileentity.machine.fusion.TileEntityFusionBreeder; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class MachineFusionBreeder extends BlockDummyable { + + public MachineFusionBreeder() { + super(Material.iron); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + if(meta >= 12) return new TileEntityFusionBreeder(); + if(meta >= 6) return new TileEntityProxyCombo().power().fluid(); + return null; + } + + @Override + public int[] getDimensions() { + return new int[] { 3, 0, 2, 2, 1, 1 }; + } + + @Override + public int getOffset() { + return 2; + } + + @Override + public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) { + return super.checkRequirement(world, x, y, z, dir, o); + } + + @Override + public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + super.fillSpace(world, x, y, z, dir, o); + } +} diff --git a/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionKlystron.java b/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionKlystron.java new file mode 100644 index 000000000..880e61562 --- /dev/null +++ b/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionKlystron.java @@ -0,0 +1,44 @@ +package com.hbm.blocks.machine.fusion; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.tileentity.TileEntityProxyCombo; +import com.hbm.tileentity.machine.fusion.TileEntityFusionKlystron; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class MachineFusionKlystron extends BlockDummyable { + + public MachineFusionKlystron() { + super(Material.iron); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + if(meta >= 12) return new TileEntityFusionKlystron(); + if(meta >= 6) return new TileEntityProxyCombo().power().fluid(); + return null; + } + + @Override + public int[] getDimensions() { + return new int[] { 4, 0, 4, 3, 2, 2 }; + } + + @Override + public int getOffset() { + return 3; + } + + @Override + public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) { + return super.checkRequirement(world, x, y, z, dir, o); + } + + @Override + public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + super.fillSpace(world, x, y, z, dir, o); + } +} diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 5c76f64d0..b0c054c11 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -426,6 +426,8 @@ public class ClientProxy extends ServerProxy { //Fusion ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionTorusStruct.class, new RenderFusionTorusMultiblock()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionTorus.class, new RenderFusionTorus()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionKlystron.class, new RenderFusionKlystron()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionBreeder.class, new RenderFusionBreeder()); //Watz ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatz.class, new RenderWatz()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzPump.class, new RenderWatzPump()); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 207d5c181..4e5cf548a 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -249,6 +249,8 @@ public class ResourceManager { //ITER public static final IModelCustom iter = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/iter.obj")).asVBO(); public static final IModelCustom fusion_torus = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/torus.obj")).asVBO(); + public static final IModelCustom fusion_klystron = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/klystron.obj")).asVBO(); + public static final IModelCustom fusion_breeder = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/breeder.obj")).asVBO(); //ICF public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO(); @@ -700,6 +702,8 @@ public class ResourceManager { public static final ResourceLocation iter_torus_chlorophyte = new ResourceLocation(RefStrings.MODID, "textures/models/iter/torus_chlorophyte.png"); public static final ResourceLocation iter_torus_vaporwave = new ResourceLocation(RefStrings.MODID, "textures/models/iter/torus_vaporwave.png"); public static final ResourceLocation fusion_torus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/torus.png"); + public static final ResourceLocation fusion_klystron_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/klystron.png"); + public static final ResourceLocation fusion_breeder_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/breeder.png"); //ICF public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png"); diff --git a/src/main/java/com/hbm/render/tileentity/RenderFusionBreeder.java b/src/main/java/com/hbm/render/tileentity/RenderFusionBreeder.java new file mode 100644 index 000000000..d755ead55 --- /dev/null +++ b/src/main/java/com/hbm/render/tileentity/RenderFusionBreeder.java @@ -0,0 +1,61 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.main.ResourceManager; +import com.hbm.render.item.ItemRenderBase; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.client.IItemRenderer; + +public class RenderFusionBreeder extends TileEntitySpecialRenderer implements IItemRendererProvider { + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y, z + 0.5); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + + switch(tile.getBlockMetadata() - BlockDummyable.offset) { + case 2: GL11.glRotatef(90, 0F, 1F, 0F); break; + case 4: GL11.glRotatef(180, 0F, 1F, 0F); break; + case 3: GL11.glRotatef(270, 0F, 1F, 0F); break; + case 5: GL11.glRotatef(0, 0F, 1F, 0F); break; + } + + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.fusion_breeder_tex); + ResourceManager.fusion_breeder.renderPart("Breeder"); + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glPopMatrix(); + } + + @Override + public Item getItemForRenderer() { + return Item.getItemFromBlock(ModBlocks.fusion_breeder); + } + + @Override + public IItemRenderer getRenderer() { + return new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -3, 0); + GL11.glScaled(5, 5, 5); + GL11.glRotated(90, 0, 1, 0); + } + public void renderCommon() { + GL11.glScaled(0.5, 0.5, 0.5); + GL11.glRotatef(90, 0F, 1F, 0F); + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.fusion_breeder_tex); + ResourceManager.fusion_breeder.renderPart("Breeder"); + GL11.glShadeModel(GL11.GL_FLAT); + }}; + } +} diff --git a/src/main/java/com/hbm/render/tileentity/RenderFusionKlystron.java b/src/main/java/com/hbm/render/tileentity/RenderFusionKlystron.java new file mode 100644 index 000000000..b66235368 --- /dev/null +++ b/src/main/java/com/hbm/render/tileentity/RenderFusionKlystron.java @@ -0,0 +1,63 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.main.ResourceManager; +import com.hbm.render.item.ItemRenderBase; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.client.IItemRenderer; + +public class RenderFusionKlystron extends TileEntitySpecialRenderer implements IItemRendererProvider { + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y, z + 0.5); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + + switch(tile.getBlockMetadata() - BlockDummyable.offset) { + case 2: GL11.glRotatef(90, 0F, 1F, 0F); break; + case 4: GL11.glRotatef(180, 0F, 1F, 0F); break; + case 3: GL11.glRotatef(270, 0F, 1F, 0F); break; + case 5: GL11.glRotatef(0, 0F, 1F, 0F); break; + } + + GL11.glTranslated(-1, 0, 0); + + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.fusion_klystron_tex); + ResourceManager.fusion_klystron.renderAll(); + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glPopMatrix(); + } + + @Override + public Item getItemForRenderer() { + return Item.getItemFromBlock(ModBlocks.fusion_klystron); + } + + @Override + public IItemRenderer getRenderer() { + return new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -3, 1); + GL11.glScaled(3.5, 3.5, 3.5); + GL11.glRotated(90, 0, 1, 0); + } + public void renderCommon() { + GL11.glScaled(0.5, 0.5, 0.5); + GL11.glRotatef(90, 0F, 1F, 0F); + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.fusion_klystron_tex); + ResourceManager.fusion_klystron.renderAll(); + GL11.glShadeModel(GL11.GL_FLAT); + }}; + } +} diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index 7878059f4..3596fb2dc 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -415,6 +415,8 @@ public class TileMappings { private static void putFusion() { put(TileEntityFusionTorusStruct.class, "tileentity_fusion_torus_struct"); put(TileEntityFusionTorus.class, "tileentity_fusion_torus"); + put(TileEntityFusionKlystron.class, "tileentity_fusion_klystron"); + put(TileEntityFusionBreeder.class, "tileentity_fusion_breeder"); } private static void putNetwork() { diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionBreeder.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionBreeder.java new file mode 100644 index 000000000..0bd3ee0a5 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionBreeder.java @@ -0,0 +1,34 @@ +package com.hbm.tileentity.machine.fusion; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityFusionBreeder extends TileEntity { + + AxisAlignedBB bb = null; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + + if(bb == null) { + bb = AxisAlignedBB.getBoundingBox( + xCoord - 4, + yCoord, + zCoord - 4, + xCoord + 5, + yCoord + 5, + zCoord + 5 + ); + } + + return bb; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } +} diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionKlystron.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionKlystron.java new file mode 100644 index 000000000..697bac723 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionKlystron.java @@ -0,0 +1,34 @@ +package com.hbm.tileentity.machine.fusion; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityFusionKlystron extends TileEntity { + + AxisAlignedBB bb = null; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + + if(bb == null) { + bb = AxisAlignedBB.getBoundingBox( + xCoord - 4, + yCoord, + zCoord - 4, + xCoord + 5, + yCoord + 5, + zCoord + 5 + ); + } + + return bb; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } +}