mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the great energy massacre part 2
This commit is contained in:
parent
8539a9b830
commit
810786fa9d
@ -23,7 +23,9 @@ public interface IEnergyConnector {
|
||||
* @param dir
|
||||
* @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
|
||||
|
||||
13
src/main/java/api/hbm/energy/IEnergyGenerator.java
Normal file
13
src/main/java/api/hbm/energy/IEnergyGenerator.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,9 @@
|
||||
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
|
||||
* @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
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
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.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -13,60 +15,16 @@ public class BlockCable extends BlockContainer {
|
||||
|
||||
public BlockCable(Material 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
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCable();
|
||||
return new TileEntityCableBaseNT();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
public int getRenderType() {
|
||||
return TestConductor.renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -78,5 +36,4 @@ public class BlockCable extends BlockContainer {
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
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.SideOnly;
|
||||
@ -37,7 +37,7 @@ public class CableSwitch extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCableSwitch();
|
||||
return new TileEntityCableBaseNT(); //TODO: extends this and implement switching
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.blocks.network;
|
||||
import com.hbm.render.block.ct.CT;
|
||||
import com.hbm.render.block.ct.CTStitchReceiver;
|
||||
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.SideOnly;
|
||||
@ -22,7 +22,7 @@ public class WireCoated extends BlockContainer implements IBlockCT {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityWireCoated();
|
||||
return new TileEntityCableBaseNT();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -17,15 +17,12 @@ import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
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.TileEntityGasDuct;
|
||||
import com.hbm.tileentity.conductor.TileEntityGasDuctSolid;
|
||||
import com.hbm.tileentity.conductor.TileEntityOilDuct;
|
||||
import com.hbm.tileentity.conductor.TileEntityOilDuctSolid;
|
||||
import com.hbm.tileentity.conductor.TileEntityPylonRedWire;
|
||||
import com.hbm.tileentity.conductor.TileEntityWireCoated;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTransformer;
|
||||
|
||||
@ -230,7 +230,6 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzLauncher.class, new RenderSoyuzLauncher());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzCapsule.class, new RenderCapsule());
|
||||
//network
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCable.class, new RenderCable());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOilDuct.class, new RenderOilDuct());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGasDuct.class, new RenderGasDuct());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidDuct.class, new RenderFluidDuct());
|
||||
|
||||
@ -293,8 +293,12 @@ public class MainRegistry {
|
||||
|
||||
TileMappings.writeMappings();
|
||||
|
||||
for(Entry<Class<? extends TileEntity>, String> e : TileMappings.map.entrySet()) {
|
||||
GameRegistry.registerTileEntity(e.getKey(), e.getValue());
|
||||
for(Entry<Class<? extends TileEntity>, String[]> e : TileMappings.map.entrySet()) {
|
||||
|
||||
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));
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,182 +18,181 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
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() {
|
||||
map.put(TileEntityTestBombAdvanced.class, "tilentity_testbombadvanced");
|
||||
map.put(TileEntityDiFurnace.class, "tilentity_diFurnace");
|
||||
map.put(TileEntityTestNuke.class, "tilentity_testnuke");
|
||||
map.put(TileEntityRotationTester.class, "tilentity_rotationtester");
|
||||
map.put(TileEntityTestRender.class, "tilentity_testrenderer");
|
||||
map.put(TileEntityTestContainer.class, "tilentity_testcontainer");
|
||||
map.put(TileEntityObjTester.class, "tilentity_objtester");
|
||||
map.put(TileEntityMachineCentrifuge.class, "tileentity_centrifuge");
|
||||
map.put(TileEntityNukeMan.class, "tileentity_nukeman");
|
||||
map.put(TileEntityMachineUF6Tank.class, "tileentity_uf6_tank");
|
||||
map.put(TileEntityMachinePuF6Tank.class, "tileentity_puf6_tank");
|
||||
map.put(TileEntityMachineReactor.class, "tileentity_reactor");
|
||||
map.put(TileEntityNukeFurnace.class, "tileentity_nukefurnace");
|
||||
map.put(TileEntityRtgFurnace.class, "tileentity_rtgfurnace");
|
||||
map.put(TileEntityMachineGenerator.class, "tileentity_generator");
|
||||
map.put(TileEntityMachineElectricFurnace.class, "tileentity_electric_furnace");
|
||||
map.put(TileEntityDecoTapeRecorder.class, "tileentity_taperecorder");
|
||||
map.put(TileEntityDecoSteelPoles.class, "tileentity_steelpoles");
|
||||
map.put(TileEntityDecoPoleTop.class, "tileentity_poletop");
|
||||
map.put(TileEntityDecoPoleSatelliteReceiver.class, "tileentity_satellitereceicer");
|
||||
map.put(TileEntityMachineDeuterium.class, "tileentity_deuterium");
|
||||
map.put(TileEntityWireCoated.class, "tileentity_wirecoated");
|
||||
map.put(TileEntityMachineBattery.class, "tileentity_battery");
|
||||
map.put(TileEntityMachineCoal.class, "tileentity_coal");
|
||||
map.put(TileEntityRedBarrel.class, "tileentity_barrel");
|
||||
map.put(TileEntityYellowBarrel.class, "tileentity_nukebarrel");
|
||||
map.put(TileEntityLaunchPad.class, "tileentity_launch1");
|
||||
map.put(TileEntityDecoBlock.class, "tileentity_deco");
|
||||
map.put(TileEntityDecoBlockAltW.class, "tileentity_deco_w");
|
||||
map.put(TileEntityDecoBlockAltG.class, "tileentity_deco_g");
|
||||
map.put(TileEntityDecoBlockAltF.class, "tileentity_deco_f");
|
||||
map.put(TileEntityCoreTitanium.class, "tileentity_core_titanium");
|
||||
map.put(TileEntityCoreAdvanced.class, "tileentity_core_advanced");
|
||||
map.put(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock");
|
||||
map.put(TileEntityCrashedBomb.class, "tileentity_crashed_balefire");
|
||||
map.put(TileEntityCable.class, "tileentity_cable");
|
||||
map.put(TileEntityConverterHeRf.class, "tileentity_converter_herf");
|
||||
map.put(TileEntityConverterRfHe.class, "tileentity_converter_rfhe");
|
||||
map.put(TileEntityMachineSchrabidiumTransmutator.class, "tileentity_schrabidium_transmutator");
|
||||
map.put(TileEntityMachineDiesel.class, "tileentity_diesel_generator");
|
||||
map.put(TileEntityWatzCore.class, "tileentity_watz_multiblock");
|
||||
map.put(TileEntityMachineShredder.class, "tileentity_machine_shredder");
|
||||
map.put(TileEntityMachineCMBFactory.class, "tileentity_machine_cmb");
|
||||
map.put(TileEntityFWatzCore.class, "tileentity_fwatz_multiblock");
|
||||
map.put(TileEntityMachineTeleporter.class, "tileentity_teleblock");
|
||||
map.put(TileEntityHatch.class, "tileentity_seal_lid");
|
||||
map.put(TileEntityMachineIGenerator.class, "tileentity_igenerator");
|
||||
map.put(TileEntityDummy.class, "tileentity_dummy");
|
||||
map.put(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
|
||||
map.put(TileEntityOilDuct.class, "tileentity_oil_duct");
|
||||
map.put(TileEntityOilDuctSolid.class, "tileentity_oil_duct_solid");
|
||||
map.put(TileEntityGasDuct.class, "tileentity_gas_duct");
|
||||
map.put(TileEntityGasDuctSolid.class, "tileentity_gas_duct_solid");
|
||||
map.put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
|
||||
map.put(TileEntityPylonRedWire.class, "tileentity_pylon_redwire");
|
||||
map.put(TileEntityStructureMarker.class, "tileentity_structure_marker");
|
||||
map.put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
|
||||
map.put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
|
||||
map.put(TileEntityFluidDuct.class, "tileentity_universal_duct");
|
||||
map.put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
|
||||
map.put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
||||
map.put(TileEntityTurretHeavy.class, "tileentity_turret_heavy");
|
||||
map.put(TileEntityTurretRocket.class, "tileentity_turret_rocket");
|
||||
map.put(TileEntityTurretLight.class, "tileentity_turret_light");
|
||||
map.put(TileEntityTurretFlamer.class, "tileentity_turret_flamer");
|
||||
map.put(TileEntityTurretTau.class, "tileentity_turret_tau");
|
||||
map.put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
||||
map.put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
||||
map.put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
||||
map.put(TileEntityMachinePress.class, "tileentity_press");
|
||||
map.put(TileEntityAMSBase.class, "tileentity_ams_base");
|
||||
map.put(TileEntityAMSEmitter.class, "tileentity_ams_emitter");
|
||||
map.put(TileEntityAMSLimiter.class, "tileentity_ams_limiter");
|
||||
map.put(TileEntityMachineSiren.class, "tileentity_siren");
|
||||
map.put(TileEntityMachineSPP.class, "tileentity_spp");
|
||||
map.put(TileEntityTurretSpitfire.class, "tileentity_turret_spitfire");
|
||||
map.put(TileEntityMachineRadGen.class, "tileentity_radgen");
|
||||
map.put(TileEntityMachineTransformer.class, "tileentity_transformer");
|
||||
map.put(TileEntityTurretCIWS.class, "tileentity_turret_cwis");
|
||||
map.put(TileEntityMachineRadar.class, "tileentity_radar");
|
||||
map.put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
|
||||
map.put(TileEntityTurretCheapo.class, "tileentity_turret_cheapo");
|
||||
map.put(TileEntityCelPrime.class, "tileentity_cel_prime");
|
||||
map.put(TileEntityCelPrimeTerminal.class, "tileentity_cel_prime_access");
|
||||
map.put(TileEntityCelPrimeBattery.class, "tileentity_cel_prime_energy");
|
||||
map.put(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector");
|
||||
map.put(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
|
||||
map.put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
||||
map.put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||
map.put(TileEntityMachineReactorSmall.class, "tileentity_small_reactor");
|
||||
map.put(TileEntityVaultDoor.class, "tileentity_vault_door");
|
||||
map.put(TileEntityRadiobox.class, "tileentity_radio_broadcaster");
|
||||
map.put(TileEntityRadioRec.class, "tileentity_radio_receiver");
|
||||
map.put(TileEntityVent.class, "tileentity_vent");
|
||||
map.put(TileEntityLandmine.class, "tileentity_landmine");
|
||||
map.put(TileEntityBomber.class, "tileentity_bomber");
|
||||
map.put(TileEntityMachineTeleLinker.class, "tileentity_telemetry_linker");
|
||||
map.put(TileEntityMachineKeyForge.class, "tileentity_key_forge");
|
||||
map.put(TileEntitySellafield.class, "tileentity_sellafield_core");
|
||||
map.put(TileEntityNukeN45.class, "tileentity_n45");
|
||||
map.put(TileEntityBlastDoor.class, "tileentity_blast_door");
|
||||
map.put(TileEntitySafe.class, "tileentity_safe");
|
||||
map.put(TileEntityMachineGasCent.class, "tileentity_gas_centrifuge");
|
||||
map.put(TileEntityMachineBoiler.class, "tileentity_boiler");
|
||||
map.put(TileEntityMachineBoilerElectric.class, "tileentity_electric_boiler");
|
||||
map.put(TileEntityMachineTurbine.class, "tileentity_turbine");
|
||||
map.put(TileEntityGeiger.class, "tileentity_geiger");
|
||||
map.put(TileEntityFF.class, "tileentity_forcefield");
|
||||
map.put(TileEntityForceField.class, "tileentity_machine_field");
|
||||
map.put(TileEntityMachineShredderLarge.class, "tileentity_machine_big_shredder");
|
||||
map.put(TileEntityRFDuct.class, "tileentity_hbm_rfduct");
|
||||
map.put(TileEntityReactorControl.class, "tileentity_reactor_remote_control");
|
||||
map.put(TileEntityMachineReactorLarge.class, "tileentity_large_reactor");
|
||||
map.put(TileEntityWasteDrum.class, "tileentity_waste_drum");
|
||||
map.put(TileEntityDecon.class, "tileentity_decon");
|
||||
map.put(TileEntityMachineSatDock.class, "tileentity_miner_dock");
|
||||
map.put(TileEntityMachineEPress.class, "tileentity_electric_press");
|
||||
map.put(TileEntityCoreEmitter.class, "tileentity_v0_emitter");
|
||||
map.put(TileEntityCoreReceiver.class, "tileentity_v0_receiver");
|
||||
map.put(TileEntityCoreInjector.class, "tileentity_v0_injector");
|
||||
map.put(TileEntityCoreStabilizer.class, "tileentity_v0_stabilizer");
|
||||
map.put(TileEntityCore.class, "tileentity_v0");
|
||||
map.put(TileEntityMachineArcFurnace.class, "tileentity_arc_furnace");
|
||||
map.put(TileEntityMachineAmgen.class, "tileentity_amgen");
|
||||
map.put(TileEntityGeysir.class, "tileentity_geysir");
|
||||
map.put(TileEntityMachineMissileAssembly.class, "tileentity_missile_assembly");
|
||||
map.put(TileEntityLaunchTable.class, "tileentity_large_launch_table");
|
||||
map.put(TileEntityCompactLauncher.class, "tileentity_small_launcher");
|
||||
map.put(TileEntityMultiblock.class, "tileentity_multi_core");
|
||||
map.put(TileEntityChlorineSeal.class, "tileentity_chlorine_seal");
|
||||
map.put(TileEntityCableSwitch.class, "tileentity_he_switch");
|
||||
map.put(TileEntitySoyuzLauncher.class, "tileentity_soyuz_launcher");
|
||||
map.put(TileEntityTesla.class, "tileentity_tesla_coil");
|
||||
map.put(TileEntityBarrel.class, "tileentity_fluid_barrel");
|
||||
map.put(TileEntityCyberCrab.class, "tileentity_crabs");
|
||||
map.put(TileEntitySoyuzCapsule.class, "tileentity_soyuz_capsule");
|
||||
map.put(TileEntityMachineCrystallizer.class, "tileentity_acidomatic");
|
||||
map.put(TileEntitySoyuzStruct.class, "tileentity_soyuz_struct");
|
||||
map.put(TileEntityITERStruct.class, "tileentity_iter_struct");
|
||||
map.put(TileEntityMachineMiningLaser.class, "tileentity_mining_laser");
|
||||
map.put(TileEntityProxyInventory.class, "tileentity_proxy_inventory");
|
||||
map.put(TileEntityProxyEnergy.class, "tileentity_proxy_power");
|
||||
map.put(TileEntityNukeBalefire.class, "tileentity_nuke_fstbmb");
|
||||
map.put(TileEntityProxyCombo.class, "tileentity_proxy_combo");
|
||||
map.put(TileEntityMicrowave.class, "tileentity_microwave");
|
||||
map.put(TileEntityMachineMiniRTG.class, "tileentity_mini_rtg");
|
||||
map.put(TileEntityITER.class, "tileentity_iter");
|
||||
map.put(TileEntityMachinePlasmaHeater.class, "tileentity_plasma_heater");
|
||||
map.put(TileEntityMachineFENSU.class, "tileentity_fensu");
|
||||
map.put(TileEntityTrappedBrick.class, "tileentity_trapped_brick");
|
||||
map.put(TileEntityPlasmaStruct.class, "tileentity_plasma_struct");
|
||||
map.put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
|
||||
map.put(TileEntityHadronDiode.class, "tileentity_hadron_diode");
|
||||
map.put(TileEntityHadronPower.class, "tileentity_hadron_power");
|
||||
map.put(TileEntityHadron.class, "tileentity_hadron");
|
||||
map.put(TileEntitySolarBoiler.class, "tileentity_solarboiler");
|
||||
map.put(TileEntitySolarMirror.class, "tileentity_solarmirror");
|
||||
map.put(TileEntityMachineDetector.class, "tileentity_he_detector");
|
||||
map.put(TileEntityFireworks.class, "tileentity_firework_box");
|
||||
map.put(TileEntityCrateTungsten.class, "tileentity_crate_hot");
|
||||
map.put(TileEntitySILEX.class, "tileentity_silex");
|
||||
map.put(TileEntityFEL.class, "tileentity_fel");
|
||||
map.put(TileEntityDemonLamp.class, "tileentity_demonlamp");
|
||||
map.put(TileEntityStorageDrum.class, "tileentity_waste_storage_drum");
|
||||
map.put(TileEntityDeaerator.class, "tileentity_deaerator");
|
||||
map.put(TileEntityChungus.class, "tileentity_chungus");
|
||||
map.put(TileEntityCableBaseNT.class, "tileentity_ohgod");
|
||||
map.put(TileEntityWatz.class, "tileentity_watz");
|
||||
map.put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
|
||||
map.put(TileEntityMachineOrbus.class, "tileentity_orbus");
|
||||
put(TileEntityTestBombAdvanced.class, "tilentity_testbombadvanced");
|
||||
put(TileEntityDiFurnace.class, "tilentity_diFurnace");
|
||||
put(TileEntityTestNuke.class, "tilentity_testnuke");
|
||||
put(TileEntityRotationTester.class, "tilentity_rotationtester");
|
||||
put(TileEntityTestRender.class, "tilentity_testrenderer");
|
||||
put(TileEntityTestContainer.class, "tilentity_testcontainer");
|
||||
put(TileEntityObjTester.class, "tilentity_objtester");
|
||||
put(TileEntityMachineCentrifuge.class, "tileentity_centrifuge");
|
||||
put(TileEntityNukeMan.class, "tileentity_nukeman");
|
||||
put(TileEntityMachineUF6Tank.class, "tileentity_uf6_tank");
|
||||
put(TileEntityMachinePuF6Tank.class, "tileentity_puf6_tank");
|
||||
put(TileEntityMachineReactor.class, "tileentity_reactor");
|
||||
put(TileEntityNukeFurnace.class, "tileentity_nukefurnace");
|
||||
put(TileEntityRtgFurnace.class, "tileentity_rtgfurnace");
|
||||
put(TileEntityMachineGenerator.class, "tileentity_generator");
|
||||
put(TileEntityMachineElectricFurnace.class, "tileentity_electric_furnace");
|
||||
put(TileEntityDecoTapeRecorder.class, "tileentity_taperecorder");
|
||||
put(TileEntityDecoSteelPoles.class, "tileentity_steelpoles");
|
||||
put(TileEntityDecoPoleTop.class, "tileentity_poletop");
|
||||
put(TileEntityDecoPoleSatelliteReceiver.class, "tileentity_satellitereceicer");
|
||||
put(TileEntityMachineDeuterium.class, "tileentity_deuterium");
|
||||
put(TileEntityMachineBattery.class, "tileentity_battery");
|
||||
put(TileEntityMachineCoal.class, "tileentity_coal");
|
||||
put(TileEntityRedBarrel.class, "tileentity_barrel");
|
||||
put(TileEntityYellowBarrel.class, "tileentity_nukebarrel");
|
||||
put(TileEntityLaunchPad.class, "tileentity_launch1");
|
||||
put(TileEntityDecoBlock.class, "tileentity_deco");
|
||||
put(TileEntityDecoBlockAltW.class, "tileentity_deco_w");
|
||||
put(TileEntityDecoBlockAltG.class, "tileentity_deco_g");
|
||||
put(TileEntityDecoBlockAltF.class, "tileentity_deco_f");
|
||||
put(TileEntityCoreTitanium.class, "tileentity_core_titanium");
|
||||
put(TileEntityCoreAdvanced.class, "tileentity_core_advanced");
|
||||
put(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock");
|
||||
put(TileEntityCrashedBomb.class, "tileentity_crashed_balefire");
|
||||
put(TileEntityConverterHeRf.class, "tileentity_converter_herf");
|
||||
put(TileEntityConverterRfHe.class, "tileentity_converter_rfhe");
|
||||
put(TileEntityMachineSchrabidiumTransmutator.class, "tileentity_schrabidium_transmutator");
|
||||
put(TileEntityMachineDiesel.class, "tileentity_diesel_generator");
|
||||
put(TileEntityWatzCore.class, "tileentity_watz_multiblock");
|
||||
put(TileEntityMachineShredder.class, "tileentity_machine_shredder");
|
||||
put(TileEntityMachineCMBFactory.class, "tileentity_machine_cmb");
|
||||
put(TileEntityFWatzCore.class, "tileentity_fwatz_multiblock");
|
||||
put(TileEntityMachineTeleporter.class, "tileentity_teleblock");
|
||||
put(TileEntityHatch.class, "tileentity_seal_lid");
|
||||
put(TileEntityMachineIGenerator.class, "tileentity_igenerator");
|
||||
put(TileEntityDummy.class, "tileentity_dummy");
|
||||
put(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
|
||||
put(TileEntityOilDuct.class, "tileentity_oil_duct");
|
||||
put(TileEntityOilDuctSolid.class, "tileentity_oil_duct_solid");
|
||||
put(TileEntityGasDuct.class, "tileentity_gas_duct");
|
||||
put(TileEntityGasDuctSolid.class, "tileentity_gas_duct_solid");
|
||||
put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
|
||||
put(TileEntityPylonRedWire.class, "tileentity_pylon_redwire");
|
||||
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
|
||||
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
|
||||
put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
|
||||
put(TileEntityFluidDuct.class, "tileentity_universal_duct");
|
||||
put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
|
||||
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
||||
put(TileEntityTurretHeavy.class, "tileentity_turret_heavy");
|
||||
put(TileEntityTurretRocket.class, "tileentity_turret_rocket");
|
||||
put(TileEntityTurretLight.class, "tileentity_turret_light");
|
||||
put(TileEntityTurretFlamer.class, "tileentity_turret_flamer");
|
||||
put(TileEntityTurretTau.class, "tileentity_turret_tau");
|
||||
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
||||
put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
||||
put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
||||
put(TileEntityMachinePress.class, "tileentity_press");
|
||||
put(TileEntityAMSBase.class, "tileentity_ams_base");
|
||||
put(TileEntityAMSEmitter.class, "tileentity_ams_emitter");
|
||||
put(TileEntityAMSLimiter.class, "tileentity_ams_limiter");
|
||||
put(TileEntityMachineSiren.class, "tileentity_siren");
|
||||
put(TileEntityMachineSPP.class, "tileentity_spp");
|
||||
put(TileEntityTurretSpitfire.class, "tileentity_turret_spitfire");
|
||||
put(TileEntityMachineRadGen.class, "tileentity_radgen");
|
||||
put(TileEntityMachineTransformer.class, "tileentity_transformer");
|
||||
put(TileEntityTurretCIWS.class, "tileentity_turret_cwis");
|
||||
put(TileEntityMachineRadar.class, "tileentity_radar");
|
||||
put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
|
||||
put(TileEntityTurretCheapo.class, "tileentity_turret_cheapo");
|
||||
put(TileEntityCelPrime.class, "tileentity_cel_prime");
|
||||
put(TileEntityCelPrimeTerminal.class, "tileentity_cel_prime_access");
|
||||
put(TileEntityCelPrimeBattery.class, "tileentity_cel_prime_energy");
|
||||
put(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector");
|
||||
put(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
|
||||
put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
||||
put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||
put(TileEntityMachineReactorSmall.class, "tileentity_small_reactor");
|
||||
put(TileEntityVaultDoor.class, "tileentity_vault_door");
|
||||
put(TileEntityRadiobox.class, "tileentity_radio_broadcaster");
|
||||
put(TileEntityRadioRec.class, "tileentity_radio_receiver");
|
||||
put(TileEntityVent.class, "tileentity_vent");
|
||||
put(TileEntityLandmine.class, "tileentity_landmine");
|
||||
put(TileEntityBomber.class, "tileentity_bomber");
|
||||
put(TileEntityMachineTeleLinker.class, "tileentity_telemetry_linker");
|
||||
put(TileEntityMachineKeyForge.class, "tileentity_key_forge");
|
||||
put(TileEntitySellafield.class, "tileentity_sellafield_core");
|
||||
put(TileEntityNukeN45.class, "tileentity_n45");
|
||||
put(TileEntityBlastDoor.class, "tileentity_blast_door");
|
||||
put(TileEntitySafe.class, "tileentity_safe");
|
||||
put(TileEntityMachineGasCent.class, "tileentity_gas_centrifuge");
|
||||
put(TileEntityMachineBoiler.class, "tileentity_boiler");
|
||||
put(TileEntityMachineBoilerElectric.class, "tileentity_electric_boiler");
|
||||
put(TileEntityMachineTurbine.class, "tileentity_turbine");
|
||||
put(TileEntityGeiger.class, "tileentity_geiger");
|
||||
put(TileEntityFF.class, "tileentity_forcefield");
|
||||
put(TileEntityForceField.class, "tileentity_machine_field");
|
||||
put(TileEntityMachineShredderLarge.class, "tileentity_machine_big_shredder");
|
||||
put(TileEntityRFDuct.class, "tileentity_hbm_rfduct");
|
||||
put(TileEntityReactorControl.class, "tileentity_reactor_remote_control");
|
||||
put(TileEntityMachineReactorLarge.class, "tileentity_large_reactor");
|
||||
put(TileEntityWasteDrum.class, "tileentity_waste_drum");
|
||||
put(TileEntityDecon.class, "tileentity_decon");
|
||||
put(TileEntityMachineSatDock.class, "tileentity_miner_dock");
|
||||
put(TileEntityMachineEPress.class, "tileentity_electric_press");
|
||||
put(TileEntityCoreEmitter.class, "tileentity_v0_emitter");
|
||||
put(TileEntityCoreReceiver.class, "tileentity_v0_receiver");
|
||||
put(TileEntityCoreInjector.class, "tileentity_v0_injector");
|
||||
put(TileEntityCoreStabilizer.class, "tileentity_v0_stabilizer");
|
||||
put(TileEntityCore.class, "tileentity_v0");
|
||||
put(TileEntityMachineArcFurnace.class, "tileentity_arc_furnace");
|
||||
put(TileEntityMachineAmgen.class, "tileentity_amgen");
|
||||
put(TileEntityGeysir.class, "tileentity_geysir");
|
||||
put(TileEntityMachineMissileAssembly.class, "tileentity_missile_assembly");
|
||||
put(TileEntityLaunchTable.class, "tileentity_large_launch_table");
|
||||
put(TileEntityCompactLauncher.class, "tileentity_small_launcher");
|
||||
put(TileEntityMultiblock.class, "tileentity_multi_core");
|
||||
put(TileEntityChlorineSeal.class, "tileentity_chlorine_seal");
|
||||
put(TileEntitySoyuzLauncher.class, "tileentity_soyuz_launcher");
|
||||
put(TileEntityTesla.class, "tileentity_tesla_coil");
|
||||
put(TileEntityBarrel.class, "tileentity_fluid_barrel");
|
||||
put(TileEntityCyberCrab.class, "tileentity_crabs");
|
||||
put(TileEntitySoyuzCapsule.class, "tileentity_soyuz_capsule");
|
||||
put(TileEntityMachineCrystallizer.class, "tileentity_acidomatic");
|
||||
put(TileEntitySoyuzStruct.class, "tileentity_soyuz_struct");
|
||||
put(TileEntityITERStruct.class, "tileentity_iter_struct");
|
||||
put(TileEntityMachineMiningLaser.class, "tileentity_mining_laser");
|
||||
put(TileEntityProxyInventory.class, "tileentity_proxy_inventory");
|
||||
put(TileEntityProxyEnergy.class, "tileentity_proxy_power");
|
||||
put(TileEntityNukeBalefire.class, "tileentity_nuke_fstbmb");
|
||||
put(TileEntityProxyCombo.class, "tileentity_proxy_combo");
|
||||
put(TileEntityMicrowave.class, "tileentity_microwave");
|
||||
put(TileEntityMachineMiniRTG.class, "tileentity_mini_rtg");
|
||||
put(TileEntityITER.class, "tileentity_iter");
|
||||
put(TileEntityMachinePlasmaHeater.class, "tileentity_plasma_heater");
|
||||
put(TileEntityMachineFENSU.class, "tileentity_fensu");
|
||||
put(TileEntityTrappedBrick.class, "tileentity_trapped_brick");
|
||||
put(TileEntityPlasmaStruct.class, "tileentity_plasma_struct");
|
||||
put(TileEntityMachineLargeTurbine.class, "tileentity_industrial_turbine");
|
||||
put(TileEntityHadronDiode.class, "tileentity_hadron_diode");
|
||||
put(TileEntityHadronPower.class, "tileentity_hadron_power");
|
||||
put(TileEntityHadron.class, "tileentity_hadron");
|
||||
put(TileEntitySolarBoiler.class, "tileentity_solarboiler");
|
||||
put(TileEntitySolarMirror.class, "tileentity_solarmirror");
|
||||
put(TileEntityMachineDetector.class, "tileentity_he_detector");
|
||||
put(TileEntityFireworks.class, "tileentity_firework_box");
|
||||
put(TileEntityCrateTungsten.class, "tileentity_crate_hot");
|
||||
put(TileEntitySILEX.class, "tileentity_silex");
|
||||
put(TileEntityFEL.class, "tileentity_fel");
|
||||
put(TileEntityDemonLamp.class, "tileentity_demonlamp");
|
||||
put(TileEntityStorageDrum.class, "tileentity_waste_storage_drum");
|
||||
put(TileEntityDeaerator.class, "tileentity_deaerator");
|
||||
put(TileEntityChungus.class, "tileentity_chungus");
|
||||
put(TileEntityCableBaseNT.class, "tileentity_ohgod");
|
||||
put(TileEntityWatz.class, "tileentity_watz");
|
||||
put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
|
||||
put(TileEntityMachineOrbus.class, "tileentity_orbus");
|
||||
|
||||
map.put(TileEntityLoot.class, "tileentity_ntm_loot");
|
||||
map.put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
|
||||
put(TileEntityLoot.class, "tileentity_ntm_loot");
|
||||
put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
|
||||
|
||||
put(TileEntityCableBaseNT.class, "tileentity_cable", "tileentity_wirecoated");
|
||||
|
||||
putBombs();
|
||||
putTurrets();
|
||||
@ -203,75 +202,79 @@ public class TileMappings {
|
||||
}
|
||||
|
||||
private static void putBombs() {
|
||||
map.put(TileEntityBombMulti.class, "tileentity_bombmulti");
|
||||
map.put(TileEntityNukeGadget.class, "tilentity_nukegadget");
|
||||
map.put(TileEntityNukeBoy.class, "tilentity_nukeboy");
|
||||
map.put(TileEntityNukeMike.class, "tileentity_nukemike");
|
||||
map.put(TileEntityNukeTsar.class, "tileentity_nuketsar");
|
||||
map.put(TileEntityNukeFleija.class, "tileentity_nukefleija");
|
||||
map.put(TileEntityNukePrototype.class, "tileentity_nukeproto");
|
||||
map.put(TileEntityNukeSolinium.class, "tileentity_nuke_solinium");
|
||||
map.put(TileEntityNukeN2.class, "tileentity_nuke_n2");
|
||||
map.put(TileEntityNukeCustom.class, "tileentity_nuke_custom");
|
||||
put(TileEntityBombMulti.class, "tileentity_bombmulti");
|
||||
put(TileEntityNukeGadget.class, "tilentity_nukegadget");
|
||||
put(TileEntityNukeBoy.class, "tilentity_nukeboy");
|
||||
put(TileEntityNukeMike.class, "tileentity_nukemike");
|
||||
put(TileEntityNukeTsar.class, "tileentity_nuketsar");
|
||||
put(TileEntityNukeFleija.class, "tileentity_nukefleija");
|
||||
put(TileEntityNukePrototype.class, "tileentity_nukeproto");
|
||||
put(TileEntityNukeSolinium.class, "tileentity_nuke_solinium");
|
||||
put(TileEntityNukeN2.class, "tileentity_nuke_n2");
|
||||
put(TileEntityNukeCustom.class, "tileentity_nuke_custom");
|
||||
}
|
||||
|
||||
private static void putTurrets() {
|
||||
map.put(TileEntityTurretChekhov.class, "tileentity_turret_chekhov");
|
||||
map.put(TileEntityTurretJeremy.class, "tileentity_turret_jeremy");
|
||||
map.put(TileEntityTurretTauon.class, "tileentity_turret_tauon");
|
||||
map.put(TileEntityTurretFriendly.class, "tileentity_turret_friendly");
|
||||
map.put(TileEntityTurretRichard.class, "tileentity_turret_richard");
|
||||
map.put(TileEntityTurretHoward.class, "tileentity_turret_howard");
|
||||
map.put(TileEntityTurretHowardDamaged.class, "tileentity_turret_howard_damaged");
|
||||
map.put(TileEntityTurretMaxwell.class, "tileentity_turret_maxwell");
|
||||
map.put(TileEntityTurretFritz.class, "tileentity_turret_fritz");
|
||||
map.put(TileEntityTurretBrandon.class, "tileentity_turret_brandon");
|
||||
put(TileEntityTurretChekhov.class, "tileentity_turret_chekhov");
|
||||
put(TileEntityTurretJeremy.class, "tileentity_turret_jeremy");
|
||||
put(TileEntityTurretTauon.class, "tileentity_turret_tauon");
|
||||
put(TileEntityTurretFriendly.class, "tileentity_turret_friendly");
|
||||
put(TileEntityTurretRichard.class, "tileentity_turret_richard");
|
||||
put(TileEntityTurretHoward.class, "tileentity_turret_howard");
|
||||
put(TileEntityTurretHowardDamaged.class, "tileentity_turret_howard_damaged");
|
||||
put(TileEntityTurretMaxwell.class, "tileentity_turret_maxwell");
|
||||
put(TileEntityTurretFritz.class, "tileentity_turret_fritz");
|
||||
put(TileEntityTurretBrandon.class, "tileentity_turret_brandon");
|
||||
}
|
||||
|
||||
private static void putMachines() {
|
||||
map.put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace");
|
||||
map.put(TileEntityUVLamp.class, "tileentity_uv_lamp");
|
||||
put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace");
|
||||
put(TileEntityUVLamp.class, "tileentity_uv_lamp");
|
||||
|
||||
map.put(TileEntityCondenser.class, "tileentity_condenser");
|
||||
map.put(TileEntityTowerSmall.class, "tileentity_cooling_tower_small");
|
||||
map.put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large");
|
||||
map.put(TileEntityDeuteriumExtractor.class, "tileentity_deuterium_extractor");
|
||||
map.put(TileEntityDeuteriumTower.class, "tileentity_deuterium_tower");
|
||||
put(TileEntityCondenser.class, "tileentity_condenser");
|
||||
put(TileEntityTowerSmall.class, "tileentity_cooling_tower_small");
|
||||
put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large");
|
||||
put(TileEntityDeuteriumExtractor.class, "tileentity_deuterium_extractor");
|
||||
put(TileEntityDeuteriumTower.class, "tileentity_deuterium_tower");
|
||||
|
||||
map.put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
map.put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
map.put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");
|
||||
map.put(TileEntityMachineGasFlare.class, "tileentity_gasflare");
|
||||
map.put(TileEntityMachineRefinery.class, "tileentity_refinery");
|
||||
map.put(TileEntityMachineFractionTower.class, "tileentity_fraction_tower");
|
||||
map.put(TileEntitySpacer.class, "tileentity_fraction_spacer");
|
||||
map.put(TileEntityMachineCatalyticCracker.class, "tileentity_catalytic_cracker");
|
||||
put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");
|
||||
put(TileEntityMachineGasFlare.class, "tileentity_gasflare");
|
||||
put(TileEntityMachineRefinery.class, "tileentity_refinery");
|
||||
put(TileEntityMachineFractionTower.class, "tileentity_fraction_tower");
|
||||
put(TileEntitySpacer.class, "tileentity_fraction_spacer");
|
||||
put(TileEntityMachineCatalyticCracker.class, "tileentity_catalytic_cracker");
|
||||
|
||||
map.put(TileEntityReactorZirnox.class, "tileentity_zirnox");
|
||||
map.put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
|
||||
put(TileEntityReactorZirnox.class, "tileentity_zirnox");
|
||||
put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
|
||||
}
|
||||
|
||||
private static void putPile() {
|
||||
map.put(TileEntityPileFuel.class, "tileentity_pile_fuel");
|
||||
map.put(TileEntityPileSource.class, "tileentity_pile_source");
|
||||
put(TileEntityPileFuel.class, "tileentity_pile_fuel");
|
||||
put(TileEntityPileSource.class, "tileentity_pile_source");
|
||||
}
|
||||
|
||||
private static void putRBMK() {
|
||||
map.put(TileEntityRBMKRod.class, "tileentity_rbmk_rod");
|
||||
map.put(TileEntityRBMKRodReaSim.class, "tileentity_rbmk_rod_reasim");
|
||||
map.put(TileEntityRBMKControlManual.class, "tileentity_rbmk_control");
|
||||
map.put(TileEntityRBMKControlAuto.class, "tileentity_rbmk_control_auto");
|
||||
map.put(TileEntityRBMKBlank.class, "tileentity_rbmk_blank");
|
||||
map.put(TileEntityRBMKBoiler.class, "tileentity_rbmk_boiler");
|
||||
map.put(TileEntityRBMKReflector.class, "tileentity_rbmk_reflector");
|
||||
map.put(TileEntityRBMKAbsorber.class, "tileentity_rbmk_absorber");
|
||||
map.put(TileEntityRBMKModerator.class, "tileentity_rbmk_moderator");
|
||||
map.put(TileEntityRBMKOutgasser.class, "tileentity_rbmk_outgasser");
|
||||
map.put(TileEntityRBMKCooler.class, "tileentity_rbmk_cooler");
|
||||
map.put(TileEntityRBMKStorage.class, "tileentity_rbmk_storage");
|
||||
map.put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console");
|
||||
map.put(TileEntityRBMKConsole.class, "tileentity_rbmk_console");
|
||||
map.put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
|
||||
map.put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet");
|
||||
put(TileEntityRBMKRod.class, "tileentity_rbmk_rod");
|
||||
put(TileEntityRBMKRodReaSim.class, "tileentity_rbmk_rod_reasim");
|
||||
put(TileEntityRBMKControlManual.class, "tileentity_rbmk_control");
|
||||
put(TileEntityRBMKControlAuto.class, "tileentity_rbmk_control_auto");
|
||||
put(TileEntityRBMKBlank.class, "tileentity_rbmk_blank");
|
||||
put(TileEntityRBMKBoiler.class, "tileentity_rbmk_boiler");
|
||||
put(TileEntityRBMKReflector.class, "tileentity_rbmk_reflector");
|
||||
put(TileEntityRBMKAbsorber.class, "tileentity_rbmk_absorber");
|
||||
put(TileEntityRBMKModerator.class, "tileentity_rbmk_moderator");
|
||||
put(TileEntityRBMKOutgasser.class, "tileentity_rbmk_outgasser");
|
||||
put(TileEntityRBMKCooler.class, "tileentity_rbmk_cooler");
|
||||
put(TileEntityRBMKStorage.class, "tileentity_rbmk_storage");
|
||||
put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console");
|
||||
put(TileEntityRBMKConsole.class, "tileentity_rbmk_console");
|
||||
put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
|
||||
put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet");
|
||||
}
|
||||
|
||||
private static void put(Class<? extends TileEntity> clazz, String... names) {
|
||||
map.put(clazz, names);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissilePacket;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -16,8 +16,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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[];
|
||||
|
||||
@ -187,16 +188,25 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory,
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 2, power, maxPower);
|
||||
|
||||
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 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
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
@ -219,11 +229,30 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory,
|
||||
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
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
@ -22,6 +21,7 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -33,8 +33,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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[];
|
||||
|
||||
@ -165,6 +166,9 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
updateTypes();
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0)
|
||||
this.updateConnections();
|
||||
|
||||
tanks[0].loadTank(2, 6, 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() {
|
||||
|
||||
if(power >= maxPower * 0.75 && isMissileValid() && hasDesignator() && hasFuel())
|
||||
@ -541,4 +555,24 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
|
||||
public long getMaxPower() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
package com.hbm.tileentity.conductor;
|
||||
|
||||
public class TileEntityCableSwitch extends TileEntityWireCoated {
|
||||
|
||||
}
|
||||
@ -4,8 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.calc.UnionOfTileEntitiesAndBooleans;
|
||||
import com.hbm.interfaces.IConductor;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
@ -13,6 +11,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEPylonDestructorPacket;
|
||||
import com.hbm.packet.TEPylonSenderPacket;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.network.TileEntityCableBaseNT;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -22,9 +21,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
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 boolean scheduleConnectionCheck = false;
|
||||
public int[][] scheduleBuffer;
|
||||
|
||||
@ -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>();
|
||||
|
||||
}
|
||||
@ -5,10 +5,8 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemCatalyst;
|
||||
@ -32,7 +30,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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[];
|
||||
|
||||
@ -49,7 +47,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
public int mode = 0;
|
||||
public boolean locked = false;
|
||||
public FluidTank[] tanks;
|
||||
public List<IConsumer> list = new ArrayList();
|
||||
public int color = -1;
|
||||
|
||||
Random rand = new Random();
|
||||
@ -247,9 +244,6 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
||||
{
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if(age == 9 || age == 19)
|
||||
ffgeuaInit();
|
||||
|
||||
tanks[0].setType(0, 1, 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)
|
||||
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
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
@ -27,7 +26,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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[];
|
||||
|
||||
@ -364,23 +363,6 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
|
||||
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
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
|
||||
@ -7,7 +7,6 @@ import java.util.Random;
|
||||
import com.hbm.entity.particle.EntityGasFlameFX;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
@ -28,7 +27,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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[];
|
||||
|
||||
@ -378,23 +377,6 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
|
||||
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
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
|
||||
@ -6,10 +6,8 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
@ -17,6 +15,7 @@ import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -25,7 +24,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
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 static final long maxPower = 100000000000L;
|
||||
@ -33,7 +32,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
public float rotor;
|
||||
public float lastRotor;
|
||||
|
||||
public List<IConsumer> list1 = new ArrayList();
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
|
||||
public FluidTank[] tanks;
|
||||
@ -65,6 +63,9 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
|
||||
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)
|
||||
power = maxPower;
|
||||
|
||||
@ -74,7 +75,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
turnTimer = 25;
|
||||
|
||||
this.fillFluidInit(tanks[1].getTankType());
|
||||
this.ffgeuaInit();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
@ -137,17 +137,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
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
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
@ -224,26 +213,6 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
public void clearFluidList(FluidType type) {
|
||||
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
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
@ -255,4 +224,24 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,13 +4,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -23,7 +23,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
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 static final long maxPower = 1000000000L;
|
||||
@ -51,6 +51,8 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
|
||||
|
||||
watts = MathHelper.clamp_int(watts, 1, 100);
|
||||
long demand = maxPower * watts / 2000;
|
||||
|
||||
@ -238,6 +240,11 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements ICon
|
||||
return this.maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
tank.writeToNBT(nbt, "tank");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,14 +4,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.ILaserable;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -21,13 +20,11 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
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 joules;
|
||||
public FluidTank tank;
|
||||
public List<IConsumer> list = new ArrayList();
|
||||
public int age = 0;
|
||||
|
||||
public TileEntityCoreReceiver() {
|
||||
super(0);
|
||||
@ -46,7 +43,10 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISo
|
||||
|
||||
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) {
|
||||
|
||||
@ -63,71 +63,31 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements ISo
|
||||
this.networkPack(data, 50);
|
||||
|
||||
joules = 0;
|
||||
|
||||
age++;
|
||||
if(age >= 20)
|
||||
{
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if(age == 9 || age == 19) {
|
||||
ffgeuaInit();
|
||||
|
||||
if(!getTact())
|
||||
power = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
|
||||
joules = data.getLong("joules");
|
||||
}
|
||||
|
||||
@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, 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() {
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSPower(long i) {
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IConsumer> getList() {
|
||||
return list;
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearList() {
|
||||
this.list.clear();
|
||||
public long getMaxPower() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemLens;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -14,7 +14,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IConsumer {
|
||||
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyUser {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 2500000000L;
|
||||
@ -37,6 +37,8 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
watts = MathHelper.clamp_int(watts, 1, 100);
|
||||
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) {
|
||||
|
||||
power = data.getLong("power");
|
||||
@ -113,6 +121,11 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
public long getMaxPower() {
|
||||
return this.maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
@ -121,8 +134,7 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
|
||||
@ -3,13 +3,13 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFFPacket;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -22,8 +22,9 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
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[];
|
||||
|
||||
@ -232,6 +233,8 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
updateConnections();
|
||||
|
||||
int rStack = 0;
|
||||
int hStack = 0;
|
||||
radius = 16;
|
||||
@ -434,7 +437,6 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -448,6 +450,19 @@ public class TileEntityForceField extends TileEntity implements ISidedInventory,
|
||||
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
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
|
||||
@ -8,7 +8,6 @@ import java.util.List;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.BlockHadronCoil;
|
||||
import com.hbm.blocks.machine.BlockHadronPlating;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.recipes.HadronRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
@ -18,6 +17,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.tileentity.machine.TileEntityHadronDiode.DiodeConfig;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -28,7 +28,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityHadron extends TileEntityMachineBase implements IConsumer {
|
||||
public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUser {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10000000;
|
||||
@ -256,6 +256,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IConsumer
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public class Particle {
|
||||
|
||||
//Starting values
|
||||
|
||||
@ -1,18 +1,28 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.machine.BlockHadronPower;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
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;
|
||||
|
||||
@Override
|
||||
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
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachineITER;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
@ -19,6 +18,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -27,7 +27,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
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 static final long maxPower = 10000000;
|
||||
@ -160,6 +160,9 @@ public class TileEntityITER extends TileEntityMachineBase implements IConsumer,
|
||||
|
||||
this.networkPack(data, 250);
|
||||
/// END Notif packets ///
|
||||
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 3, zCoord);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord - 3, zCoord);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@ -5,21 +5,19 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.ISource;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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 maxPower = 500;
|
||||
boolean tact = false;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
@ -80,53 +78,24 @@ public class TileEntityMachineAmgen extends TileEntity implements ISource {
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
|
||||
tact = false;
|
||||
ffgeuaInit();
|
||||
tact = true;
|
||||
ffgeuaInit();
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
|
||||
@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 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() {
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSPower(long i) {
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IConsumer> getList() {
|
||||
return list;
|
||||
public long getMaxPower() {
|
||||
return this.maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearList() {
|
||||
list.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachineArcFurnace;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
@ -10,6 +9,7 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -19,7 +19,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInventory, IConsumer {
|
||||
public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -319,8 +319,10 @@ public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInv
|
||||
this.hasPower();
|
||||
boolean flag1 = false;
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
|
||||
|
||||
if(hasPower() && canProcess())
|
||||
{
|
||||
dualCookTime++;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.inventory.recipes.CentrifugeRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
@ -9,6 +8,7 @@ import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -23,7 +23,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
//TODO: move this trash to TileEntityMachineBase
|
||||
//no seriously, this is dreadful
|
||||
public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInventory, IConsumer {
|
||||
public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -260,6 +260,8 @@ public class TileEntityMachineCentrifuge extends TileEntity implements ISidedInv
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
|
||||
|
||||
@ -11,13 +11,13 @@ import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemTurretBiometry;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
@ -37,13 +37,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
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
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase implements IConsumer, IControlReceiver {
|
||||
public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase implements IEnergyUser, IControlReceiver {
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
@ -144,6 +145,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
if(this.target != null && !target.isEntityAlive()) {
|
||||
this.target = null;
|
||||
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
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user