the great energy massacre part 2

This commit is contained in:
Boblet 2021-11-16 15:39:24 +01:00
parent 8539a9b830
commit 810786fa9d
32 changed files with 561 additions and 781 deletions

View File

@ -23,7 +23,9 @@ public interface IEnergyConnector {
* @param dir * @param dir
* @return * @return
*/ */
public boolean canConnect(ForgeDirection dir); public default boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UNKNOWN;
}
/** /**
* The current power of either the machine or an entire network * The current power of either the machine or an entire network

View File

@ -0,0 +1,13 @@
package api.hbm.energy;
public interface IEnergyGenerator extends IEnergyUser {
/**
* Standard implementation for machines that can only send energy but never receive it.
* @param power
*/
@Override
public default long transferPower(long power) {
return power;
}
}

View File

@ -1,5 +1,9 @@
package api.hbm.energy; package api.hbm.energy;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
/** /**
* For machines and things that have an energy buffer and are affected by EMPs * For machines and things that have an energy buffer and are affected by EMPs
* @author hbm * @author hbm
@ -10,4 +14,74 @@ public interface IEnergyUser extends IEnergyConnector {
* Not to be used for actual energy transfer, rather special external things like EMPs and sync packets * Not to be used for actual energy transfer, rather special external things like EMPs and sync packets
*/ */
public void setPower(long power); public void setPower(long power);
/**
* Standard implementation for power transfer.
* Turns out you can override interfaces to provide a default implementation. Neat.
* @param long power
*/
@Override
public default long transferPower(long power) {
this.setPower(this.getPower() + power);
if(this.getPower() > this.getMaxPower()) {
long overshoot = this.getPower() - this.getMaxPower();
this.setPower(this.getMaxPower());
return overshoot;
}
return 0;
}
/**
* Standard implementation of sending power
* @param world
* @param x
* @param y
* @param z
* @param dir
*/
public default void sendPower(World world, int x, int y, int z, ForgeDirection dir) {
TileEntity te = world.getTileEntity(x, y, z);
boolean wasSubscribed = false;
// first we make sure we're not subscribed to the network that we'll be supplying
if(te instanceof IEnergyConductor) {
IEnergyConductor con = (IEnergyConductor) te;
if(con.getPowerNet() != null && con.getPowerNet().isSubscribed(this)) {
con.getPowerNet().unsubscribe(this);
wasSubscribed = true;
}
}
//then we add energy
if(te instanceof IEnergyConnector) {
IEnergyConnector con = (IEnergyConnector) te;
if(con.canConnect(dir)) {
long oldPower = this.getPower();
long transfer = oldPower - con.transferPower(oldPower);
this.setPower(oldPower - transfer);
}
}
//then we subscribe if possible
if(wasSubscribed && te instanceof IEnergyConductor) {
IEnergyConductor con = (IEnergyConductor) te;
if(con.getPowerNet() != null && !con.getPowerNet().isSubscribed(this)) {
con.getPowerNet().subscribe(this);
}
}
}
public default void updateStandardConnections(World world, int x, int y, int z) {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
}
} }

View File

@ -1,7 +1,9 @@
package com.hbm.blocks.network; package com.hbm.blocks.network;
import com.hbm.tileentity.conductor.TileEntityCable; import com.hbm.blocks.test.TestConductor;
import com.hbm.tileentity.network.TileEntityCableBaseNT;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -13,60 +15,16 @@ public class BlockCable extends BlockContainer {
public BlockCable(Material p_i45386_1_) { public BlockCable(Material p_i45386_1_) {
super(p_i45386_1_); super(p_i45386_1_);
float p = 1F/16F;
this.setBlockBounds(11 * p / 2, 11 * p / 2, 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2);
this.useNeighborBrightness = true;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
if(world.getTileEntity(x, y, z) instanceof TileEntityCable) {
TileEntityCable cable = (TileEntityCable)world.getTileEntity(x, y, z);
if(cable != null)
{
float p = 1F/16F;
float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0);
float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0);
float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0);
float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0);
float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0);
float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0);
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
}
}
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
if(world.getTileEntity(x, y, z) instanceof TileEntityCable) {
TileEntityCable cable = (TileEntityCable)world.getTileEntity(x, y, z);
if(cable != null)
{
float p = 1F/16F;
float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0);
float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0);
float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0);
float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0);
float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0);
float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0);
this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
}
}
} }
@Override @Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityCable(); return new TileEntityCableBaseNT();
} }
@Override @Override
public int getRenderType(){ public int getRenderType() {
return -1; return TestConductor.renderID;
} }
@Override @Override
@ -78,5 +36,4 @@ public class BlockCable extends BlockContainer {
public boolean renderAsNormalBlock() { public boolean renderAsNormalBlock() {
return false; return false;
} }
} }

View File

@ -1,7 +1,7 @@
package com.hbm.blocks.network; package com.hbm.blocks.network;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.tileentity.conductor.TileEntityCableSwitch; import com.hbm.tileentity.network.TileEntityCableBaseNT;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -37,7 +37,7 @@ public class CableSwitch extends BlockContainer {
@Override @Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityCableSwitch(); return new TileEntityCableBaseNT(); //TODO: extends this and implement switching
} }
@Override @Override

View File

@ -3,7 +3,7 @@ package com.hbm.blocks.network;
import com.hbm.render.block.ct.CT; import com.hbm.render.block.ct.CT;
import com.hbm.render.block.ct.CTStitchReceiver; import com.hbm.render.block.ct.CTStitchReceiver;
import com.hbm.render.block.ct.IBlockCT; import com.hbm.render.block.ct.IBlockCT;
import com.hbm.tileentity.conductor.TileEntityWireCoated; import com.hbm.tileentity.network.TileEntityCableBaseNT;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -22,7 +22,7 @@ public class WireCoated extends BlockContainer implements IBlockCT {
@Override @Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityWireCoated(); return new TileEntityCableBaseNT();
} }
@Override @Override

View File

@ -17,15 +17,12 @@ import com.hbm.interfaces.IFluidSource;
import com.hbm.interfaces.Spaghetti; import com.hbm.interfaces.Spaghetti;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.tileentity.TileEntityProxyInventory; import com.hbm.tileentity.TileEntityProxyInventory;
import com.hbm.tileentity.conductor.TileEntityCable;
import com.hbm.tileentity.conductor.TileEntityCableSwitch;
import com.hbm.tileentity.conductor.TileEntityFluidDuct; import com.hbm.tileentity.conductor.TileEntityFluidDuct;
import com.hbm.tileentity.conductor.TileEntityGasDuct; import com.hbm.tileentity.conductor.TileEntityGasDuct;
import com.hbm.tileentity.conductor.TileEntityGasDuctSolid; import com.hbm.tileentity.conductor.TileEntityGasDuctSolid;
import com.hbm.tileentity.conductor.TileEntityOilDuct; import com.hbm.tileentity.conductor.TileEntityOilDuct;
import com.hbm.tileentity.conductor.TileEntityOilDuctSolid; import com.hbm.tileentity.conductor.TileEntityOilDuctSolid;
import com.hbm.tileentity.conductor.TileEntityPylonRedWire; import com.hbm.tileentity.conductor.TileEntityPylonRedWire;
import com.hbm.tileentity.conductor.TileEntityWireCoated;
import com.hbm.tileentity.machine.TileEntityDummy; import com.hbm.tileentity.machine.TileEntityDummy;
import com.hbm.tileentity.machine.TileEntityMachineBattery; import com.hbm.tileentity.machine.TileEntityMachineBattery;
import com.hbm.tileentity.machine.TileEntityMachineTransformer; import com.hbm.tileentity.machine.TileEntityMachineTransformer;

View File

@ -230,7 +230,6 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzLauncher.class, new RenderSoyuzLauncher()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzLauncher.class, new RenderSoyuzLauncher());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzCapsule.class, new RenderCapsule()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzCapsule.class, new RenderCapsule());
//network //network
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCable.class, new RenderCable());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOilDuct.class, new RenderOilDuct()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOilDuct.class, new RenderOilDuct());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGasDuct.class, new RenderGasDuct()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGasDuct.class, new RenderGasDuct());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidDuct.class, new RenderFluidDuct()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidDuct.class, new RenderFluidDuct());

View File

@ -293,8 +293,12 @@ public class MainRegistry {
TileMappings.writeMappings(); TileMappings.writeMappings();
for(Entry<Class<? extends TileEntity>, String> e : TileMappings.map.entrySet()) { for(Entry<Class<? extends TileEntity>, String[]> e : TileMappings.map.entrySet()) {
GameRegistry.registerTileEntity(e.getKey(), e.getValue());
if(e.getValue().length == 1)
GameRegistry.registerTileEntity(e.getKey(), e.getValue()[0]);
else
GameRegistry.registerTileEntityWithAlternatives(e.getKey(), e.getValue()[0], e.getValue());
} }
ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(new ItemStack(ModItems.armor_polish), 1, 1, 3)); ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(new ItemStack(ModItems.armor_polish), 1, 1, 3));

View File

@ -1,160 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.conductor.TileEntityCable;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
public class RenderCable extends TileEntitySpecialRenderer {
public ResourceLocation texture = new ResourceLocation(RefStrings.MODID, "textures/blocks/red_cable.png");
float pixel = 1F/16F;
float textureP = 1F / 32F;
@Override
public void renderTileEntityAt(TileEntity tileentity, double offsetX, double offsetY, double offsetZ, float f) {
GL11.glTranslated(offsetX, offsetY, offsetZ);
GL11.glDisable(GL11.GL_LIGHTING);
this.bindTexture(texture);
drawCore(tileentity);
TileEntityCable cable = (TileEntityCable) tileentity;
for(int i = 0; i < cable.connections.length; i++)
{
if(cable.connections[i] != null)
{
drawConnection(cable.connections[i]);
}
}
GL11.glTranslated(-offsetX, -offsetY, -offsetZ);
GL11.glEnable(GL11.GL_LIGHTING);
}
public void drawCore(TileEntity tileentity) {
Tessellator tesseract = Tessellator.instance;
tesseract.startDrawingQuads();
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP);
tesseract.draw();
// Muehsam muss ich hier im BSH meine genialen Mods schreiben, obwohl ich die Zeit eigentlich doch besser nutzen koennte.
// Da mir das aber Spass macht, wird auch in Zukunft gutes Zeug von mir geben (und damit meine ich NICHT Drogen, etc.)
// Danke.
//I didn't write this, but I'm gonna leave it there.
}
public void drawConnection(ForgeDirection direction)
{
Tessellator tesseract = Tessellator.instance;
tesseract.startDrawingQuads();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
if(direction.equals(ForgeDirection.UP))
{
}
if(direction.equals(ForgeDirection.DOWN))
{
GL11.glRotatef(180, 1, 0, 0);
}
if(direction.equals(ForgeDirection.NORTH))
{
GL11.glRotatef(270, 1, 0, 0);
}
if(direction.equals(ForgeDirection.SOUTH))
{
GL11.glRotatef(90, 1, 0, 0);
}
if(direction.equals(ForgeDirection.EAST))
{
GL11.glRotatef(270, 0, 0, 1);
}
if(direction.equals(ForgeDirection.WEST))
{
GL11.glRotatef(90, 0, 0, 1);
}
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 5 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 0 * textureP);
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 5 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 0 * textureP);
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP);
tesseract.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
if(direction.equals(ForgeDirection.UP))
{
}
if(direction.equals(ForgeDirection.DOWN))
{
GL11.glRotatef(-180, 1, 0, 0);
}
if(direction.equals(ForgeDirection.NORTH))
{
GL11.glRotatef(-270, 1, 0, 0);
}
if(direction.equals(ForgeDirection.SOUTH))
{
GL11.glRotatef(-90, 1, 0, 0);
}
if(direction.equals(ForgeDirection.EAST))
{
GL11.glRotatef(-270, 0, 0, 1);
}
if(direction.equals(ForgeDirection.WEST))
{
GL11.glRotatef(-90, 0, 0, 1);
}
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
}
}

View File

@ -18,182 +18,181 @@ import net.minecraft.tileentity.TileEntity;
public class TileMappings { public class TileMappings {
public static HashMap<Class<? extends TileEntity>, String> map = new HashMap(); public static HashMap<Class<? extends TileEntity>, String[]> map = new HashMap();
public static void writeMappings() { public static void writeMappings() {
map.put(TileEntityTestBombAdvanced.class, "tilentity_testbombadvanced"); put(TileEntityTestBombAdvanced.class, "tilentity_testbombadvanced");
map.put(TileEntityDiFurnace.class, "tilentity_diFurnace"); put(TileEntityDiFurnace.class, "tilentity_diFurnace");
map.put(TileEntityTestNuke.class, "tilentity_testnuke"); put(TileEntityTestNuke.class, "tilentity_testnuke");
map.put(TileEntityRotationTester.class, "tilentity_rotationtester"); put(TileEntityRotationTester.class, "tilentity_rotationtester");
map.put(TileEntityTestRender.class, "tilentity_testrenderer"); put(TileEntityTestRender.class, "tilentity_testrenderer");
map.put(TileEntityTestContainer.class, "tilentity_testcontainer"); put(TileEntityTestContainer.class, "tilentity_testcontainer");
map.put(TileEntityObjTester.class, "tilentity_objtester"); put(TileEntityObjTester.class, "tilentity_objtester");
map.put(TileEntityMachineCentrifuge.class, "tileentity_centrifuge"); put(TileEntityMachineCentrifuge.class, "tileentity_centrifuge");
map.put(TileEntityNukeMan.class, "tileentity_nukeman"); put(TileEntityNukeMan.class, "tileentity_nukeman");
map.put(TileEntityMachineUF6Tank.class, "tileentity_uf6_tank"); put(TileEntityMachineUF6Tank.class, "tileentity_uf6_tank");
map.put(TileEntityMachinePuF6Tank.class, "tileentity_puf6_tank"); put(TileEntityMachinePuF6Tank.class, "tileentity_puf6_tank");
map.put(TileEntityMachineReactor.class, "tileentity_reactor"); put(TileEntityMachineReactor.class, "tileentity_reactor");
map.put(TileEntityNukeFurnace.class, "tileentity_nukefurnace"); put(TileEntityNukeFurnace.class, "tileentity_nukefurnace");
map.put(TileEntityRtgFurnace.class, "tileentity_rtgfurnace"); put(TileEntityRtgFurnace.class, "tileentity_rtgfurnace");
map.put(TileEntityMachineGenerator.class, "tileentity_generator"); put(TileEntityMachineGenerator.class, "tileentity_generator");
map.put(TileEntityMachineElectricFurnace.class, "tileentity_electric_furnace"); put(TileEntityMachineElectricFurnace.class, "tileentity_electric_furnace");
map.put(TileEntityDecoTapeRecorder.class, "tileentity_taperecorder"); put(TileEntityDecoTapeRecorder.class, "tileentity_taperecorder");
map.put(TileEntityDecoSteelPoles.class, "tileentity_steelpoles"); put(TileEntityDecoSteelPoles.class, "tileentity_steelpoles");
map.put(TileEntityDecoPoleTop.class, "tileentity_poletop"); put(TileEntityDecoPoleTop.class, "tileentity_poletop");
map.put(TileEntityDecoPoleSatelliteReceiver.class, "tileentity_satellitereceicer"); put(TileEntityDecoPoleSatelliteReceiver.class, "tileentity_satellitereceicer");
map.put(TileEntityMachineDeuterium.class, "tileentity_deuterium"); put(TileEntityMachineDeuterium.class, "tileentity_deuterium");
map.put(TileEntityWireCoated.class, "tileentity_wirecoated"); put(TileEntityMachineBattery.class, "tileentity_battery");
map.put(TileEntityMachineBattery.class, "tileentity_battery"); put(TileEntityMachineCoal.class, "tileentity_coal");
map.put(TileEntityMachineCoal.class, "tileentity_coal"); put(TileEntityRedBarrel.class, "tileentity_barrel");
map.put(TileEntityRedBarrel.class, "tileentity_barrel"); put(TileEntityYellowBarrel.class, "tileentity_nukebarrel");
map.put(TileEntityYellowBarrel.class, "tileentity_nukebarrel"); put(TileEntityLaunchPad.class, "tileentity_launch1");
map.put(TileEntityLaunchPad.class, "tileentity_launch1"); put(TileEntityDecoBlock.class, "tileentity_deco");
map.put(TileEntityDecoBlock.class, "tileentity_deco"); put(TileEntityDecoBlockAltW.class, "tileentity_deco_w");
map.put(TileEntityDecoBlockAltW.class, "tileentity_deco_w"); put(TileEntityDecoBlockAltG.class, "tileentity_deco_g");
map.put(TileEntityDecoBlockAltG.class, "tileentity_deco_g"); put(TileEntityDecoBlockAltF.class, "tileentity_deco_f");
map.put(TileEntityDecoBlockAltF.class, "tileentity_deco_f"); put(TileEntityCoreTitanium.class, "tileentity_core_titanium");
map.put(TileEntityCoreTitanium.class, "tileentity_core_titanium"); put(TileEntityCoreAdvanced.class, "tileentity_core_advanced");
map.put(TileEntityCoreAdvanced.class, "tileentity_core_advanced"); put(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock");
map.put(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock"); put(TileEntityCrashedBomb.class, "tileentity_crashed_balefire");
map.put(TileEntityCrashedBomb.class, "tileentity_crashed_balefire"); put(TileEntityConverterHeRf.class, "tileentity_converter_herf");
map.put(TileEntityCable.class, "tileentity_cable"); put(TileEntityConverterRfHe.class, "tileentity_converter_rfhe");
map.put(TileEntityConverterHeRf.class, "tileentity_converter_herf"); put(TileEntityMachineSchrabidiumTransmutator.class, "tileentity_schrabidium_transmutator");
map.put(TileEntityConverterRfHe.class, "tileentity_converter_rfhe"); put(TileEntityMachineDiesel.class, "tileentity_diesel_generator");
map.put(TileEntityMachineSchrabidiumTransmutator.class, "tileentity_schrabidium_transmutator"); put(TileEntityWatzCore.class, "tileentity_watz_multiblock");
map.put(TileEntityMachineDiesel.class, "tileentity_diesel_generator"); put(TileEntityMachineShredder.class, "tileentity_machine_shredder");
map.put(TileEntityWatzCore.class, "tileentity_watz_multiblock"); put(TileEntityMachineCMBFactory.class, "tileentity_machine_cmb");
map.put(TileEntityMachineShredder.class, "tileentity_machine_shredder"); put(TileEntityFWatzCore.class, "tileentity_fwatz_multiblock");
map.put(TileEntityMachineCMBFactory.class, "tileentity_machine_cmb"); put(TileEntityMachineTeleporter.class, "tileentity_teleblock");
map.put(TileEntityFWatzCore.class, "tileentity_fwatz_multiblock"); put(TileEntityHatch.class, "tileentity_seal_lid");
map.put(TileEntityMachineTeleporter.class, "tileentity_teleblock"); put(TileEntityMachineIGenerator.class, "tileentity_igenerator");
map.put(TileEntityHatch.class, "tileentity_seal_lid"); put(TileEntityDummy.class, "tileentity_dummy");
map.put(TileEntityMachineIGenerator.class, "tileentity_igenerator"); put(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
map.put(TileEntityDummy.class, "tileentity_dummy"); put(TileEntityOilDuct.class, "tileentity_oil_duct");
map.put(TileEntityMachineCyclotron.class, "tileentity_cyclotron"); put(TileEntityOilDuctSolid.class, "tileentity_oil_duct_solid");
map.put(TileEntityOilDuct.class, "tileentity_oil_duct"); put(TileEntityGasDuct.class, "tileentity_gas_duct");
map.put(TileEntityOilDuctSolid.class, "tileentity_oil_duct_solid"); put(TileEntityGasDuctSolid.class, "tileentity_gas_duct_solid");
map.put(TileEntityGasDuct.class, "tileentity_gas_duct"); put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
map.put(TileEntityGasDuctSolid.class, "tileentity_gas_duct_solid"); put(TileEntityPylonRedWire.class, "tileentity_pylon_redwire");
map.put(TileEntityMachineRTG.class, "tileentity_machine_rtg"); put(TileEntityStructureMarker.class, "tileentity_structure_marker");
map.put(TileEntityPylonRedWire.class, "tileentity_pylon_redwire"); put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
map.put(TileEntityStructureMarker.class, "tileentity_structure_marker"); put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
map.put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill"); put(TileEntityFluidDuct.class, "tileentity_universal_duct");
map.put(TileEntityMachineAssembler.class, "tileentity_assembly_machine"); put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
map.put(TileEntityFluidDuct.class, "tileentity_universal_duct"); put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
map.put(TileEntityMachineChemplant.class, "tileentity_chemical_plant"); put(TileEntityTurretHeavy.class, "tileentity_turret_heavy");
map.put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank"); put(TileEntityTurretRocket.class, "tileentity_turret_rocket");
map.put(TileEntityTurretHeavy.class, "tileentity_turret_heavy"); put(TileEntityTurretLight.class, "tileentity_turret_light");
map.put(TileEntityTurretRocket.class, "tileentity_turret_rocket"); put(TileEntityTurretFlamer.class, "tileentity_turret_flamer");
map.put(TileEntityTurretLight.class, "tileentity_turret_light"); put(TileEntityTurretTau.class, "tileentity_turret_tau");
map.put(TileEntityTurretFlamer.class, "tileentity_turret_flamer"); put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
map.put(TileEntityTurretTau.class, "tileentity_turret_tau"); put(TileEntityCrateIron.class, "tileentity_crate_iron");
map.put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan"); put(TileEntityCrateSteel.class, "tileentity_crate_steel");
map.put(TileEntityCrateIron.class, "tileentity_crate_iron"); put(TileEntityMachinePress.class, "tileentity_press");
map.put(TileEntityCrateSteel.class, "tileentity_crate_steel"); put(TileEntityAMSBase.class, "tileentity_ams_base");
map.put(TileEntityMachinePress.class, "tileentity_press"); put(TileEntityAMSEmitter.class, "tileentity_ams_emitter");
map.put(TileEntityAMSBase.class, "tileentity_ams_base"); put(TileEntityAMSLimiter.class, "tileentity_ams_limiter");
map.put(TileEntityAMSEmitter.class, "tileentity_ams_emitter"); put(TileEntityMachineSiren.class, "tileentity_siren");
map.put(TileEntityAMSLimiter.class, "tileentity_ams_limiter"); put(TileEntityMachineSPP.class, "tileentity_spp");
map.put(TileEntityMachineSiren.class, "tileentity_siren"); put(TileEntityTurretSpitfire.class, "tileentity_turret_spitfire");
map.put(TileEntityMachineSPP.class, "tileentity_spp"); put(TileEntityMachineRadGen.class, "tileentity_radgen");
map.put(TileEntityTurretSpitfire.class, "tileentity_turret_spitfire"); put(TileEntityMachineTransformer.class, "tileentity_transformer");
map.put(TileEntityMachineRadGen.class, "tileentity_radgen"); put(TileEntityTurretCIWS.class, "tileentity_turret_cwis");
map.put(TileEntityMachineTransformer.class, "tileentity_transformer"); put(TileEntityMachineRadar.class, "tileentity_radar");
map.put(TileEntityTurretCIWS.class, "tileentity_turret_cwis"); put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
map.put(TileEntityMachineRadar.class, "tileentity_radar"); put(TileEntityTurretCheapo.class, "tileentity_turret_cheapo");
map.put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster"); put(TileEntityCelPrime.class, "tileentity_cel_prime");
map.put(TileEntityTurretCheapo.class, "tileentity_turret_cheapo"); put(TileEntityCelPrimeTerminal.class, "tileentity_cel_prime_access");
map.put(TileEntityCelPrime.class, "tileentity_cel_prime"); put(TileEntityCelPrimeBattery.class, "tileentity_cel_prime_energy");
map.put(TileEntityCelPrimeTerminal.class, "tileentity_cel_prime_access"); put(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector");
map.put(TileEntityCelPrimeBattery.class, "tileentity_cel_prime_energy"); put(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
map.put(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector"); put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
map.put(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage"); put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
map.put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine"); put(TileEntityMachineReactorSmall.class, "tileentity_small_reactor");
map.put(TileEntityMachineSatLinker.class, "tileentity_satlinker"); put(TileEntityVaultDoor.class, "tileentity_vault_door");
map.put(TileEntityMachineReactorSmall.class, "tileentity_small_reactor"); put(TileEntityRadiobox.class, "tileentity_radio_broadcaster");
map.put(TileEntityVaultDoor.class, "tileentity_vault_door"); put(TileEntityRadioRec.class, "tileentity_radio_receiver");
map.put(TileEntityRadiobox.class, "tileentity_radio_broadcaster"); put(TileEntityVent.class, "tileentity_vent");
map.put(TileEntityRadioRec.class, "tileentity_radio_receiver"); put(TileEntityLandmine.class, "tileentity_landmine");
map.put(TileEntityVent.class, "tileentity_vent"); put(TileEntityBomber.class, "tileentity_bomber");
map.put(TileEntityLandmine.class, "tileentity_landmine"); put(TileEntityMachineTeleLinker.class, "tileentity_telemetry_linker");
map.put(TileEntityBomber.class, "tileentity_bomber"); put(TileEntityMachineKeyForge.class, "tileentity_key_forge");
map.put(TileEntityMachineTeleLinker.class, "tileentity_telemetry_linker"); put(TileEntitySellafield.class, "tileentity_sellafield_core");
map.put(TileEntityMachineKeyForge.class, "tileentity_key_forge"); put(TileEntityNukeN45.class, "tileentity_n45");
map.put(TileEntitySellafield.class, "tileentity_sellafield_core"); put(TileEntityBlastDoor.class, "tileentity_blast_door");
map.put(TileEntityNukeN45.class, "tileentity_n45"); put(TileEntitySafe.class, "tileentity_safe");
map.put(TileEntityBlastDoor.class, "tileentity_blast_door"); put(TileEntityMachineGasCent.class, "tileentity_gas_centrifuge");
map.put(TileEntitySafe.class, "tileentity_safe"); put(TileEntityMachineBoiler.class, "tileentity_boiler");
map.put(TileEntityMachineGasCent.class, "tileentity_gas_centrifuge"); put(TileEntityMachineBoilerElectric.class, "tileentity_electric_boiler");
map.put(TileEntityMachineBoiler.class, "tileentity_boiler"); put(TileEntityMachineTurbine.class, "tileentity_turbine");
map.put(TileEntityMachineBoilerElectric.class, "tileentity_electric_boiler"); put(TileEntityGeiger.class, "tileentity_geiger");
map.put(TileEntityMachineTurbine.class, "tileentity_turbine"); put(TileEntityFF.class, "tileentity_forcefield");
map.put(TileEntityGeiger.class, "tileentity_geiger"); put(TileEntityForceField.class, "tileentity_machine_field");
map.put(TileEntityFF.class, "tileentity_forcefield"); put(TileEntityMachineShredderLarge.class, "tileentity_machine_big_shredder");
map.put(TileEntityForceField.class, "tileentity_machine_field"); put(TileEntityRFDuct.class, "tileentity_hbm_rfduct");
map.put(TileEntityMachineShredderLarge.class, "tileentity_machine_big_shredder"); put(TileEntityReactorControl.class, "tileentity_reactor_remote_control");
map.put(TileEntityRFDuct.class, "tileentity_hbm_rfduct"); put(TileEntityMachineReactorLarge.class, "tileentity_large_reactor");
map.put(TileEntityReactorControl.class, "tileentity_reactor_remote_control"); put(TileEntityWasteDrum.class, "tileentity_waste_drum");
map.put(TileEntityMachineReactorLarge.class, "tileentity_large_reactor"); put(TileEntityDecon.class, "tileentity_decon");
map.put(TileEntityWasteDrum.class, "tileentity_waste_drum"); put(TileEntityMachineSatDock.class, "tileentity_miner_dock");
map.put(TileEntityDecon.class, "tileentity_decon"); put(TileEntityMachineEPress.class, "tileentity_electric_press");
map.put(TileEntityMachineSatDock.class, "tileentity_miner_dock"); put(TileEntityCoreEmitter.class, "tileentity_v0_emitter");
map.put(TileEntityMachineEPress.class, "tileentity_electric_press"); put(TileEntityCoreReceiver.class, "tileentity_v0_receiver");
map.put(TileEntityCoreEmitter.class, "tileentity_v0_emitter"); put(TileEntityCoreInjector.class, "tileentity_v0_injector");
map.put(TileEntityCoreReceiver.class, "tileentity_v0_receiver"); put(TileEntityCoreStabilizer.class, "tileentity_v0_stabilizer");
map.put(TileEntityCoreInjector.class, "tileentity_v0_injector"); put(TileEntityCore.class, "tileentity_v0");
map.put(TileEntityCoreStabilizer.class, "tileentity_v0_stabilizer"); put(TileEntityMachineArcFurnace.class, "tileentity_arc_furnace");
map.put(TileEntityCore.class, "tileentity_v0"); put(TileEntityMachineAmgen.class, "tileentity_amgen");
map.put(TileEntityMachineArcFurnace.class, "tileentity_arc_furnace"); put(TileEntityGeysir.class, "tileentity_geysir");
map.put(TileEntityMachineAmgen.class, "tileentity_amgen"); put(TileEntityMachineMissileAssembly.class, "tileentity_missile_assembly");
map.put(TileEntityGeysir.class, "tileentity_geysir"); put(TileEntityLaunchTable.class, "tileentity_large_launch_table");
map.put(TileEntityMachineMissileAssembly.class, "tileentity_missile_assembly"); put(TileEntityCompactLauncher.class, "tileentity_small_launcher");
map.put(TileEntityLaunchTable.class, "tileentity_large_launch_table"); put(TileEntityMultiblock.class, "tileentity_multi_core");
map.put(TileEntityCompactLauncher.class, "tileentity_small_launcher"); put(TileEntityChlorineSeal.class, "tileentity_chlorine_seal");
map.put(TileEntityMultiblock.class, "tileentity_multi_core"); put(TileEntitySoyuzLauncher.class, "tileentity_soyuz_launcher");
map.put(TileEntityChlorineSeal.class, "tileentity_chlorine_seal"); put(TileEntityTesla.class, "tileentity_tesla_coil");
map.put(TileEntityCableSwitch.class, "tileentity_he_switch"); put(TileEntityBarrel.class, "tileentity_fluid_barrel");
map.put(TileEntitySoyuzLauncher.class, "tileentity_soyuz_launcher"); put(TileEntityCyberCrab.class, "tileentity_crabs");
map.put(TileEntityTesla.class, "tileentity_tesla_coil"); put(TileEntitySoyuzCapsule.class, "tileentity_soyuz_capsule");
map.put(TileEntityBarrel.class, "tileentity_fluid_barrel"); put(TileEntityMachineCrystallizer.class, "tileentity_acidomatic");
map.put(TileEntityCyberCrab.class, "tileentity_crabs"); put(TileEntitySoyuzStruct.class, "tileentity_soyuz_struct");
map.put(TileEntitySoyuzCapsule.class, "tileentity_soyuz_capsule"); put(TileEntityITERStruct.class, "tileentity_iter_struct");
map.put(TileEntityMachineCrystallizer.class, "tileentity_acidomatic"); put(TileEntityMachineMiningLaser.class, "tileentity_mining_laser");
map.put(TileEntitySoyuzStruct.class, "tileentity_soyuz_struct"); put(TileEntityProxyInventory.class, "tileentity_proxy_inventory");
map.put(TileEntityITERStruct.class, "tileentity_iter_struct"); put(TileEntityProxyEnergy.class, "tileentity_proxy_power");
map.put(TileEntityMachineMiningLaser.class, "tileentity_mining_laser"); put(TileEntityNukeBalefire.class, "tileentity_nuke_fstbmb");
map.put(TileEntityProxyInventory.class, "tileentity_proxy_inventory"); put(TileEntityProxyCombo.class, "tileentity_proxy_combo");
map.put(TileEntityProxyEnergy.class, "tileentity_proxy_power"); put(TileEntityMicrowave.class, "tileentity_microwave");
map.put(TileEntityNukeBalefire.class, "tileentity_nuke_fstbmb"); put(TileEntityMachineMiniRTG.class, "tileentity_mini_rtg");
map.put(TileEntityProxyCombo.class, "tileentity_proxy_combo"); put(TileEntityITER.class, "tileentity_iter");
map.put(TileEntityMicrowave.class, "tileentity_microwave"); put(TileEntityMachinePlasmaHeater.class, "tileentity_plasma_heater");
map.put(TileEntityMachineMiniRTG.class, "tileentity_mini_rtg"); put(TileEntityMachineFENSU.class, "tileentity_fensu");
map.put(TileEntityITER.class, "tileentity_iter"); put(TileEntityTrappedBrick.class, "tileentity_trapped_brick");
map.put(TileEntityMachinePlasmaHeater.class, "tileentity_plasma_heater"); put(TileEntityPlasmaStruct.class, "tileentity_plasma_struct");
map.put(TileEntityMachineFENSU.class, "tileentity_fensu"); put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
map.put(TileEntityTrappedBrick.class, "tileentity_trapped_brick"); put(TileEntityHadronDiode.class, "tileentity_hadron_diode");
map.put(TileEntityPlasmaStruct.class, "tileentity_plasma_struct"); put(TileEntityHadronPower.class, "tileentity_hadron_power");
map.put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine"); put(TileEntityHadron.class, "tileentity_hadron");
map.put(TileEntityHadronDiode.class, "tileentity_hadron_diode"); put(TileEntitySolarBoiler.class, "tileentity_solarboiler");
map.put(TileEntityHadronPower.class, "tileentity_hadron_power"); put(TileEntitySolarMirror.class, "tileentity_solarmirror");
map.put(TileEntityHadron.class, "tileentity_hadron"); put(TileEntityMachineDetector.class, "tileentity_he_detector");
map.put(TileEntitySolarBoiler.class, "tileentity_solarboiler"); put(TileEntityFireworks.class, "tileentity_firework_box");
map.put(TileEntitySolarMirror.class, "tileentity_solarmirror"); put(TileEntityCrateTungsten.class, "tileentity_crate_hot");
map.put(TileEntityMachineDetector.class, "tileentity_he_detector"); put(TileEntitySILEX.class, "tileentity_silex");
map.put(TileEntityFireworks.class, "tileentity_firework_box"); put(TileEntityFEL.class, "tileentity_fel");
map.put(TileEntityCrateTungsten.class, "tileentity_crate_hot"); put(TileEntityDemonLamp.class, "tileentity_demonlamp");
map.put(TileEntitySILEX.class, "tileentity_silex"); put(TileEntityStorageDrum.class, "tileentity_waste_storage_drum");
map.put(TileEntityFEL.class, "tileentity_fel"); put(TileEntityDeaerator.class, "tileentity_deaerator");
map.put(TileEntityDemonLamp.class, "tileentity_demonlamp"); put(TileEntityChungus.class, "tileentity_chungus");
map.put(TileEntityStorageDrum.class, "tileentity_waste_storage_drum"); put(TileEntityCableBaseNT.class, "tileentity_ohgod");
map.put(TileEntityDeaerator.class, "tileentity_deaerator"); put(TileEntityWatz.class, "tileentity_watz");
map.put(TileEntityChungus.class, "tileentity_chungus"); put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
map.put(TileEntityCableBaseNT.class, "tileentity_ohgod"); put(TileEntityMachineOrbus.class, "tileentity_orbus");
map.put(TileEntityWatz.class, "tileentity_watz");
map.put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
map.put(TileEntityMachineOrbus.class, "tileentity_orbus");
map.put(TileEntityLoot.class, "tileentity_ntm_loot"); put(TileEntityLoot.class, "tileentity_ntm_loot");
map.put(TileEntityBobble.class, "tileentity_ntm_bobblehead"); put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
put(TileEntityCableBaseNT.class, "tileentity_cable", "tileentity_wirecoated");
putBombs(); putBombs();
putTurrets(); putTurrets();
@ -203,75 +202,79 @@ public class TileMappings {
} }
private static void putBombs() { private static void putBombs() {
map.put(TileEntityBombMulti.class, "tileentity_bombmulti"); put(TileEntityBombMulti.class, "tileentity_bombmulti");
map.put(TileEntityNukeGadget.class, "tilentity_nukegadget"); put(TileEntityNukeGadget.class, "tilentity_nukegadget");
map.put(TileEntityNukeBoy.class, "tilentity_nukeboy"); put(TileEntityNukeBoy.class, "tilentity_nukeboy");
map.put(TileEntityNukeMike.class, "tileentity_nukemike"); put(TileEntityNukeMike.class, "tileentity_nukemike");
map.put(TileEntityNukeTsar.class, "tileentity_nuketsar"); put(TileEntityNukeTsar.class, "tileentity_nuketsar");
map.put(TileEntityNukeFleija.class, "tileentity_nukefleija"); put(TileEntityNukeFleija.class, "tileentity_nukefleija");
map.put(TileEntityNukePrototype.class, "tileentity_nukeproto"); put(TileEntityNukePrototype.class, "tileentity_nukeproto");
map.put(TileEntityNukeSolinium.class, "tileentity_nuke_solinium"); put(TileEntityNukeSolinium.class, "tileentity_nuke_solinium");
map.put(TileEntityNukeN2.class, "tileentity_nuke_n2"); put(TileEntityNukeN2.class, "tileentity_nuke_n2");
map.put(TileEntityNukeCustom.class, "tileentity_nuke_custom"); put(TileEntityNukeCustom.class, "tileentity_nuke_custom");
} }
private static void putTurrets() { private static void putTurrets() {
map.put(TileEntityTurretChekhov.class, "tileentity_turret_chekhov"); put(TileEntityTurretChekhov.class, "tileentity_turret_chekhov");
map.put(TileEntityTurretJeremy.class, "tileentity_turret_jeremy"); put(TileEntityTurretJeremy.class, "tileentity_turret_jeremy");
map.put(TileEntityTurretTauon.class, "tileentity_turret_tauon"); put(TileEntityTurretTauon.class, "tileentity_turret_tauon");
map.put(TileEntityTurretFriendly.class, "tileentity_turret_friendly"); put(TileEntityTurretFriendly.class, "tileentity_turret_friendly");
map.put(TileEntityTurretRichard.class, "tileentity_turret_richard"); put(TileEntityTurretRichard.class, "tileentity_turret_richard");
map.put(TileEntityTurretHoward.class, "tileentity_turret_howard"); put(TileEntityTurretHoward.class, "tileentity_turret_howard");
map.put(TileEntityTurretHowardDamaged.class, "tileentity_turret_howard_damaged"); put(TileEntityTurretHowardDamaged.class, "tileentity_turret_howard_damaged");
map.put(TileEntityTurretMaxwell.class, "tileentity_turret_maxwell"); put(TileEntityTurretMaxwell.class, "tileentity_turret_maxwell");
map.put(TileEntityTurretFritz.class, "tileentity_turret_fritz"); put(TileEntityTurretFritz.class, "tileentity_turret_fritz");
map.put(TileEntityTurretBrandon.class, "tileentity_turret_brandon"); put(TileEntityTurretBrandon.class, "tileentity_turret_brandon");
} }
private static void putMachines() { private static void putMachines() {
map.put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace"); put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace");
map.put(TileEntityUVLamp.class, "tileentity_uv_lamp"); put(TileEntityUVLamp.class, "tileentity_uv_lamp");
map.put(TileEntityCondenser.class, "tileentity_condenser"); put(TileEntityCondenser.class, "tileentity_condenser");
map.put(TileEntityTowerSmall.class, "tileentity_cooling_tower_small"); put(TileEntityTowerSmall.class, "tileentity_cooling_tower_small");
map.put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large"); put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large");
map.put(TileEntityDeuteriumExtractor.class, "tileentity_deuterium_extractor"); put(TileEntityDeuteriumExtractor.class, "tileentity_deuterium_extractor");
map.put(TileEntityDeuteriumTower.class, "tileentity_deuterium_tower"); put(TileEntityDeuteriumTower.class, "tileentity_deuterium_tower");
map.put(TileEntityMachineOilWell.class, "tileentity_derrick"); put(TileEntityMachineOilWell.class, "tileentity_derrick");
map.put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack"); put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
map.put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower"); put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");
map.put(TileEntityMachineGasFlare.class, "tileentity_gasflare"); put(TileEntityMachineGasFlare.class, "tileentity_gasflare");
map.put(TileEntityMachineRefinery.class, "tileentity_refinery"); put(TileEntityMachineRefinery.class, "tileentity_refinery");
map.put(TileEntityMachineFractionTower.class, "tileentity_fraction_tower"); put(TileEntityMachineFractionTower.class, "tileentity_fraction_tower");
map.put(TileEntitySpacer.class, "tileentity_fraction_spacer"); put(TileEntitySpacer.class, "tileentity_fraction_spacer");
map.put(TileEntityMachineCatalyticCracker.class, "tileentity_catalytic_cracker"); put(TileEntityMachineCatalyticCracker.class, "tileentity_catalytic_cracker");
map.put(TileEntityReactorZirnox.class, "tileentity_zirnox"); put(TileEntityReactorZirnox.class, "tileentity_zirnox");
map.put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed"); put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
} }
private static void putPile() { private static void putPile() {
map.put(TileEntityPileFuel.class, "tileentity_pile_fuel"); put(TileEntityPileFuel.class, "tileentity_pile_fuel");
map.put(TileEntityPileSource.class, "tileentity_pile_source"); put(TileEntityPileSource.class, "tileentity_pile_source");
} }
private static void putRBMK() { private static void putRBMK() {
map.put(TileEntityRBMKRod.class, "tileentity_rbmk_rod"); put(TileEntityRBMKRod.class, "tileentity_rbmk_rod");
map.put(TileEntityRBMKRodReaSim.class, "tileentity_rbmk_rod_reasim"); put(TileEntityRBMKRodReaSim.class, "tileentity_rbmk_rod_reasim");
map.put(TileEntityRBMKControlManual.class, "tileentity_rbmk_control"); put(TileEntityRBMKControlManual.class, "tileentity_rbmk_control");
map.put(TileEntityRBMKControlAuto.class, "tileentity_rbmk_control_auto"); put(TileEntityRBMKControlAuto.class, "tileentity_rbmk_control_auto");
map.put(TileEntityRBMKBlank.class, "tileentity_rbmk_blank"); put(TileEntityRBMKBlank.class, "tileentity_rbmk_blank");
map.put(TileEntityRBMKBoiler.class, "tileentity_rbmk_boiler"); put(TileEntityRBMKBoiler.class, "tileentity_rbmk_boiler");
map.put(TileEntityRBMKReflector.class, "tileentity_rbmk_reflector"); put(TileEntityRBMKReflector.class, "tileentity_rbmk_reflector");
map.put(TileEntityRBMKAbsorber.class, "tileentity_rbmk_absorber"); put(TileEntityRBMKAbsorber.class, "tileentity_rbmk_absorber");
map.put(TileEntityRBMKModerator.class, "tileentity_rbmk_moderator"); put(TileEntityRBMKModerator.class, "tileentity_rbmk_moderator");
map.put(TileEntityRBMKOutgasser.class, "tileentity_rbmk_outgasser"); put(TileEntityRBMKOutgasser.class, "tileentity_rbmk_outgasser");
map.put(TileEntityRBMKCooler.class, "tileentity_rbmk_cooler"); put(TileEntityRBMKCooler.class, "tileentity_rbmk_cooler");
map.put(TileEntityRBMKStorage.class, "tileentity_rbmk_storage"); put(TileEntityRBMKStorage.class, "tileentity_rbmk_storage");
map.put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console"); put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console");
map.put(TileEntityRBMKConsole.class, "tileentity_rbmk_console"); put(TileEntityRBMKConsole.class, "tileentity_rbmk_console");
map.put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet"); put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
map.put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet"); put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet");
}
private static void put(Class<? extends TileEntity> clazz, String... names) {
map.put(clazz, names);
} }
} }

View File

@ -1,11 +1,11 @@
package com.hbm.tileentity.bomb; package com.hbm.tileentity.bomb;
import com.hbm.interfaces.IConsumer;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEMissilePacket; import com.hbm.packet.TEMissilePacket;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -16,8 +16,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityLaunchPad extends TileEntity implements ISidedInventory, IConsumer { public class TileEntityLaunchPad extends TileEntity implements ISidedInventory, IEnergyUser {
public ItemStack slots[]; public ItemStack slots[];
@ -187,16 +188,25 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory,
@Override @Override
public void updateEntity() { public void updateEntity() {
power = Library.chargeTEFromItems(slots, 2, power, maxPower);
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
power = Library.chargeTEFromItems(slots, 2, power, maxPower);
this.updateConnections();
PacketDispatcher.wrapper.sendToAllAround(new TEMissilePacket(xCoord, yCoord, zCoord, slots[0]), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250)); PacketDispatcher.wrapper.sendToAllAround(new TEMissilePacket(xCoord, yCoord, zCoord, slots[0]), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
} }
} }
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord);
}
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;
@ -219,11 +229,30 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory,
return maxPower; return maxPower;
} }
@Override
public long transferPower(long power) {
this.power += power;
if(this.power > this.getMaxPower()) {
long overshoot = this.power - this.getMaxPower();
this.power = this.getMaxPower();
return overshoot;
}
return 0;
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UP && dir != ForgeDirection.UNKNOWN;
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() public double getMaxRenderDistanceSquared()
{ {
return 65536.0D; return 65536.0D;
} }
} }

View File

@ -6,7 +6,6 @@ import java.util.List;
import com.hbm.entity.missile.EntityMissileCustom; import com.hbm.entity.missile.EntityMissileCustom;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.handler.MissileStruct; import com.hbm.handler.MissileStruct;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer; import com.hbm.interfaces.IFluidContainer;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
@ -22,6 +21,7 @@ import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEMissileMultipartPacket; import com.hbm.packet.TEMissileMultipartPacket;
import api.hbm.energy.IEnergyUser;
import api.hbm.item.IDesignatorItem; import api.hbm.item.IDesignatorItem;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -33,8 +33,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityLaunchTable extends TileEntity implements ISidedInventory, IConsumer, IFluidContainer, IFluidAcceptor { public class TileEntityLaunchTable extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
private ItemStack slots[]; private ItemStack slots[];
@ -165,6 +166,9 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
if (!worldObj.isRemote) { if (!worldObj.isRemote) {
updateTypes(); updateTypes();
if(worldObj.getTotalWorldTime() % 20 == 0)
this.updateConnections();
tanks[0].loadTank(2, 6, slots); tanks[0].loadTank(2, 6, slots);
tanks[1].loadTank(3, 7, slots); tanks[1].loadTank(3, 7, slots);
@ -218,6 +222,16 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
} }
} }
private void updateConnections() {
for(int i = -4; i <= 4; i++) {
this.trySubscribe(worldObj, xCoord + i, yCoord, zCoord + 5);
this.trySubscribe(worldObj, xCoord + i, yCoord, zCoord - 5);
this.trySubscribe(worldObj, xCoord + 5, yCoord, zCoord + i);
this.trySubscribe(worldObj, xCoord - 5, yCoord, zCoord + i);
}
}
public boolean canLaunch() { public boolean canLaunch() {
if(power >= maxPower * 0.75 && isMissileValid() && hasDesignator() && hasFuel()) if(power >= maxPower * 0.75 && isMissileValid() && hasDesignator() && hasFuel())
@ -541,4 +555,24 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
public long getMaxPower() { public long getMaxPower() {
return this.maxPower; return this.maxPower;
} }
@Override
public long transferPower(long power) {
this.power += power;
if(this.power > this.getMaxPower()) {
long overshoot = this.power - this.getMaxPower();
this.power = this.getMaxPower();
return overshoot;
}
return 0;
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UP && dir != ForgeDirection.DOWN && dir != ForgeDirection.UNKNOWN;
}
} }

View File

@ -1,57 +0,0 @@
package com.hbm.tileentity.conductor;
import java.util.ArrayList;
import java.util.List;
import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
import com.hbm.interfaces.IConductor;
import com.hbm.lib.Library;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCable extends TileEntity implements IConductor {
public ForgeDirection[] connections = new ForgeDirection[6];
public List<UnionOfTileEntitiesAndBooleans> uoteab = new ArrayList<UnionOfTileEntitiesAndBooleans>();
public TileEntityCable() {
}
@Override
public void updateEntity() {
this.updateConnections();
}
public void updateConnections() {
if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord + 1, zCoord)) connections[0] = ForgeDirection.UP;
else connections[0] = null;
if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord - 1, zCoord)) connections[1] = ForgeDirection.DOWN;
else connections[1] = null;
if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord, zCoord - 1)) connections[2] = ForgeDirection.NORTH;
else connections[2] = null;
if(Library.checkCableConnectables(this.worldObj, xCoord + 1, yCoord, zCoord)) connections[3] = ForgeDirection.EAST;
else connections[3] = null;
if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord, zCoord + 1)) connections[4] = ForgeDirection.SOUTH;
else connections[4] = null;
if(Library.checkCableConnectables(this.worldObj, xCoord - 1, yCoord, zCoord)) connections[5] = ForgeDirection.WEST;
else connections[5] = null;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.conductor;
public class TileEntityCableSwitch extends TileEntityWireCoated {
}

View File

@ -4,8 +4,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
import com.hbm.interfaces.IConductor;
import com.hbm.interfaces.Spaghetti; import com.hbm.interfaces.Spaghetti;
import com.hbm.interfaces.Untested; import com.hbm.interfaces.Untested;
import com.hbm.packet.NBTPacket; import com.hbm.packet.NBTPacket;
@ -13,6 +11,7 @@ import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEPylonDestructorPacket; import com.hbm.packet.TEPylonDestructorPacket;
import com.hbm.packet.TEPylonSenderPacket; import com.hbm.packet.TEPylonSenderPacket;
import com.hbm.tileentity.INBTPacketReceiver; import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.network.TileEntityCableBaseNT;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -22,9 +21,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TileEntityPylonRedWire extends TileEntity implements IConductor, INBTPacketReceiver { public class TileEntityPylonRedWire extends TileEntityCableBaseNT implements INBTPacketReceiver {
public List<UnionOfTileEntitiesAndBooleans> uoteab = new ArrayList<UnionOfTileEntitiesAndBooleans>();
public List<int[]> connected = new ArrayList<int[]>(); public List<int[]> connected = new ArrayList<int[]>();
public boolean scheduleConnectionCheck = false; public boolean scheduleConnectionCheck = false;
public int[][] scheduleBuffer; public int[][] scheduleBuffer;

View File

@ -1,14 +0,0 @@
package com.hbm.tileentity.conductor;
import java.util.ArrayList;
import java.util.List;
import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
import com.hbm.interfaces.IConductor;
import net.minecraft.tileentity.TileEntity;
public class TileEntityWireCoated extends TileEntity implements IConductor {
public List<UnionOfTileEntitiesAndBooleans> uoteab = new ArrayList<UnionOfTileEntitiesAndBooleans>();
}

View File

@ -5,10 +5,8 @@ import java.util.List;
import java.util.Random; import java.util.Random;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer; import com.hbm.interfaces.IFluidContainer;
import com.hbm.interfaces.ISource;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemCatalyst; import com.hbm.items.machine.ItemCatalyst;
@ -32,7 +30,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
public class TileEntityAMSBase extends TileEntity implements ISidedInventory, ISource, IFluidContainer, IFluidAcceptor { public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor {
private ItemStack slots[]; private ItemStack slots[];
@ -49,7 +47,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
public int mode = 0; public int mode = 0;
public boolean locked = false; public boolean locked = false;
public FluidTank[] tanks; public FluidTank[] tanks;
public List<IConsumer> list = new ArrayList();
public int color = -1; public int color = -1;
Random rand = new Random(); Random rand = new Random();
@ -247,9 +244,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
{ {
age = 0; age = 0;
} }
if(age == 9 || age == 19)
ffgeuaInit();
tanks[0].setType(0, 1, slots); tanks[0].setType(0, 1, slots);
tanks[1].setType(2, 3, slots); tanks[1].setType(2, 3, slots);
@ -535,51 +529,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
if(index < 4 && tanks[index] != null) if(index < 4 && tanks[index] != null)
tanks[index].setTankType(type); tanks[index].setTankType(type);
} }
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
public void ffgeuaInit() {
ffgeua(this.xCoord - 2, this.yCoord, this.zCoord, getTact());
ffgeua(this.xCoord + 2, this.yCoord, this.zCoord, getTact());
ffgeua(this.xCoord, this.yCoord, this.zCoord - 2, getTact());
ffgeua(this.xCoord, this.yCoord, this.zCoord + 2, getTact());
ffgeua(this.xCoord, this.yCoord - 1, this.zCoord, getTact());
}
@Override
public boolean getTact() {
if(age >= 0 && age < 10)
{
return true;
}
return false;
}
@Override
public long getSPower() {
return power;
}
@Override
public void setSPower(long i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {

View File

@ -6,7 +6,6 @@ import java.util.Random;
import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionLarge;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer; import com.hbm.interfaces.IFluidContainer;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
@ -27,7 +26,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory, IConsumer, IFluidContainer, IFluidAcceptor { public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor {
private ItemStack slots[]; private ItemStack slots[];
@ -364,23 +363,6 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
return (heat * i) / maxHeat; return (heat * i) / maxHeat;
} }
@Override
public void setPower(long i) {
power = i;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
@Override @Override
public void setFluidFill(int i, FluidType type) { public void setFluidFill(int i, FluidType type) {
if(type.name().equals(tank.getTankType().name())) if(type.name().equals(tank.getTankType().name()))

View File

@ -7,7 +7,6 @@ import java.util.Random;
import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.entity.particle.EntityGasFlameFX;
import com.hbm.explosion.ExplosionLarge; import com.hbm.explosion.ExplosionLarge;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer; import com.hbm.interfaces.IFluidContainer;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
@ -28,7 +27,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory, IConsumer, IFluidContainer, IFluidAcceptor { public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor {
private ItemStack slots[]; private ItemStack slots[];
@ -378,23 +377,6 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
return (heat * i) / maxHeat; return (heat * i) / maxHeat;
} }
@Override
public void setPower(long i) {
power = i;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
@Override @Override
public void setFluidFill(int i, FluidType type) { public void setFluidFill(int i, FluidType type) {
if(type.name().equals(tank.getTankType().name())) if(type.name().equals(tank.getTankType().name()))

View File

@ -6,10 +6,8 @@ import java.util.Random;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource; import com.hbm.interfaces.IFluidSource;
import com.hbm.interfaces.ISource;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.inventory.recipes.MachineRecipes; import com.hbm.inventory.recipes.MachineRecipes;
import com.hbm.lib.Library; import com.hbm.lib.Library;
@ -17,6 +15,7 @@ import com.hbm.packet.NBTPacket;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.INBTPacketReceiver; import com.hbm.tileentity.INBTPacketReceiver;
import api.hbm.energy.IEnergyGenerator;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -25,7 +24,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFluidSource, ISource, INBTPacketReceiver { public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFluidSource, IEnergyGenerator, INBTPacketReceiver {
public long power; public long power;
public static final long maxPower = 100000000000L; public static final long maxPower = 100000000000L;
@ -33,7 +32,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
public float rotor; public float rotor;
public float lastRotor; public float lastRotor;
public List<IConsumer> list1 = new ArrayList();
public List<IFluidAcceptor> list2 = new ArrayList(); public List<IFluidAcceptor> list2 = new ArrayList();
public FluidTank[] tanks; public FluidTank[] tanks;
@ -65,6 +63,9 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
power += (Integer)outs[3] * cycles; power += (Integer)outs[3] * cycles;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
this.sendPower(worldObj, xCoord + dir.offsetX * 11, yCoord, zCoord + dir.offsetZ * 11, dir);
if(power > maxPower) if(power > maxPower)
power = maxPower; power = maxPower;
@ -74,7 +75,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
turnTimer = 25; turnTimer = 25;
this.fillFluidInit(tanks[1].getTankType()); this.fillFluidInit(tanks[1].getTankType());
this.ffgeuaInit();
NBTTagCompound data = new NBTTagCompound(); NBTTagCompound data = new NBTTagCompound();
data.setLong("power", power); data.setLong("power", power);
@ -137,17 +137,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
nbt.setLong("power", power); nbt.setLong("power", power);
} }
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
public void ffgeuaInit() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ffgeua(xCoord - dir.offsetX * 11, yCoord, zCoord - dir.offsetZ * 11, getTact());
}
@Override @Override
public void fillFluidInit(FluidType type) { public void fillFluidInit(FluidType type) {
@ -224,26 +213,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
public void clearFluidList(FluidType type) { public void clearFluidList(FluidType type) {
list2.clear(); list2.clear();
} }
@Override
public long getSPower() {
return power;
}
@Override
public void setSPower(long i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list1;
}
@Override
public void clearList() {
this.list1.clear();
}
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
@ -255,4 +224,24 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
public double getMaxRenderDistanceSquared() { public double getMaxRenderDistanceSquared() {
return 65536.0D; return 65536.0D;
} }
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UP && dir != ForgeDirection.DOWN && dir != ForgeDirection.UNKNOWN;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
@Override
public void setPower(long power) {
this.power = power;
}
} }

View File

@ -4,13 +4,13 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.lib.ModDamageSource; import com.hbm.lib.ModDamageSource;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.block.ILaserable; import api.hbm.block.ILaserable;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -23,7 +23,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IConsumer, IFluidAcceptor, ILaserable { public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, ILaserable {
public long power; public long power;
public static final long maxPower = 1000000000L; public static final long maxPower = 1000000000L;
@ -51,6 +51,8 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
if (!worldObj.isRemote) { if (!worldObj.isRemote) {
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
watts = MathHelper.clamp_int(watts, 1, 100); watts = MathHelper.clamp_int(watts, 1, 100);
long demand = maxPower * watts / 2000; long demand = maxPower * watts / 2000;
@ -238,6 +240,11 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
return this.maxPower; return this.maxPower;
} }
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UNKNOWN;
}
@Override @Override
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) { public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
@ -281,5 +288,4 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
nbt.setBoolean("isOn", isOn); nbt.setBoolean("isOn", isOn);
tank.writeToNBT(nbt, "tank"); tank.writeToNBT(nbt, "tank");
} }
} }

View File

@ -4,14 +4,13 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.ISource;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.block.ILaserable; import api.hbm.block.ILaserable;
import api.hbm.energy.IEnergyGenerator;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -21,13 +20,11 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISource, IFluidAcceptor, ILaserable { public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, ILaserable {
public long power; public long power;
public long joules; public long joules;
public FluidTank tank; public FluidTank tank;
public List<IConsumer> list = new ArrayList();
public int age = 0;
public TileEntityCoreReceiver() { public TileEntityCoreReceiver() {
super(0); super(0);
@ -46,7 +43,10 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISo
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
power += joules * 5000; power = joules * 5000;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
if(joules > 0) { if(joules > 0) {
@ -63,71 +63,31 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISo
this.networkPack(data, 50); this.networkPack(data, 50);
joules = 0; joules = 0;
age++;
if(age >= 20)
{
age = 0;
}
if(age == 9 || age == 19) {
ffgeuaInit();
if(!getTact())
power = 0;
}
} }
} }
public void networkUnpack(NBTTagCompound data) { public void networkUnpack(NBTTagCompound data) {
joules = data.getLong("joules"); joules = data.getLong("joules");
} }
@Override @Override
public void ffgeua(int x, int y, int z, boolean newTact) { public long getPower() {
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
public void ffgeuaInit() {
ffgeua(this.xCoord, this.yCoord + 1, this.zCoord, getTact());
ffgeua(this.xCoord, this.yCoord - 1, this.zCoord, getTact());
ffgeua(this.xCoord - 1, this.yCoord, this.zCoord, getTact());
ffgeua(this.xCoord + 1, this.yCoord, this.zCoord, getTact());
ffgeua(this.xCoord, this.yCoord, this.zCoord - 1, getTact());
ffgeua(this.xCoord, this.yCoord, this.zCoord + 1, getTact());
}
@Override
public boolean getTact() {
if(age >= 0 && age < 10)
{
return true;
}
return false;
}
@Override
public long getSPower() {
return power; return power;
} }
@Override @Override
public void setSPower(long i) { public void setPower(long i) {
this.power = i; this.power = i;
} }
@Override @Override
public List<IConsumer> getList() { public boolean canConnect(ForgeDirection dir) {
return list; return dir != ForgeDirection.UNKNOWN;
} }
@Override @Override
public void clearList() { public long getMaxPower() {
this.list.clear(); return 0;
} }
@Override @Override

View File

@ -1,10 +1,10 @@
package com.hbm.tileentity.machine; package com.hbm.tileentity.machine;
import com.hbm.interfaces.IConsumer;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemLens; import com.hbm.items.machine.ItemLens;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -14,7 +14,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IConsumer { public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyUser {
public long power; public long power;
public static final long maxPower = 2500000000L; public static final long maxPower = 2500000000L;
@ -37,6 +37,8 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
this.updateConnections();
watts = MathHelper.clamp_int(watts, 1, 100); watts = MathHelper.clamp_int(watts, 1, 100);
int demand = (int) Math.pow(watts, 4); int demand = (int) Math.pow(watts, 4);
@ -84,6 +86,12 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
} }
} }
private void updateConnections() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
}
public void networkUnpack(NBTTagCompound data) { public void networkUnpack(NBTTagCompound data) {
power = data.getLong("power"); power = data.getLong("power");
@ -113,6 +121,11 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
public long getMaxPower() { public long getMaxPower() {
return this.maxPower; return this.maxPower;
} }
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UNKNOWN;
}
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
@ -121,8 +134,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() public double getMaxRenderDistanceSquared() {
{
return 65536.0D; return 65536.0D;
} }

View File

@ -3,13 +3,13 @@ package com.hbm.tileentity.machine;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.hbm.interfaces.IConsumer;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEFFPacket; import com.hbm.packet.TEFFPacket;
import api.hbm.energy.IBatteryItem; import api.hbm.energy.IBatteryItem;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -22,8 +22,9 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityForceField extends TileEntity implements ISidedInventory, IConsumer { public class TileEntityForceField extends TileEntity implements ISidedInventory, IEnergyUser {
private ItemStack slots[]; private ItemStack slots[];
@ -232,6 +233,8 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
updateConnections();
int rStack = 0; int rStack = 0;
int hStack = 0; int hStack = 0;
radius = 16; radius = 16;
@ -434,7 +437,6 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
@Override @Override
public void setPower(long i) { public void setPower(long i) {
power = i; power = i;
} }
@Override @Override
@ -448,6 +450,19 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
return maxPower; return maxPower;
} }
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UP && dir != ForgeDirection.UNKNOWN;
}
private void updateConnections() {
this.trySubscribe(worldObj, xCoord + 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord - 1, yCoord, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 1);
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 1);
this.trySubscribe(worldObj, xCoord, yCoord - 1, zCoord);
}
@Override @Override
public AxisAlignedBB getRenderBoundingBox() { public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB; return TileEntity.INFINITE_EXTENT_AABB;

View File

@ -8,7 +8,6 @@ import java.util.List;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.BlockHadronCoil; import com.hbm.blocks.machine.BlockHadronCoil;
import com.hbm.blocks.machine.BlockHadronPlating; import com.hbm.blocks.machine.BlockHadronPlating;
import com.hbm.interfaces.IConsumer;
import com.hbm.inventory.recipes.HadronRecipes; import com.hbm.inventory.recipes.HadronRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.lib.Library; import com.hbm.lib.Library;
@ -18,6 +17,7 @@ import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.tileentity.machine.TileEntityHadronDiode.DiodeConfig; import com.hbm.tileentity.machine.TileEntityHadronDiode.DiodeConfig;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -28,7 +28,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityHadron extends TileEntityMachineBase implements IConsumer { public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUser {
public long power; public long power;
public static final long maxPower = 10000000; public static final long maxPower = 10000000;
@ -256,6 +256,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
return maxPower; return maxPower;
} }
@Override
public boolean canConnect(ForgeDirection dir) {
return false;
}
public class Particle { public class Particle {
//Starting values //Starting values

View File

@ -1,18 +1,28 @@
package com.hbm.tileentity.machine; package com.hbm.tileentity.machine;
import com.hbm.blocks.machine.BlockHadronPower; import com.hbm.blocks.machine.BlockHadronPower;
import com.hbm.interfaces.IConsumer;
import api.hbm.energy.IEnergyUser;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityHadronPower extends TileEntity implements IConsumer { public class TileEntityHadronPower extends TileEntity implements IEnergyUser {
public long power; public long power;
@Override
public boolean canUpdate() { public boolean canUpdate() {
return false; return this.worldObj.getTotalWorldTime() % 20 == 0;
}
@Override
public void updateEntity() {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
}
} }
@Override @Override

View File

@ -6,7 +6,6 @@ import java.util.List;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineITER; import com.hbm.blocks.machine.MachineITER;
import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource; import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidTank; import com.hbm.inventory.FluidTank;
@ -19,6 +18,7 @@ import com.hbm.lib.Library;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -27,7 +27,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
public class TileEntityITER extends TileEntityMachineBase implements IConsumer, IFluidAcceptor, IFluidSource { public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidSource {
public long power; public long power;
public static final long maxPower = 10000000; public static final long maxPower = 10000000;
@ -160,6 +160,9 @@ public class TileEntityITER extends TileEntityMachineBase implements IConsumer,
this.networkPack(data, 250); this.networkPack(data, 250);
/// END Notif packets /// /// END Notif packets ///
this.trySubscribe(worldObj, xCoord, yCoord + 3, zCoord);
this.trySubscribe(worldObj, xCoord, yCoord - 3, zCoord);
} else { } else {

View File

@ -5,21 +5,19 @@ import java.util.List;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.handler.radiation.ChunkRadiationManager; import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.ISource;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import api.hbm.energy.IEnergyGenerator;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineAmgen extends TileEntity implements ISource { public class TileEntityMachineAmgen extends TileEntity implements IEnergyGenerator {
public List<IConsumer> list = new ArrayList();
public long power; public long power;
public long maxPower = 500; public long maxPower = 500;
boolean tact = false;
@Override @Override
public void updateEntity() { public void updateEntity() {
@ -80,53 +78,24 @@ public class TileEntityMachineAmgen extends TileEntity implements ISource {
if(power > maxPower) if(power > maxPower)
power = maxPower; power = maxPower;
tact = false; for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
ffgeuaInit(); this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
tact = true;
ffgeuaInit();
} }
} }
@Override @Override
public void ffgeuaInit() { public long getPower() {
ffgeua(this.xCoord, this.yCoord + 1, this.zCoord, getTact());
ffgeua(this.xCoord, this.yCoord - 1, this.zCoord, getTact());
ffgeua(this.xCoord - 1, this.yCoord, this.zCoord, getTact());
ffgeua(this.xCoord + 1, this.yCoord, this.zCoord, getTact());
ffgeua(this.xCoord, this.yCoord, this.zCoord - 1, getTact());
ffgeua(this.xCoord, this.yCoord, this.zCoord + 1, getTact());
}
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
public boolean getTact() {
return tact;
}
@Override
public long getSPower() {
return power; return power;
} }
@Override @Override
public void setSPower(long i) { public void setPower(long i) {
power = i; power = i;
} }
@Override @Override
public List<IConsumer> getList() { public long getMaxPower() {
return list; return this.maxPower;
} }
@Override
public void clearList() {
list.clear();
}
} }

View File

@ -2,7 +2,6 @@ package com.hbm.tileentity.machine;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineArcFurnace; import com.hbm.blocks.machine.MachineArcFurnace;
import com.hbm.interfaces.IConsumer;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.AuxElectricityPacket;
@ -10,6 +9,7 @@ import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import api.hbm.energy.IBatteryItem; import api.hbm.energy.IBatteryItem;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
@ -19,7 +19,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInventory, IConsumer { public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInventory, IEnergyUser {
private ItemStack slots[]; private ItemStack slots[];
@ -319,8 +319,10 @@ public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInv
this.hasPower(); this.hasPower();
boolean flag1 = false; boolean flag1 = false;
if(!worldObj.isRemote) if(!worldObj.isRemote) {
{
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
if(hasPower() && canProcess()) if(hasPower() && canProcess())
{ {
dualCookTime++; dualCookTime++;

View File

@ -1,6 +1,5 @@
package com.hbm.tileentity.machine; package com.hbm.tileentity.machine;
import com.hbm.interfaces.IConsumer;
import com.hbm.inventory.recipes.CentrifugeRecipes; import com.hbm.inventory.recipes.CentrifugeRecipes;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.AuxElectricityPacket;
@ -9,6 +8,7 @@ import com.hbm.packet.LoopedSoundPacket;
import com.hbm.packet.PacketDispatcher; import com.hbm.packet.PacketDispatcher;
import api.hbm.energy.IBatteryItem; import api.hbm.energy.IBatteryItem;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -23,7 +23,7 @@ import net.minecraft.util.AxisAlignedBB;
//TODO: move this trash to TileEntityMachineBase //TODO: move this trash to TileEntityMachineBase
//no seriously, this is dreadful //no seriously, this is dreadful
public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInventory, IConsumer { public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInventory, IEnergyUser {
private ItemStack slots[]; private ItemStack slots[];
@ -260,6 +260,8 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
public void updateEntity() { public void updateEntity() {
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
power = Library.chargeTEFromItems(slots, 1, power, maxPower); power = Library.chargeTEFromItems(slots, 1, power, maxPower);

View File

@ -11,13 +11,13 @@ import com.hbm.entity.missile.EntityMissileCustom;
import com.hbm.entity.projectile.EntityBulletBase; import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil; import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration; import com.hbm.handler.BulletConfiguration;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.IControlReceiver; import com.hbm.interfaces.IControlReceiver;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemTurretBiometry; import com.hbm.items.machine.ItemTurretBiometry;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -37,13 +37,14 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.common.util.ForgeDirection;
/** /**
* More over-engineered than ever, but chopping this thing into the smallest possible pieces makes it easier for my demented brain to comprehend * More over-engineered than ever, but chopping this thing into the smallest possible pieces makes it easier for my demented brain to comprehend
* @author hbm * @author hbm
* *
*/ */
public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase implements IConsumer, IControlReceiver { public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase implements IEnergyUser, IControlReceiver {
@Override @Override
public boolean hasPermission(EntityPlayer player) { public boolean hasPermission(EntityPlayer player) {
@ -144,6 +145,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
this.updateConnections();
if(this.target != null && !target.isEntityAlive()) { if(this.target != null && !target.isEntityAlive()) {
this.target = null; this.target = null;
this.stattrak++; this.stattrak++;
@ -235,6 +238,23 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
} }
} }
} }
private void updateConnections() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
this.trySubscribe(worldObj, xCoord + dir.offsetX * -1 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * -1 + rot.offsetZ * 0);
this.trySubscribe(worldObj, xCoord + dir.offsetX * -1 + rot.offsetX * -1, yCoord, zCoord + dir.offsetZ * -1 + rot.offsetZ * -1);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 0 + rot.offsetX * -2, yCoord, zCoord + dir.offsetZ * 0 + rot.offsetZ * -2);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 1 + rot.offsetX * -2, yCoord, zCoord + dir.offsetZ * 1 + rot.offsetZ * -2);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 0 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 0 + rot.offsetZ * 1);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 1 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 1 + rot.offsetZ * 1);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 2 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 0);
this.trySubscribe(worldObj, xCoord + dir.offsetX * 2 + rot.offsetX * -1, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * -1);
}
@Override @Override
public void networkUnpack(NBTTagCompound nbt) { public void networkUnpack(NBTTagCompound nbt) {