mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Begin work on MekanismGenerators
This commit is contained in:
1 parent
59eca85008
commit
735106c25e
65 files changed
+331
-387
No files matched your search
@@ -208,7 +208,7 @@ public class Coord4D
|
||||
*/
|
||||
public Coord4D offset(EnumFacing side)
|
||||
{
|
||||
return getFromSide(side, 1);
|
||||
return offset(side, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -217,7 +217,7 @@ public class Coord4D
|
||||
* @param amount - how far to translate this Coord4D
|
||||
* @return translated Coord4D
|
||||
*/
|
||||
public Coord4D getFromSide(EnumFacing side, int amount)
|
||||
public Coord4D offset(EnumFacing side, int amount)
|
||||
{
|
||||
if(side == null || amount == 0)
|
||||
{
|
||||
|
||||
@@ -104,7 +104,7 @@ public final class TransporterPathfinder
|
||||
|
||||
while(true)
|
||||
{
|
||||
Coord4D coord = start.getFromSide(side, count);
|
||||
Coord4D coord = start.offset(side, count);
|
||||
|
||||
if(transportStack.canInsertToTransporter(coord.getTileEntity(worldObj), side))
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.IHeatTransfer;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.content.boiler.BoilerCache;
|
||||
import mekanism.common.content.boiler.BoilerUpdateProtocol;
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
@@ -307,7 +308,7 @@ public class TileEntityBoilerCasing extends TileEntityMultiblock<SynchronizedBoi
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
structure.waterStored = new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt());
|
||||
structure.waterStored = new FluidStack(FluidRegistry.getFluid(PacketHandler.readString(dataStream)), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.waterStored = null;
|
||||
@@ -315,7 +316,7 @@ public class TileEntityBoilerCasing extends TileEntityMultiblock<SynchronizedBoi
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
structure.steamStored = new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt());
|
||||
structure.steamStored = new FluidStack(FluidRegistry.getFluid(PacketHandler.readString(dataStream)), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.steamStored = null;
|
||||
|
||||
@@ -9,6 +9,7 @@ import mekanism.api.IConfigurable;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.Tier.FluidTankTier;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IFluidContainerManager;
|
||||
@@ -35,7 +36,6 @@ import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
public class TileEntityFluidTank extends TileEntityContainerBlock implements IActiveState, IConfigurable, IFluidHandler, ISustainedTank, IFluidContainerManager, ITankManager, ISecurityTile
|
||||
{
|
||||
@@ -328,7 +328,7 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
||||
|
||||
if(valve > 0)
|
||||
{
|
||||
valveFluid = FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream));
|
||||
valveFluid = FluidRegistry.getFluid(PacketHandler.readString(dataStream));
|
||||
}
|
||||
else {
|
||||
valveFluid = null;
|
||||
@@ -336,7 +336,7 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(PacketHandler.readString(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
fluidTank.setFluid(null);
|
||||
|
||||
@@ -349,10 +349,10 @@ public class TileEntityThermalEvaporationController extends TileEntityThermalEva
|
||||
startPoint = startPoint.offset(EnumFacing.UP);
|
||||
}
|
||||
|
||||
Coord4D test = startPoint.offset(EnumFacing.DOWN).getFromSide(right, 2);
|
||||
Coord4D test = startPoint.offset(EnumFacing.DOWN).offset(right, 2);
|
||||
isLeftOnFace = test.getTileEntity(worldObj) instanceof TileEntityThermalEvaporationBlock;
|
||||
|
||||
startPoint = startPoint.getFromSide(left, isLeftOnFace ? 1 : 2);
|
||||
startPoint = startPoint.offset(left, isLeftOnFace ? 1 : 2);
|
||||
|
||||
if(!scanTopLayer(startPoint))
|
||||
{
|
||||
@@ -390,7 +390,7 @@ public class TileEntityThermalEvaporationController extends TileEntityThermalEva
|
||||
{
|
||||
for(int z = 0; z < 4; z++)
|
||||
{
|
||||
Coord4D pointer = current.getFromSide(right, x).getFromSide(back, z);
|
||||
Coord4D pointer = current.offset(right, x).offset(back, z);
|
||||
TileEntity pointerTile = pointer.getTileEntity(worldObj);
|
||||
|
||||
int corner = getCorner(x, z);
|
||||
@@ -465,7 +465,7 @@ public class TileEntityThermalEvaporationController extends TileEntityThermalEva
|
||||
{
|
||||
for(int z = 0; z < 4; z++)
|
||||
{
|
||||
Coord4D pointer = current.getFromSide(right, x).getFromSide(back, z);
|
||||
Coord4D pointer = current.offset(right, x).offset(back, z);
|
||||
TileEntity pointerTile = pointer.getTileEntity(worldObj);
|
||||
|
||||
if((x == 1 || x == 2) && (z == 1 || z == 2))
|
||||
|
||||
@@ -13,15 +13,13 @@ import mekanism.generators.common.GeneratorsBlocks;
|
||||
import mekanism.generators.common.block.BlockGenerator.GeneratorType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
|
||||
@@ -19,12 +19,11 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerBioGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityBioGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiBioGenerator extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -22,12 +22,11 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerGasGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityGasGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiGasGenerator extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -25,12 +25,11 @@ import mekanism.generators.common.inventory.container.ContainerHeatGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityHeatGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiHeatGenerator extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -22,12 +22,11 @@ import mekanism.generators.common.content.turbine.TurbineUpdateProtocol;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiIndustrialTurbine extends GuiMekanism
|
||||
{
|
||||
@@ -77,7 +76,7 @@ public class GuiIndustrialTurbine extends GuiMekanism
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
fontRendererObj.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 5, 0x404040);
|
||||
fontRendererObj.drawString(tileEntity.getName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getName())/2), 5, 0x404040);
|
||||
|
||||
double energyMultiplier = (general.maxEnergyPerSteam/TurbineUpdateProtocol.MAX_BLADES)*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil);
|
||||
|
||||
|
||||
@@ -17,12 +17,11 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerNeutronCapture;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorNeutronCapture;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiNeutronCapture extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -18,12 +18,11 @@ import mekanism.generators.client.gui.element.GuiStatTab;
|
||||
import mekanism.generators.common.inventory.container.ContainerReactorController;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiReactorController extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -28,13 +28,12 @@ import mekanism.generators.client.gui.element.GuiStatTab;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiReactorFuel extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.generators.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,14 +33,12 @@ import mekanism.generators.client.gui.element.GuiStatTab;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.block.BlockStaticLiquid;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiReactorHeat extends GuiMekanism
|
||||
{
|
||||
@@ -195,7 +194,7 @@ public class GuiReactorHeat extends GuiMekanism
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int mouseX, int mouseY, int button)
|
||||
public void mouseClicked(int mouseX, int mouseY, int button) throws IOException
|
||||
{
|
||||
super.mouseClicked(mouseX, mouseY, button);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.generators.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
@@ -15,13 +16,13 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorLogicAdapter;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorLogicAdapter.ReactorLogic;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiReactorLogicAdapter extends GuiMekanism
|
||||
{
|
||||
@@ -51,7 +52,7 @@ public class GuiReactorLogicAdapter extends GuiMekanism
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), type.getRenderStack(), 27, 35 + (22*type.ordinal()));
|
||||
itemRender.renderItemAndEffectIntoGUI(type.getRenderStack(), 27, 35 + (22*type.ordinal()));
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
@@ -107,7 +108,7 @@ public class GuiReactorLogicAdapter extends GuiMekanism
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int button)
|
||||
protected void mouseClicked(int mouseX, int mouseY, int button) throws IOException
|
||||
{
|
||||
super.mouseClicked(mouseX, mouseY, button);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.generators.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -22,12 +23,11 @@ import mekanism.generators.client.gui.element.GuiFuelTab;
|
||||
import mekanism.generators.client.gui.element.GuiHeatTab;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiReactorStats extends GuiMekanism
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public class GuiReactorStats extends GuiMekanism
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int mouseX, int mouseY, int button)
|
||||
public void mouseClicked(int mouseX, int mouseY, int button) throws IOException
|
||||
{
|
||||
super.mouseClicked(mouseX, mouseY, button);
|
||||
|
||||
|
||||
@@ -18,12 +18,11 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerSolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntitySolarGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiSolarGenerator extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -18,12 +18,11 @@ import mekanism.generators.client.gui.element.GuiTurbineTab.TurbineTab;
|
||||
import mekanism.generators.common.content.turbine.TurbineUpdateProtocol;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiTurbineStats extends GuiMekanism
|
||||
{
|
||||
|
||||
@@ -21,12 +21,11 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerWindGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiWindGenerator extends GuiMekanism
|
||||
{
|
||||
@@ -67,7 +66,7 @@ public class GuiWindGenerator extends GuiMekanism
|
||||
|
||||
int size = 44;
|
||||
|
||||
if(!tileEntity.getWorld().canBlockSeeTheSky(tileEntity.getPos().getX(), tileEntity.getPos().getY()+4, tileEntity.getPos().getZ()))
|
||||
if(!tileEntity.getWorld().canSeeSky(tileEntity.getPos().add(0, 4, 0)))
|
||||
{
|
||||
size += 9;
|
||||
fontRendererObj.drawString(EnumColor.DARK_RED + LangUtils.localize("gui.skyBlocked"), 51, size, 0x00CD00);
|
||||
|
||||
@@ -11,7 +11,6 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package mekanism.generators.client.gui.element;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.client.gui.element.GuiBoilerTab.BoilerTab;
|
||||
import mekanism.client.gui.element.GuiElement;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
@@ -12,9 +11,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiTurbineTab extends GuiElement
|
||||
|
||||
@@ -2,8 +2,8 @@ package mekanism.generators.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelAdvancedSolarGenerator extends ModelBase
|
||||
|
||||
@@ -5,11 +5,9 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@ package mekanism.generators.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
||||
public class ModelTurbine extends ModelBase
|
||||
{
|
||||
|
||||
@@ -4,11 +4,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelAdvancedSolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityAdvancedSolarGenerator;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -24,7 +21,7 @@ public class RenderAdvancedSolarGenerator extends TileEntitySpecialRenderer<Tile
|
||||
GlStateManager.translate((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "AdvancedSolarGenerator.png"));
|
||||
|
||||
switch(tileEntity.facing)
|
||||
switch(tileEntity.facing.ordinal())
|
||||
{
|
||||
case 2: GlStateManager.rotate(0, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GlStateManager.rotate(180, 0.0F, 1.0F, 0.0F); break;
|
||||
|
||||
@@ -10,16 +10,15 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelBioGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityBioGenerator;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBioGenerator extends TileEntitySpecialRenderer<TileEntityBioGenerator>
|
||||
{
|
||||
@@ -39,7 +38,7 @@ public class RenderBioGenerator extends TileEntitySpecialRenderer<TileEntityBioG
|
||||
MekanismRenderer.glowOn();
|
||||
GlStateManager.translate((float)x, (float)y, (float)z);
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
getDisplayList(EnumFacing.getFront(tileEntity.facing))[tileEntity.getScaledFuelLevel(stages-1)].render();
|
||||
getDisplayList(tileEntity.facing)[tileEntity.getScaledFuelLevel(stages-1)].render();
|
||||
MekanismRenderer.glowOff();
|
||||
|
||||
pop();
|
||||
@@ -49,7 +48,7 @@ public class RenderBioGenerator extends TileEntitySpecialRenderer<TileEntityBioG
|
||||
GlStateManager.translate((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "BioGenerator.png"));
|
||||
|
||||
switch(tileEntity.facing)
|
||||
switch(tileEntity.facing.ordinal())
|
||||
{
|
||||
case 2: GlStateManager.rotate(180, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GlStateManager.rotate(0, 0.0F, 1.0F, 0.0F); break;
|
||||
|
||||
@@ -4,11 +4,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelGasGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityGasGenerator;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -24,7 +21,7 @@ public class RenderGasGenerator extends TileEntitySpecialRenderer<TileEntityGasG
|
||||
GlStateManager.translate((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "GasGenerator.png"));
|
||||
|
||||
switch(tileEntity.facing)
|
||||
switch(tileEntity.facing.ordinal())
|
||||
{
|
||||
case 2: GlStateManager.rotate(90, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GlStateManager.rotate(270, 0.0F, 1.0F, 0.0F); break;
|
||||
|
||||
@@ -4,11 +4,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelHeatGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityHeatGenerator;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -24,7 +21,7 @@ public class RenderHeatGenerator extends TileEntitySpecialRenderer<TileEntityHea
|
||||
GlStateManager.translate((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "HeatGenerator.png"));
|
||||
|
||||
switch(tileEntity.facing)
|
||||
switch(tileEntity.facing.ordinal())
|
||||
{
|
||||
case 2: GlStateManager.rotate(180, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GlStateManager.rotate(0, 0.0F, 1.0F, 0.0F); break;
|
||||
@@ -33,7 +30,7 @@ public class RenderHeatGenerator extends TileEntitySpecialRenderer<TileEntityHea
|
||||
}
|
||||
|
||||
GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F);
|
||||
model.render(0.0625F, tileEntity.isActive, field_147501_a.field_147553_e);
|
||||
model.render(0.0625F, tileEntity.isActive, rendererDispatcher.renderEngine);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
@@ -11,20 +11,20 @@ import mekanism.client.render.tileentity.RenderDynamicTank.RenderData;
|
||||
import mekanism.common.content.tank.TankUpdateProtocol;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineCasing;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderIndustrialTurbine extends TileEntitySpecialRenderer
|
||||
{
|
||||
@@ -33,12 +33,12 @@ public class RenderIndustrialTurbine extends TileEntitySpecialRenderer
|
||||
private Fluid STEAM = FluidRegistry.getFluid("steam");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
{
|
||||
renderAModelAt((TileEntityTurbineCasing)tileEntity, x, y, z, partialTick);
|
||||
renderAModelAt((TileEntityTurbineCasing)tileEntity, x, y, z, partialTick, destroyStage);
|
||||
}
|
||||
|
||||
public void renderAModelAt(TileEntityTurbineCasing tileEntity, double x, double y, double z, float partialTick)
|
||||
public void renderAModelAt(TileEntityTurbineCasing tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
{
|
||||
if(tileEntity.clientHasStructure && tileEntity.isRendering && tileEntity.structure != null)
|
||||
{
|
||||
@@ -47,15 +47,15 @@ public class RenderIndustrialTurbine extends TileEntitySpecialRenderer
|
||||
|
||||
while(true)
|
||||
{
|
||||
coord = coord.getFromSide(ForgeDirection.DOWN);
|
||||
TileEntity tile = coord.getTileEntity(tileEntity.getWorldObj());
|
||||
coord = coord.offset(EnumFacing.DOWN);
|
||||
TileEntity tile = coord.getTileEntity(tileEntity.getWorld());
|
||||
|
||||
if(!(tile instanceof TileEntityTurbineRotor))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity(tile, partialTick);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity(tile, partialTick, destroyStage);
|
||||
}
|
||||
|
||||
RenderTurbineRotor.internalRender = false;
|
||||
@@ -80,7 +80,7 @@ public class RenderIndustrialTurbine extends TileEntitySpecialRenderer
|
||||
MekanismRenderer.glowOn(tileEntity.structure.fluidStored.getFluid().getLuminosity());
|
||||
MekanismRenderer.colorFluid(tileEntity.structure.fluidStored.getFluid());
|
||||
|
||||
DisplayInteger display = getListAndRender(data, tileEntity.getWorldObj());
|
||||
DisplayInteger display = getListAndRender(data, tileEntity.getWorld());
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, Math.min(1, ((float)tileEntity.structure.fluidStored.amount / (float)tileEntity.structure.getFluidCapacity())+MekanismRenderer.GAS_RENDER_BASE));
|
||||
display.render();
|
||||
|
||||
@@ -7,14 +7,13 @@ import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderReactor extends TileEntitySpecialRenderer<TileEntityReactorController>
|
||||
{
|
||||
|
||||
@@ -4,10 +4,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelSolarGenerator;
|
||||
import mekanism.generators.common.tile.TileEntitySolarGenerator;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderSolarGenerator extends TileEntitySpecialRenderer<TileEntitySolarGenerator>
|
||||
{
|
||||
|
||||
@@ -6,14 +6,14 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelTurbine;
|
||||
import mekanism.generators.common.content.turbine.SynchronizedTurbineData;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderTurbineRotor extends TileEntitySpecialRenderer
|
||||
{
|
||||
@@ -24,7 +24,7 @@ public class RenderTurbineRotor extends TileEntitySpecialRenderer
|
||||
private static final float BASE_SPEED = 512F;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
{
|
||||
renderAModelAt((TileEntityTurbineRotor)tileEntity, x, y, z, partialTick);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.client.model.ModelWindGenerator;
|
||||
import mekanism.generators.common.tile.TileEntityWindGenerator;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderWindGenerator extends TileEntitySpecialRenderer<TileEntityWindGenerator>
|
||||
{
|
||||
@@ -21,7 +19,7 @@ public class RenderWindGenerator extends TileEntitySpecialRenderer<TileEntityWin
|
||||
GlStateManager.translate((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "WindGenerator.png"));
|
||||
|
||||
switch(tileEntity.facing)
|
||||
switch(tileEntity.facing.ordinal())
|
||||
{
|
||||
case 2: GlStateManager.rotate(0, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GlStateManager.rotate(180, 0.0F, 1.0F, 0.0F); break;
|
||||
@@ -32,7 +30,7 @@ public class RenderWindGenerator extends TileEntitySpecialRenderer<TileEntityWin
|
||||
GlStateManager.rotate(180, 0F, 0F, 1F);
|
||||
|
||||
if(!Mekanism.proxy.isPaused() &&
|
||||
tileEntity.getWorld().canBlockSeeTheSky(tileEntity.getPos().getX(), tileEntity.getPos().getY()+4, tileEntity.getPos().getZ()))
|
||||
tileEntity.getWorld().canBlockSeeSky(tileEntity.getPos().add(0, 4, 0)))
|
||||
{
|
||||
tileEntity.angle = (tileEntity.angle+((tileEntity.getPos().getY()+4F)/256F)*8) % 360;
|
||||
}
|
||||
|
||||
@@ -3,15 +3,11 @@ package mekanism.generators.client.render.item;
|
||||
import mekanism.generators.client.GeneratorsClientProxy;
|
||||
import mekanism.generators.common.item.ItemBlockGenerator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import codechicken.lib.render.IItemRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GeneratorsItemRenderer implements IItemRenderer
|
||||
|
||||
@@ -106,7 +106,7 @@ public class FusionReactor implements IFusionReactor
|
||||
@Override
|
||||
public void simulate()
|
||||
{
|
||||
if(controller.getWorldObj().isRemote)
|
||||
if(controller.getWorld().isRemote)
|
||||
{
|
||||
lastPlasmaTemperature = plasmaTemperature;
|
||||
lastCaseTemperature = caseTemperature;
|
||||
@@ -324,8 +324,8 @@ public class FusionReactor implements IFusionReactor
|
||||
|
||||
public void kill()
|
||||
{
|
||||
AxisAlignedBB death_zone = AxisAlignedBB.getBoundingBox(controller.xCoord - 1, controller.yCoord - 3, controller.zCoord - 1 ,controller.xCoord + 2, controller.yCoord, controller.zCoord + 2);
|
||||
List<Entity> entitiesToDie = controller.getWorldObj().getEntitiesWithinAABB(Entity.class, death_zone);
|
||||
AxisAlignedBB death_zone = AxisAlignedBB.fromBounds(controller.getPos().getX() - 1, controller.getPos().getY() - 3, controller.getPos().getZ() - 1 ,controller.getPos().getX() + 2, controller.getPos().getY(), controller.getPos().getZ() + 2);
|
||||
List<Entity> entitiesToDie = controller.getWorld().getEntitiesWithinAABB(Entity.class, death_zone);
|
||||
|
||||
for(Entity entity : entitiesToDie)
|
||||
{
|
||||
@@ -347,9 +347,9 @@ public class FusionReactor implements IFusionReactor
|
||||
formed = false;
|
||||
burning = burning && keepBurning;
|
||||
|
||||
if(!controller.getWorldObj().isRemote)
|
||||
if(!controller.getWorld().isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendToDimension(new TileEntityMessage(Coord4D.get(controller), controller.getNetworkedData(new ArrayList())), controller.getWorldObj().provider.getDimensionId());
|
||||
Mekanism.packetHandler.sendToDimension(new TileEntityMessage(Coord4D.get(controller), controller.getNetworkedData(new ArrayList())), controller.getWorld().provider.getDimensionId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,9 +385,9 @@ public class FusionReactor implements IFusionReactor
|
||||
|
||||
formed = true;
|
||||
|
||||
if(!controller.getWorldObj().isRemote)
|
||||
if(!controller.getWorld().isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendToDimension(new TileEntityMessage(Coord4D.get(controller), controller.getNetworkedData(new ArrayList())), controller.getWorldObj().provider.getDimensionId());
|
||||
Mekanism.packetHandler.sendToDimension(new TileEntityMessage(Coord4D.get(controller), controller.getNetworkedData(new ArrayList())), controller.getWorld().provider.getDimensionId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ public class FusionReactor implements IFusionReactor
|
||||
|
||||
for(int[] coords : positions)
|
||||
{
|
||||
TileEntity tile = centre.clone().translate(coords[0], coords[1], coords[2]).getTileEntity(controller.getWorldObj());
|
||||
TileEntity tile = centre.clone().translate(coords[0], coords[1], coords[2]).getTileEntity(controller.getWorld());
|
||||
|
||||
if(tile instanceof IReactorBlock && ((IReactorBlock)tile).isFrame())
|
||||
{
|
||||
@@ -431,7 +431,7 @@ public class FusionReactor implements IFusionReactor
|
||||
|
||||
for(int[] coords : positions)
|
||||
{
|
||||
TileEntity tile = centre.clone().translate(coords[0], coords[1], coords[2]).getTileEntity(controller.getWorldObj());
|
||||
TileEntity tile = centre.clone().translate(coords[0], coords[1], coords[2]).getTileEntity(controller.getWorld());
|
||||
|
||||
if(tile instanceof ILaserReceptor && !(coords[1] == 0 && (coords[0] == 0 || coords[2] == 0)))
|
||||
{
|
||||
@@ -469,9 +469,10 @@ public class FusionReactor implements IFusionReactor
|
||||
{
|
||||
for(int z = -1; x <= 1; x++)
|
||||
{
|
||||
Block tile = centre.clone().translate(x, y, z).getBlock(controller.getWorldObj());
|
||||
Coord4D trans = centre.translate(x, y, z);
|
||||
Block tile = trans.getBlock(controller.getWorld());
|
||||
|
||||
if(!tile.isAir(controller.getWorldObj(), x, y, z))
|
||||
if(!tile.isAir(controller.getWorld(), trans.getPos()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
@ObjectHolder("MekanismGenerators")
|
||||
public class GeneratorsBlocks
|
||||
{
|
||||
public static final Block Generator = new BlockGenerator().setBlockName("Generator");
|
||||
public static final Block Reactor = new BlockReactor().setBlockName("Reactor");
|
||||
public static final Block ReactorGlass = new BlockReactor().setBlockName("ReactorGlass");
|
||||
public static final Block Generator = new BlockGenerator().setUnlocalizedName("Generator");
|
||||
public static final Block Reactor = new BlockReactor().setUnlocalizedName("Reactor");
|
||||
public static final Block ReactorGlass = new BlockReactor().setUnlocalizedName("ReactorGlass");
|
||||
|
||||
public static void register()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ import mekanism.generators.common.item.ItemHohlraum;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
@@ -16,9 +17,9 @@ public class GeneratorsItems
|
||||
public static final ItemHohlraum Hohlraum = (ItemHohlraum)new ItemHohlraum().setUnlocalizedName("Hohlraum");
|
||||
public static final Item TurbineBlade = new ItemMekanism() {
|
||||
@Override
|
||||
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player)
|
||||
public boolean doesSneakBypassUse(World world, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
return world.getTileEntity(x, y, z) instanceof TileEntityTurbineRotor;
|
||||
return world.getTileEntity(pos) instanceof TileEntityTurbineRotor;
|
||||
}
|
||||
}.setUnlocalizedName("TurbineBlade");
|
||||
|
||||
|
||||
@@ -26,13 +26,10 @@ import mekanism.generators.common.content.turbine.SynchronizedTurbineData;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import buildcraft.api.fuels.BuildcraftFuelRegistry;
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
@@ -42,6 +39,9 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import buildcraft.api.fuels.BuildcraftFuelRegistry;
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
|
||||
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "9.0.0", dependencies = "required-after:Mekanism", guiFactory = "mekanism.generators.client.gui.GeneratorsGuiFactory")
|
||||
public class MekanismGenerators implements IModule
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Random;
|
||||
import mekanism.api.MekanismConfig.client;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.CTMData;
|
||||
import mekanism.client.render.ctm.CTMData;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBlockCTM;
|
||||
@@ -43,7 +43,7 @@ import mekanism.generators.common.tile.turbine.TileEntityTurbineVent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -53,15 +53,17 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import codechicken.lib.render.TextureUtils.IIconRegister;
|
||||
|
||||
/**
|
||||
* Block class for handling multiple generator block IDs.
|
||||
@@ -132,11 +134,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||
public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
setBlockBoundsBasedOnState(world, pos);
|
||||
|
||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||
return super.getCollisionBoundingBox(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,15 +165,6 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
return BASE_ICON;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
return getIcon(side, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
|
||||
@@ -182,7 +175,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
|
||||
if(tileEntity instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)tileEntity).update();
|
||||
((IMultiblock)tileEntity).doUpdate();
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityBasicBlock)
|
||||
@@ -193,9 +186,9 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack itemstack)
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entityliving, ItemStack itemstack)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
|
||||
int side = MathHelper.floor_double((double)(entityliving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int height = Math.round(entityliving.rotationPitch);
|
||||
@@ -234,16 +227,16 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
|
||||
if(!world.isRemote && tileEntity instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)tileEntity).update();
|
||||
((IMultiblock)tileEntity).doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||
public int getLightValue(IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
if(client.enableAmbientLighting)
|
||||
{
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
if(tileEntity instanceof IActiveState && !(tileEntity instanceof TileEntitySolarGenerator))
|
||||
{
|
||||
@@ -265,11 +258,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPlayerRelativeBlockHardness(EntityPlayer player, World world, int x, int y, int z)
|
||||
public float getPlayerRelativeBlockHardness(EntityPlayer player, World world, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
return SecurityUtils.canAccess(player, tile) ? super.getPlayerRelativeBlockHardness(player, world, x, y, z) : 0.0F;
|
||||
return SecurityUtils.canAccess(player, tile) ? super.getPlayerRelativeBlockHardness(player, world, pos) : 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -284,26 +277,26 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random random)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
|
||||
if(MekanismUtils.isActive(world, x, y, z))
|
||||
if(MekanismUtils.isActive(world, pos))
|
||||
{
|
||||
float xRandom = (float)x + 0.5F;
|
||||
float yRandom = (float)y + 0.0F + random.nextFloat() * 6.0F / 16.0F;
|
||||
float zRandom = (float)z + 0.5F;
|
||||
float xRandom = (float)pos.getX() + 0.5F;
|
||||
float yRandom = (float)pos.getY() + 0.0F + random.nextFloat() * 6.0F / 16.0F;
|
||||
float zRandom = (float)pos.getZ() + 0.5F;
|
||||
float iRandom = 0.52F;
|
||||
float jRandom = random.nextFloat() * 0.6F - 0.3F;
|
||||
|
||||
if(tileEntity.facing == 4)
|
||||
if(tileEntity.facing == EnumFacing.WEST)
|
||||
{
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
case HEAT_GENERATOR:
|
||||
(??) world.spawnParticle("smoke", (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
(??) world.spawnParticle("flame", (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case BIO_GENERATOR:
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x+.25, y+.2, z+.5, 0.0D, 0.0D, 0.0D);
|
||||
@@ -312,7 +305,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(tileEntity.facing == 5)
|
||||
else if(tileEntity.facing == EnumFacing.EAST)
|
||||
{
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
@@ -327,7 +320,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(tileEntity.facing == 2)
|
||||
else if(tileEntity.facing == EnumFacing.NORTH)
|
||||
{
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
@@ -342,7 +335,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(tileEntity.facing == 3)
|
||||
else if(tileEntity.facing == EnumFacing.SOUTH)
|
||||
{
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
@@ -361,16 +354,16 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z)
|
||||
public boolean canPlaceBlockAt(World world, BlockPos pos)
|
||||
{
|
||||
//This method doesn't actually seem to be used in MC code...
|
||||
if(world.getBlockMetadata(x, y, z) == GeneratorType.ADVANCED_SOLAR_GENERATOR.meta)
|
||||
{
|
||||
boolean canPlace = super.canPlaceBlockAt(world, x, y, z);
|
||||
boolean canPlace = super.canPlaceBlockAt(world, pos);
|
||||
|
||||
boolean nonAir = false;
|
||||
nonAir |= world.isAirBlock(x, y, z);
|
||||
nonAir |= world.isAirBlock(x, y+1, x);
|
||||
nonAir |= world.isAirBlock(pos);
|
||||
nonAir |= world.isAirBlock(pos.add(0, 1, 0));
|
||||
|
||||
for(int xPos=-1;xPos<=1;xPos++)
|
||||
{
|
||||
@@ -384,11 +377,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
else if(world.getBlockMetadata(x, y, z) == GeneratorType.WIND_GENERATOR.meta)
|
||||
{
|
||||
boolean canPlace = super.canPlaceBlockAt(world, x, y, z);
|
||||
boolean canPlace = super.canPlaceBlockAt(world, pos);
|
||||
|
||||
boolean nonAir = false;
|
||||
|
||||
for(int yPos = y+1; yPos <= y+4; yPos++)
|
||||
for(int yPos = pos.getY()+1; yPos <= pos.getY()+4; yPos++)
|
||||
{
|
||||
nonAir |= world.isAirBlock(x, yPos, z);
|
||||
}
|
||||
@@ -396,13 +389,13 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
return (!nonAir) && canPlace;
|
||||
}
|
||||
|
||||
return super.canPlaceBlockAt(world, x, y, z);
|
||||
return super.canPlaceBlockAt(world, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta)
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
|
||||
if(!world.isRemote && tileEntity instanceof TileEntityTurbineRotor)
|
||||
{
|
||||
@@ -415,7 +408,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, new ItemStack(GeneratorsItems.TurbineBlade, amount));
|
||||
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, new ItemStack(GeneratorsItems.TurbineBlade, amount));
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
@@ -426,18 +419,18 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
((IBoundingBlock)tileEntity).onBreak();
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float playerX, float playerY, float playerZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing side, float playerX, float playerY, float playerZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(entityplayer.getCurrentEquippedItem() != null)
|
||||
@@ -585,7 +578,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
public boolean rendersAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -642,7 +635,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest)
|
||||
public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -651,19 +644,19 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z, player));
|
||||
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, getPickBlock(null, world, pos, player));
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
|
||||
return world.setBlockToAir(x, y, z);
|
||||
return world.setBlockToAir(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
ItemStack itemStack = new ItemStack(GeneratorsBlocks.Generator, 1, world.getBlockMetadata(x, y, z));
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
ItemStack itemStack = new ItemStack(GeneratorsBlocks.Generator, 1, world.getBlockMetadata(pos));
|
||||
|
||||
if(itemStack.stackTagCompound == null)
|
||||
{
|
||||
@@ -717,11 +710,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public ItemStack dismantleBlock(World world, int x, int y, int z, boolean returnBlock)
|
||||
public ItemStack dismantleBlock(World world, BlockPos pos, boolean returnBlock)
|
||||
{
|
||||
ItemStack itemStack = getPickBlock(null, world, x, y, z, null);
|
||||
ItemStack itemStack = getPickBlock(null, world, pos, null);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.setBlockToAir(pos);
|
||||
|
||||
if(!returnBlock)
|
||||
{
|
||||
@@ -730,7 +723,7 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);
|
||||
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, itemStack);
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
}
|
||||
@@ -739,9 +732,9 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, EnumFacing side)
|
||||
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
int metadata = world.getBlockMetadata(pos);
|
||||
|
||||
if(metadata != GeneratorType.SOLAR_GENERATOR.meta &&
|
||||
metadata != GeneratorType.ADVANCED_SOLAR_GENERATOR.meta &&
|
||||
@@ -850,9 +843,9 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations(World world, int x, int y, int z)
|
||||
public EnumFacing[] getValidRotations(World world, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
EnumFacing[] valid = new EnumFacing[6];
|
||||
|
||||
if(tile instanceof TileEntityBasicBlock)
|
||||
@@ -872,9 +865,9 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World world, int x, int y, int z, EnumFacing axis)
|
||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(tile instanceof TileEntityBasicBlock)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.CTMData;
|
||||
import mekanism.client.render.ctm.CTMData;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IBlockCTM;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
@@ -23,20 +23,19 @@ import mekanism.generators.common.tile.reactor.TileEntityReactorPort;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import codechicken.lib.render.TextureUtils.IIconRegister;
|
||||
|
||||
public class BlockReactor extends BlockContainer implements IBlockCTM
|
||||
{
|
||||
|
||||
@@ -30,9 +30,9 @@ public class TurbineFluidTank implements IFluidTank
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill)
|
||||
{
|
||||
if(turbine.structure != null && !turbine.getWorldObj().isRemote)
|
||||
if(turbine.structure != null && !turbine.getWorld().isRemote)
|
||||
{
|
||||
if(resource == null || resource.getFluidID() <= 0)
|
||||
if(resource == null || resource.getFluid() == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class TurbineFluidTank implements IFluidTank
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(turbine.structure.fluidStored == null || turbine.structure.fluidStored.getFluidID() <= 0)
|
||||
if(turbine.structure.fluidStored == null || turbine.structure.fluidStored.getFluid() == null)
|
||||
{
|
||||
if(resource.amount <= getCapacity())
|
||||
{
|
||||
@@ -110,9 +110,9 @@ public class TurbineFluidTank implements IFluidTank
|
||||
@Override
|
||||
public FluidStack drain(int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(turbine.structure != null && !turbine.getWorldObj().isRemote)
|
||||
if(turbine.structure != null && !turbine.getWorld().isRemote)
|
||||
{
|
||||
if(turbine.structure.fluidStored == null || turbine.structure.fluidStored.getFluidID() <= 0)
|
||||
if(turbine.structure.fluidStored == null || turbine.structure.fluidStored.getFluid() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
+16
-15
@@ -20,7 +20,8 @@ import mekanism.generators.common.tile.turbine.TileEntityTurbineRotor;
|
||||
import mekanism.generators.common.tile.turbine.TileEntityTurbineVent;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineData>
|
||||
{
|
||||
@@ -35,8 +36,8 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
@Override
|
||||
protected boolean isValidFrame(int x, int y, int z)
|
||||
{
|
||||
return pointer.getWorldObj().getBlock(x, y, z) == GeneratorsBlocks.Generator &&
|
||||
GeneratorType.getFromMetadata(pointer.getWorldObj().getBlockMetadata(x, y, z)) == GeneratorType.TURBINE_CASING;
|
||||
return pointer.getWorld().getBlock(x, y, z) == GeneratorsBlocks.Generator &&
|
||||
GeneratorType.getFromMetadata(pointer.getWorld().getBlockMetadata(x, y, z)) == GeneratorType.TURBINE_CASING;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,8 +47,8 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntity tile = pointer.getWorldObj().getTileEntity(x, y, z);
|
||||
|
||||
TileEntity tile = pointer.getWorld().getTileEntity(x, y, z);
|
||||
|
||||
return tile instanceof TileEntityTurbineRotor || tile instanceof TileEntityRotationalComplex ||
|
||||
tile instanceof TileEntityPressureDisperser || tile instanceof TileEntityElectromagneticCoil;
|
||||
@@ -74,7 +75,7 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
//Scan for complex
|
||||
for(Coord4D coord : innerNodes)
|
||||
{
|
||||
TileEntity tile = coord.getTileEntity(pointer.getWorldObj());
|
||||
TileEntity tile = coord.getTileEntity(pointer.getWorld());
|
||||
|
||||
if(tile instanceof TileEntityRotationalComplex)
|
||||
{
|
||||
@@ -122,7 +123,7 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
{
|
||||
if(!(x == centerX && z == centerZ))
|
||||
{
|
||||
TileEntity tile = pointer.getWorldObj().getTileEntity(x, complex.yCoord, z);
|
||||
TileEntity tile = pointer.getWorld().getTileEntity(new BlockPos(x, complex.yCoord, z));
|
||||
|
||||
if(!(tile instanceof TileEntityPressureDisperser))
|
||||
{
|
||||
@@ -145,7 +146,7 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
//Make sure a complete line of turbine rotors exist from the complex to the multiblock's base
|
||||
for(int y = complex.yCoord-1; y > structure.minLocation.yCoord; y--)
|
||||
{
|
||||
TileEntity tile = pointer.getWorldObj().getTileEntity(centerX, y, centerZ);
|
||||
TileEntity tile = pointer.getWorld().getTileEntity(new BlockPos(centerX, y, centerZ));
|
||||
|
||||
if(!(tile instanceof TileEntityTurbineRotor))
|
||||
{
|
||||
@@ -153,7 +154,7 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
}
|
||||
|
||||
turbineHeight++;
|
||||
turbines.remove(new Coord4D(centerX, y, centerZ, pointer.getWorldObj().provider.dimensionId));
|
||||
turbines.remove(new Coord4D(centerX, y, centerZ, pointer.getWorld().provider.getDimensionId()));
|
||||
}
|
||||
|
||||
//If any turbines were not processed, they're in the wrong place
|
||||
@@ -162,15 +163,15 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
return false;
|
||||
}
|
||||
|
||||
Coord4D startCoord = complex.getFromSide(ForgeDirection.UP);
|
||||
Coord4D startCoord = complex.offset(EnumFacing.UP);
|
||||
|
||||
if(startCoord.getTileEntity(pointer.getWorldObj()) instanceof TileEntityElectromagneticCoil)
|
||||
if(startCoord.getTileEntity(pointer.getWorld()) instanceof TileEntityElectromagneticCoil)
|
||||
{
|
||||
structure.coils = new NodeCounter(new NodeChecker() {
|
||||
@Override
|
||||
public boolean isValid(Coord4D coord)
|
||||
{
|
||||
return coord.getTileEntity(pointer.getWorldObj()) instanceof TileEntityElectromagneticCoil;
|
||||
return coord.getTileEntity(pointer.getWorld()) instanceof TileEntityElectromagneticCoil;
|
||||
}
|
||||
}).calculate(startCoord);
|
||||
}
|
||||
@@ -180,8 +181,8 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
return false;
|
||||
}
|
||||
|
||||
Coord4D turbineCoord = complex.getFromSide(ForgeDirection.DOWN);
|
||||
TileEntity turbineTile = turbineCoord.getTileEntity(pointer.getWorldObj());
|
||||
Coord4D turbineCoord = complex.offset(EnumFacing.DOWN);
|
||||
TileEntity turbineTile = turbineCoord.getTileEntity(pointer.getWorld());
|
||||
|
||||
if(turbineTile instanceof TileEntityTurbineRotor)
|
||||
{
|
||||
@@ -190,7 +191,7 @@ public class TurbineUpdateProtocol extends UpdateProtocol<SynchronizedTurbineDat
|
||||
|
||||
for(Coord4D coord : structure.locations)
|
||||
{
|
||||
if(coord.getTileEntity(pointer.getWorldObj()) instanceof TileEntityTurbineVent)
|
||||
if(coord.getTileEntity(pointer.getWorld()) instanceof TileEntityTurbineVent)
|
||||
{
|
||||
if(coord.yCoord >= complex.yCoord)
|
||||
{
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class ContainerBioGenerator extends Container
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class ContainerGasGenerator extends Container
|
||||
public void onContainerClosed(EntityPlayer entityplayer)
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class ContainerHeatGenerator extends Container
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class ContainerNeutronCapture extends Container
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class ContainerReactorController extends Container
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class ContainerSolarGenerator extends Container
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class ContainerWindGenerator extends Container
|
||||
{
|
||||
super.onContainerClosed(entityplayer);
|
||||
|
||||
tileEntity.closeInventory();
|
||||
tileEntity.closeInventory(entityplayer);
|
||||
tileEntity.close(entityplayer);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mekanism.generators.common.item;
|
||||
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.api.item.ISpecialElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
@@ -14,13 +17,14 @@ import mekanism.common.integration.IC2ItemManager;
|
||||
import mekanism.common.security.ISecurityItem;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.security.ISecurityTile.SecurityMode;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityElectricBlock;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.SecurityUtils;
|
||||
import mekanism.generators.common.block.BlockGenerator.GeneratorType;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -28,7 +32,8 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -37,10 +42,7 @@ import net.minecraftforge.fml.common.Optional.InterfaceList;
|
||||
import net.minecraftforge.fml.common.Optional.Method;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.api.item.ISpecialElectricItem;
|
||||
|
||||
/**
|
||||
* Item class for handling multiple generator block IDs.
|
||||
@@ -94,12 +96,6 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int i)
|
||||
{
|
||||
return metaBlock.getIcon(2, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
@@ -128,7 +124,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
{
|
||||
if(hasSecurity(itemstack))
|
||||
{
|
||||
list.add(SecurityUtils.getOwnerDisplay(entityplayer.getCommandSenderName(), getOwner(itemstack)));
|
||||
list.add(SecurityUtils.getOwnerDisplay(entityplayer.getName(), getOwner(itemstack)));
|
||||
list.add(EnumColor.GREY + LangUtils.localize("gui.security") + ": " + SecurityUtils.getSecurityDisplay(itemstack, Side.CLIENT));
|
||||
|
||||
if(SecurityUtils.isOverridden(itemstack, Side.CLIENT))
|
||||
@@ -165,14 +161,14 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState state)
|
||||
{
|
||||
boolean place = true;
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
|
||||
if(stack.getItemDamage() == GeneratorType.ADVANCED_SOLAR_GENERATOR.meta)
|
||||
{
|
||||
if(!(block.isReplaceable(world, x, y, z) && world.isAirBlock(x, y+1, z)))
|
||||
if(!(block.isReplaceable(world, pos) && world.isAirBlock(pos.add(0, 1, 0))))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -192,7 +188,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
}
|
||||
else if(stack.getItemDamage() == GeneratorType.WIND_GENERATOR.meta)
|
||||
{
|
||||
if(!block.isReplaceable(world, x, y, z))
|
||||
if(!block.isReplaceable(world, pos))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -208,9 +204,9 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
}
|
||||
}
|
||||
|
||||
if(place && super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
|
||||
if(place && super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, state))
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z);
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
{
|
||||
@@ -224,7 +220,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
|
||||
if(getOwner(stack) == null)
|
||||
{
|
||||
security.getSecurity().setOwner(player.getCommandSenderName());
|
||||
security.getSecurity().setOwner(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,7 +335,7 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
@Override
|
||||
public void setFluidStack(FluidStack fluidStack, Object... data)
|
||||
{
|
||||
if(fluidStack == null || fluidStack.amount == 0 || fluidStack.getFluidID() == 0)
|
||||
if(fluidStack == null || fluidStack.amount == 0 || fluidStack.getFluid() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -491,9 +487,9 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
@Override
|
||||
public String getOwner(ItemStack stack)
|
||||
{
|
||||
if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("owner"))
|
||||
if(stack.getTagCompound() != null && stack.getTagCompound().hasKey("owner"))
|
||||
{
|
||||
return stack.stackTagCompound.getString("owner");
|
||||
return stack.getTagCompound().getString("owner");
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -502,40 +498,40 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
||||
@Override
|
||||
public void setOwner(ItemStack stack, String owner)
|
||||
{
|
||||
if(stack.stackTagCompound == null)
|
||||
if(stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(owner == null || owner.isEmpty())
|
||||
{
|
||||
stack.stackTagCompound.removeTag("owner");
|
||||
stack.getTagCompound().removeTag("owner");
|
||||
return;
|
||||
}
|
||||
|
||||
stack.stackTagCompound.setString("owner", owner);
|
||||
stack.getTagCompound().setString("owner", owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SecurityMode getSecurity(ItemStack stack)
|
||||
{
|
||||
if(stack.stackTagCompound == null)
|
||||
if(stack.getTagCompound() == null)
|
||||
{
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
return SecurityMode.values()[stack.stackTagCompound.getInteger("security")];
|
||||
return SecurityMode.values()[stack.getTagCompound().getInteger("security")];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSecurity(ItemStack stack, SecurityMode mode)
|
||||
{
|
||||
if(stack.stackTagCompound == null)
|
||||
if(stack.getTagCompound() == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
stack.stackTagCompound.setInteger("security", mode.ordinal());
|
||||
stack.getTagCompound().setInteger("security", mode.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,13 +10,11 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ItemBlockReactor extends ItemBlock
|
||||
{
|
||||
public Block metaBlock;
|
||||
|
||||
@@ -20,19 +20,20 @@ public class TileEntityAdvancedSolarGenerator extends TileEntitySolarGenerator i
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getOutputtingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.getFront(facing));
|
||||
return EnumSet.of(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlace()
|
||||
{
|
||||
MekanismUtils.makeBoundingBlock(worldObj, new Coord4D(xCoord, yCoord+1, zCoord), Coord4D.get(this));
|
||||
Coord4D current = Coord4D.get(this);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, getPos().add(0, 1, 0), current);
|
||||
|
||||
for(int x = -1; x <= 1; x++)
|
||||
{
|
||||
for(int z = -1; z <= 1; z++)
|
||||
{
|
||||
MekanismUtils.makeBoundingBlock(worldObj, new Coord4D(xCoord+x, yCoord+2, zCoord+z), Coord4D.get(this));
|
||||
MekanismUtils.makeBoundingBlock(worldObj, getPos().add(x, 2, z), current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,18 +41,18 @@ public class TileEntityAdvancedSolarGenerator extends TileEntitySolarGenerator i
|
||||
@Override
|
||||
public void onBreak()
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord+1, zCoord);
|
||||
worldObj.setBlockToAir(getPos().add(0, 1, 0));
|
||||
|
||||
for(int x = -1; x <= 1; x++)
|
||||
{
|
||||
for(int z = -1; z <= 1; z++)
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord+x, yCoord+2, zCoord+z);
|
||||
worldObj.setBlockToAir(getPos().add(x, 2, z));
|
||||
}
|
||||
}
|
||||
|
||||
invalidate();
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -184,9 +184,9 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IFlui
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return EnumFacing.getFront(side) == MekanismUtils.getRight(facing) ? new int[] {1} : new int[] {0};
|
||||
return side == MekanismUtils.getRight(facing) ? new int[] {1} : new int[] {0};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,7 +243,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IFlui
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
if(FluidRegistry.isFluidRegistered("bioethanol") && from != EnumFacing.getFront(facing))
|
||||
if(FluidRegistry.isFluidRegistered("bioethanol") && from != facing)
|
||||
{
|
||||
if(resource.getFluid() == FluidRegistry.getFluid("bioethanol"))
|
||||
{
|
||||
|
||||
@@ -149,7 +149,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -180,9 +180,9 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return EnumFacing.getFront(side) == MekanismUtils.getRight(facing) ? new int[] {1} : new int[] {0};
|
||||
return side == MekanismUtils.getRight(facing) ? new int[] {1} : new int[] {0};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -324,7 +324,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return FuelHandler.getFuel(type) != null && side != EnumFacing.getFront(facing);
|
||||
return FuelHandler.getFuel(type) != null && side != facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -348,7 +348,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return side != EnumFacing.getFront(facing);
|
||||
return side != facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class TileEntityGenerator extends TileEntityNoisyElectricBlock i
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public abstract class TileEntityGenerator extends TileEntityNoisyElectricBlock i
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getOutputtingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.getFront(facing));
|
||||
return EnumSet.of(facing);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,7 +157,7 @@ public abstract class TileEntityGenerator extends TileEntityNoisyElectricBlock i
|
||||
{
|
||||
updateDelay = general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -73,7 +74,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
}
|
||||
else if(fluid != null)
|
||||
{
|
||||
if(fluid != null && fluid.getFluidID() == FluidRegistry.LAVA.getID())
|
||||
if(fluid != null && fluid.getFluid() == FluidRegistry.LAVA)
|
||||
{
|
||||
if(lavaTank.getFluid() == null || lavaTank.getFluid().amount+fluid.amount <= lavaTank.getCapacity())
|
||||
{
|
||||
@@ -152,7 +153,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
{
|
||||
if(slotID == 0)
|
||||
{
|
||||
return getFuel(itemstack) > 0 || (FluidContainerRegistry.getFluidForFilledItem(itemstack) != null && FluidContainerRegistry.getFluidForFilledItem(itemstack).getFluidID() == FluidRegistry.LAVA.getID());
|
||||
return getFuel(itemstack) > 0 || (FluidContainerRegistry.getFluidForFilledItem(itemstack) != null && FluidContainerRegistry.getFluidForFilledItem(itemstack).getFluid() == FluidRegistry.LAVA);
|
||||
}
|
||||
else if(slotID == 1)
|
||||
{
|
||||
@@ -191,7 +192,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -214,7 +215,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
{
|
||||
Coord4D coord = Coord4D.get(this).offset(side);
|
||||
|
||||
if(isLava(coord.xCoord, coord.yCoord, coord.zCoord))
|
||||
if(isLava(coord.getPos()))
|
||||
{
|
||||
lavaBoost++;
|
||||
}
|
||||
@@ -228,9 +229,9 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
return (generators.heatGenerationLava * lavaBoost) + netherBoost;
|
||||
}
|
||||
|
||||
private boolean isLava(int x, int y, int z)
|
||||
private boolean isLava(BlockPos pos)
|
||||
{
|
||||
return worldObj.getBlock(x, y, z) == Blocks.lava;
|
||||
return worldObj.getBlockState(pos).getBlock() == Blocks.lava;
|
||||
}
|
||||
|
||||
public int getFuel(ItemStack itemstack)
|
||||
@@ -244,9 +245,9 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return EnumFacing.getFront(side) == MekanismUtils.getRight(facing) ? new int[] {1} : new int[] {0};
|
||||
return side == MekanismUtils.getRight(facing) ? new int[] {1} : new int[] {0};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -334,7 +335,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
@Override
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
if(resource.getFluidID() == FluidRegistry.LAVA.getID() && from != EnumFacing.getFront(facing))
|
||||
if(resource.getFluid() == FluidRegistry.LAVA && from != facing)
|
||||
{
|
||||
return lavaTank.fill(resource, doFill);
|
||||
}
|
||||
@@ -357,7 +358,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
return fluid == FluidRegistry.LAVA && from != EnumFacing.getFront(facing);
|
||||
return fluid == FluidRegistry.LAVA && from != facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -369,7 +370,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from)
|
||||
{
|
||||
if(from == EnumFacing.getFront(facing))
|
||||
if(from == facing)
|
||||
{
|
||||
return PipeUtils.EMPTY;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import micdoodle8.mods.galacticraft.api.world.ISolarLevel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.biome.BiomeGenDesert;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.biome.BiomeGenDesert;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
|
||||
{
|
||||
ChargeUtils.charge(0, this);
|
||||
|
||||
if(worldObj.isDaytime() && ((!worldObj.isRaining() && !worldObj.isThundering()) || isDesert()) && !worldObj.provider.hasNoSky && worldObj.canBlockSeeTheSky(xCoord, yCoord+1, zCoord))
|
||||
if(worldObj.isDaytime() && ((!worldObj.isRaining() && !worldObj.isThundering()) || isDesert()) && !worldObj.provider.getHasNoSky() && worldObj.canSeeSky(getPos().add(0, 4, 0)))
|
||||
{
|
||||
seesSun = true;
|
||||
}
|
||||
@@ -84,11 +84,11 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
|
||||
|
||||
public boolean isDesert()
|
||||
{
|
||||
return worldObj.provider.getBiomeGenForCoords(xCoord, zCoord).getBiomeClass() == BiomeGenDesert.class;
|
||||
return worldObj.provider.getBiomeGenForCoords(getPos()).getBiomeClass() == BiomeGenDesert.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 0)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ public class TileEntityWindGenerator extends TileEntityGenerator implements IBou
|
||||
/** Determines the current output multiplier, taking sky visibility and height into account. **/
|
||||
public float getMultiplier()
|
||||
{
|
||||
if(worldObj.canBlockSeeTheSky(xCoord, yCoord+4, zCoord))
|
||||
if(worldObj.canSeeSky(getPos().add(0, 4, 0)))
|
||||
{
|
||||
final float minY = (float)generators.windGenerationMinY;
|
||||
final float maxY = (float)generators.windGenerationMaxY;
|
||||
@@ -54,7 +54,7 @@ public class TileEntityWindGenerator extends TileEntityGenerator implements IBou
|
||||
final float slope = (maxG - minG) / (maxY - minY);
|
||||
final float intercept = minG - slope * minY;
|
||||
|
||||
final float clampedY = Math.min(maxY, Math.max(minY, (float)(yCoord+4)));
|
||||
final float clampedY = Math.min(maxY, Math.max(minY, (float)(getPos().getY()+4)));
|
||||
final float toGen = slope * clampedY + intercept;
|
||||
|
||||
return toGen / minG;
|
||||
@@ -108,22 +108,22 @@ public class TileEntityWindGenerator extends TileEntityGenerator implements IBou
|
||||
@Override
|
||||
public void onPlace()
|
||||
{
|
||||
Coord4D pos = Coord4D.get(this);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(EnumFacing.UP, 1), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(EnumFacing.UP, 2), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(EnumFacing.UP, 3), pos);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, pos.offset(EnumFacing.UP, 4), pos);
|
||||
Coord4D current = Coord4D.get(this);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, getPos().offset(EnumFacing.UP, 1), current);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, getPos().offset(EnumFacing.UP, 2), current);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, getPos().offset(EnumFacing.UP, 3), current);
|
||||
MekanismUtils.makeBoundingBlock(worldObj, getPos().offset(EnumFacing.UP, 4), current);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBreak()
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord+1, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord+2, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord+3, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord+4, zCoord);
|
||||
worldObj.setBlockToAir(getPos().add(0, 1, 0));
|
||||
worldObj.setBlockToAir(getPos().add(0, 2, 0));
|
||||
worldObj.setBlockToAir(getPos().add(0, 3, 0));
|
||||
worldObj.setBlockToAir(getPos().add(0, 4, 0));
|
||||
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -6,7 +6,6 @@ import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismConfig.client;
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
@@ -25,6 +24,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -263,7 +263,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
||||
if(getReactor() == null)
|
||||
{
|
||||
setReactor(new FusionReactor(this));
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
((FusionReactor)getReactor()).formed = true;
|
||||
@@ -282,7 +282,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
||||
else if(getReactor() != null)
|
||||
{
|
||||
setReactor(null);
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
||||
{
|
||||
if(box == null)
|
||||
{
|
||||
box = AxisAlignedBB.getBoundingBox(xCoord-1, yCoord-3, zCoord-1, xCoord+2, yCoord, zCoord+2);
|
||||
box = AxisAlignedBB.fromBounds(getPos().getX()-1, getPos().getY()-3, getPos().getZ()-1, getPos().getX()+2, getPos().getY(), getPos().getZ()+2);
|
||||
}
|
||||
|
||||
return box;
|
||||
@@ -372,9 +372,9 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Pos3D getSoundPosition()
|
||||
public Vec3 getSoundPosition()
|
||||
{
|
||||
return new Pos3D(xCoord+0.5, yCoord+0.5, zCoord+0.5);
|
||||
return new Vec3(getPos()).addVector(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class TileEntityReactorLogicAdapter extends TileEntityReactorBlock implem
|
||||
|
||||
if(outputting != prevOutputting)
|
||||
{
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
worldObj.notifyBlocksOfNeighborChange(getPos(), getBlockType());
|
||||
}
|
||||
|
||||
prevOutputting = outputting;
|
||||
|
||||
@@ -215,10 +215,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getOutputtingSides()
|
||||
{
|
||||
EnumSet set = EnumSet.allOf(EnumFacing.class);
|
||||
set.remove(EnumFacing.null);
|
||||
|
||||
return set;
|
||||
return EnumSet.allOf(EnumFacing.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -333,7 +330,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return getReactor() != null && getReactor().isFormed() ? new int[] {0} : InventoryUtils.EMPTY;
|
||||
}
|
||||
@@ -352,7 +349,7 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(getReactor() != null && getReactor().isFormed() && itemstack.getItem() instanceof ItemHohlraum)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ import mekanism.api.MekanismConfig.generators;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.multiblock.MultiblockCache;
|
||||
import mekanism.common.multiblock.MultiblockManager;
|
||||
import mekanism.common.multiblock.UpdateProtocol;
|
||||
@@ -107,7 +108,7 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTu
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName()
|
||||
public String getName()
|
||||
{
|
||||
return LangUtils.localize("gui.industrialTurbine");
|
||||
}
|
||||
@@ -118,7 +119,7 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTu
|
||||
if(!player.isSneaking() && structure != null)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
player.openGui(MekanismGenerators.instance, 6, worldObj, xCoord, yCoord, zCoord);
|
||||
player.openGui(MekanismGenerators.instance, 6, worldObj, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -178,7 +179,7 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTu
|
||||
if(structure.fluidStored != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(structure.fluidStored.getFluidID());
|
||||
data.add(structure.fluidStored.getFluid().getName());
|
||||
data.add(structure.fluidStored.amount);
|
||||
}
|
||||
else {
|
||||
@@ -214,7 +215,7 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTu
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
structure.fluidStored = new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt());
|
||||
structure.fluidStored = new FluidStack(FluidRegistry.getFluid(PacketHandler.readString(dataStream)), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.fluidStored = null;
|
||||
|
||||
@@ -17,16 +17,16 @@ import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.PipeUtils;
|
||||
import mekanism.generators.common.content.turbine.TurbineFluidTank;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.Optional.InterfaceList;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
import net.minecraftforge.fml.common.Optional.InterfaceList;
|
||||
import net.minecraftforge.fml.common.Optional.Method;
|
||||
|
||||
@InterfaceList({
|
||||
@Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"),
|
||||
@@ -66,16 +66,15 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getOutputtingSides()
|
||||
public EnumSet<EnumFacing> getOutputtingSides()
|
||||
{
|
||||
if(structure != null)
|
||||
{
|
||||
EnumSet set = EnumSet.allOf(ForgeDirection.class);
|
||||
set.remove(ForgeDirection.UNKNOWN);
|
||||
EnumSet set = EnumSet.allOf(EnumFacing.class);
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
if(structure.locations.contains(Coord4D.get(this).getFromSide(side)))
|
||||
if(structure.locations.contains(Coord4D.get(this).offset(side)))
|
||||
{
|
||||
set.remove(side);
|
||||
}
|
||||
@@ -84,19 +83,13 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
return set;
|
||||
}
|
||||
|
||||
return EnumSet.noneOf(ForgeDirection.class);
|
||||
return EnumSet.noneOf(EnumFacing.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getConsumingSides()
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
return EnumSet.noneOf(ForgeDirection.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return true;
|
||||
return EnumSet.noneOf(EnumFacing.class);
|
||||
}
|
||||
|
||||
@Method(modid = "IC2")
|
||||
@@ -104,7 +97,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos());
|
||||
|
||||
if(registered != this)
|
||||
{
|
||||
@@ -126,7 +119,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos());
|
||||
|
||||
if(registered instanceof IEnergyTile)
|
||||
{
|
||||
@@ -175,13 +168,13 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
|
||||
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
|
||||
public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate)
|
||||
{
|
||||
if(getOutputtingSides().contains(from))
|
||||
{
|
||||
@@ -199,19 +192,19 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from)
|
||||
public boolean canConnectEnergy(EnumFacing from)
|
||||
{
|
||||
return structure != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from)
|
||||
public int getEnergyStored(EnumFacing from)
|
||||
{
|
||||
return (int)Math.round(getEnergy()*general.TO_TE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from)
|
||||
public int getMaxEnergyStored(EnumFacing from)
|
||||
{
|
||||
return (int)Math.round(getMaxEnergy()*general.TO_TE);
|
||||
}
|
||||
@@ -246,27 +239,27 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
|
||||
@Override
|
||||
@Method(modid = "IC2")
|
||||
public boolean isTeleporterCompatible(ForgeDirection side)
|
||||
public boolean isTeleporterCompatible(EnumFacing side)
|
||||
{
|
||||
return canOutputTo(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOutputTo(ForgeDirection side)
|
||||
public boolean canOutputTo(EnumFacing side)
|
||||
{
|
||||
return getOutputtingSides().contains(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "IC2")
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = "IC2")
|
||||
public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction)
|
||||
public boolean emitsEnergyTo(TileEntity receiver, EnumFacing direction)
|
||||
{
|
||||
return getOutputtingSides().contains(direction) && receiver instanceof IEnergyConductor;
|
||||
}
|
||||
@@ -307,7 +300,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveEnergy(ForgeDirection side)
|
||||
public boolean canReceiveEnergy(EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -321,7 +314,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
|
||||
@Override
|
||||
@Method(modid = "IC2")
|
||||
public double injectEnergy(ForgeDirection direction, double amount, double voltage)
|
||||
public double injectEnergy(EnumFacing direction, double amount, double voltage)
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
@@ -338,19 +331,19 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public double transferEnergyToAcceptor(ForgeDirection side, double amount)
|
||||
public double transferEnergyToAcceptor(EnumFacing side, double amount)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from)
|
||||
{
|
||||
return ((!worldObj.isRemote && structure != null) || (worldObj.isRemote && clientHasStructure)) ? new FluidTankInfo[] {fluidTank.getInfo()} : PipeUtils.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
public int fill(EnumFacing from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
int filled = fluidTank.fill(resource, doFill);
|
||||
|
||||
@@ -363,7 +356,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if(structure != null && structure.fluidStored != null)
|
||||
{
|
||||
@@ -377,7 +370,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
||||
public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(structure != null)
|
||||
{
|
||||
@@ -388,7 +381,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
public boolean canFill(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
if(fluid == FluidRegistry.getFluid("steam"))
|
||||
{
|
||||
@@ -399,7 +392,7 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
return ((!worldObj.isRemote && structure != null) || (worldObj.isRemote && clientHasStructure));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user