Integrate security into more machines
This commit is contained in:
parent
f904c8b80c
commit
a18da2ad27
29 changed files with 385 additions and 61 deletions
|
@ -18,6 +18,7 @@ import mekanism.client.gui.element.GuiProgress;
|
|||
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||
import mekanism.client.gui.element.GuiSecurityTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
|
@ -82,6 +83,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
|
|||
}
|
||||
}, GuiGauge.Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 100, 18));
|
||||
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 164, 15));
|
||||
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png")));
|
||||
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 25, 34));
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiElectrolyticSeparator.png"), 58, 51));
|
||||
|
|
|
@ -3,6 +3,7 @@ package mekanism.client.gui;
|
|||
import mekanism.client.gui.element.GuiContainerEditMode;
|
||||
import mekanism.client.gui.element.GuiFluidGauge;
|
||||
import mekanism.client.gui.element.GuiFluidGauge.IFluidInfoHandler;
|
||||
import mekanism.client.gui.element.GuiSecurityTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
|
@ -29,6 +30,7 @@ public class GuiFluidTank extends GuiMekanism
|
|||
super(tentity, new ContainerFluidTank(inventory, tentity));
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiContainerEditMode(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler()
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -18,19 +18,16 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class GuiPersonalChest extends GuiMekanism
|
||||
{
|
||||
public TileEntityPersonalChest tileEntity;
|
||||
public IInventory itemInventory;
|
||||
public boolean isBlock;
|
||||
|
||||
public GuiPersonalChest(InventoryPlayer inventory, TileEntityPersonalChest tentity)
|
||||
{
|
||||
super(tentity, new ContainerPersonalChest(inventory, tentity, null, true));
|
||||
|
||||
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPersonalChest.png")));
|
||||
|
||||
xSize+=26;
|
||||
ySize+=64;
|
||||
tileEntity = tentity;
|
||||
isBlock = true;
|
||||
|
||||
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPersonalChest.png")));
|
||||
}
|
||||
|
||||
public GuiPersonalChest(InventoryPlayer inventory, IInventory inv)
|
||||
|
@ -39,8 +36,8 @@ public class GuiPersonalChest extends GuiMekanism
|
|||
|
||||
xSize+=26;
|
||||
ySize+=64;
|
||||
itemInventory = inv;
|
||||
isBlock = false;
|
||||
|
||||
guiElements.add(new GuiSecurityTab(this, MekanismUtils.getResource(ResourceType.GUI, "GuiPersonalChest.png")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,5 +63,7 @@ public class GuiPersonalChest extends GuiMekanism
|
|||
|
||||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,12 +7,15 @@ import mekanism.client.gui.IGuiWrapper;
|
|||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketSecurityMode.SecurityModeMessage;
|
||||
import mekanism.common.security.ISecurityItem;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.security.ISecurityTile.SecurityMode;
|
||||
import mekanism.common.security.SecurityFrequency;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.common.util.SecurityUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
|
@ -22,7 +25,9 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class GuiSecurityTab extends GuiElement
|
||||
{
|
||||
TileEntity tileEntity;
|
||||
public boolean isItem;
|
||||
|
||||
public TileEntity tileEntity;
|
||||
|
||||
public GuiSecurityTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def)
|
||||
{
|
||||
|
@ -31,6 +36,13 @@ public class GuiSecurityTab extends GuiElement
|
|||
tileEntity = tile;
|
||||
}
|
||||
|
||||
public GuiSecurityTab(IGuiWrapper gui, ResourceLocation def)
|
||||
{
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiSecurityTab.png"), gui, def);
|
||||
|
||||
isItem = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||
{
|
||||
|
@ -44,18 +56,18 @@ public class GuiSecurityTab extends GuiElement
|
|||
|
||||
guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 32, 0, 0, 26, 26);
|
||||
|
||||
ISecurityTile tile = (ISecurityTile)tileEntity;
|
||||
SecurityMode mode = tile.getSecurity().getMode();
|
||||
SecurityMode mode = getSecurity();
|
||||
SecurityFrequency freq = getFrequency();
|
||||
|
||||
if(tile.getSecurity().getFrequency() != null && tile.getSecurity().getFrequency().override)
|
||||
if(freq != null && freq.override)
|
||||
{
|
||||
mode = tile.getSecurity().getFrequency().securityMode;
|
||||
mode = freq.securityMode;
|
||||
}
|
||||
|
||||
int renderX = 26 + (18*mode.ordinal());
|
||||
|
||||
if(tile.getSecurity().getOwner() != null && tile.getSecurity().getOwner().equals(mc.thePlayer.getCommandSenderName()) &&
|
||||
(tile.getSecurity().getFrequency() == null || !tile.getSecurity().getFrequency().override))
|
||||
if(getOwner() != null && getOwner().equals(mc.thePlayer.getCommandSenderName()) &&
|
||||
(getFrequency() == null || !getFrequency().override))
|
||||
{
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 36 && yAxis <= 54)
|
||||
{
|
||||
|
@ -77,15 +89,14 @@ public class GuiSecurityTab extends GuiElement
|
|||
{
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
|
||||
ISecurityTile control = (ISecurityTile)tileEntity;
|
||||
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 36 && yAxis <= 54)
|
||||
{
|
||||
String securityText = EnumColor.GREY + LangUtils.localize("gui.security") + ": " + SecurityUtils.getSecurityDisplay((TileEntity)control);
|
||||
String ownerText = SecurityUtils.getOwnerDisplay(mc.thePlayer.getCommandSenderName(), control.getSecurity().getOwner());
|
||||
String securityDisplay = isItem ? SecurityUtils.getSecurityDisplay(getItem()) : SecurityUtils.getSecurityDisplay(tileEntity);
|
||||
String securityText = EnumColor.GREY + LangUtils.localize("gui.security") + ": " + securityDisplay;
|
||||
String ownerText = SecurityUtils.getOwnerDisplay(mc.thePlayer.getCommandSenderName(), getOwner());
|
||||
String overrideText = EnumColor.RED + "(" + LangUtils.localize("gui.overridden") + ")";
|
||||
|
||||
if(SecurityUtils.isOverridden((TileEntity)control))
|
||||
if(isItem ? SecurityUtils.isOverridden(getItem()) : SecurityUtils.isOverridden(tileEntity))
|
||||
{
|
||||
displayTooltips(ListUtils.asList(securityText, ownerText, overrideText), xAxis, yAxis);
|
||||
}
|
||||
|
@ -96,6 +107,62 @@ public class GuiSecurityTab extends GuiElement
|
|||
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
private SecurityFrequency getFrequency()
|
||||
{
|
||||
if(isItem)
|
||||
{
|
||||
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
return null;
|
||||
}
|
||||
|
||||
return SecurityUtils.getFrequency(getOwner());
|
||||
}
|
||||
else {
|
||||
return ((ISecurityTile)tileEntity).getSecurity().getFrequency();
|
||||
}
|
||||
}
|
||||
|
||||
private SecurityMode getSecurity()
|
||||
{
|
||||
if(isItem)
|
||||
{
|
||||
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
return ((ISecurityItem)getItem().getItem()).getSecurity(getItem());
|
||||
}
|
||||
else {
|
||||
return ((ISecurityTile)tileEntity).getSecurity().getMode();
|
||||
}
|
||||
}
|
||||
|
||||
private String getOwner()
|
||||
{
|
||||
if(isItem)
|
||||
{
|
||||
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
return null;
|
||||
}
|
||||
|
||||
return ((ISecurityItem)getItem().getItem()).getOwner(getItem());
|
||||
}
|
||||
else {
|
||||
return ((ISecurityTile)tileEntity).getSecurity().getOwner();
|
||||
}
|
||||
}
|
||||
|
||||
private ItemStack getItem()
|
||||
{
|
||||
return mc.thePlayer.getCurrentEquippedItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preMouseClicked(int xAxis, int yAxis, int button) {}
|
||||
|
@ -103,19 +170,24 @@ public class GuiSecurityTab extends GuiElement
|
|||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button)
|
||||
{
|
||||
ISecurityTile control = (ISecurityTile)tileEntity;
|
||||
|
||||
if(button == 0)
|
||||
{
|
||||
if(control.getSecurity().getOwner() != null && mc.thePlayer.getCommandSenderName().equals(control.getSecurity().getOwner()))
|
||||
if(getOwner() != null && mc.thePlayer.getCommandSenderName().equals(getOwner()))
|
||||
{
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 36 && yAxis <= 54)
|
||||
{
|
||||
SecurityMode current = control.getSecurity().getMode();
|
||||
SecurityMode current = getSecurity();
|
||||
int ordinalToSet = current.ordinal() < (SecurityMode.values().length-1) ? current.ordinal()+1 : 0;
|
||||
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
Mekanism.packetHandler.sendToServer(new SecurityModeMessage(Coord4D.get(tileEntity), SecurityMode.values()[ordinalToSet]));
|
||||
|
||||
if(isItem)
|
||||
{
|
||||
Mekanism.packetHandler.sendToServer(new SecurityModeMessage(SecurityMode.values()[ordinalToSet]));
|
||||
}
|
||||
else {
|
||||
Mekanism.packetHandler.sendToServer(new SecurityModeMessage(Coord4D.get(tileEntity), SecurityMode.values()[ordinalToSet]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -526,6 +526,9 @@ public class Mekanism
|
|||
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismItems.CraftingFormula), new Object[] {
|
||||
Items.paper, MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapelessMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 1, 9), new Object[] {
|
||||
|
||||
}));
|
||||
|
||||
//Energy Cube recipes
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), new Object[] {
|
||||
|
|
|
@ -6,6 +6,7 @@ import mekanism.api.IConfigCardAccess.ISpecialConfigData;
|
|||
import mekanism.api.energy.IStrictEnergyAcceptor;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
|
@ -15,7 +16,7 @@ import cpw.mods.fml.common.Optional.InterfaceList;
|
|||
@InterfaceList({
|
||||
@Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"),
|
||||
})
|
||||
public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyHandler, IComputerIntegration, ISpecialConfigData
|
||||
public interface IAdvancedBoundingBlock extends IBoundingBlock, ISidedInventory, IEnergySink, IStrictEnergyAcceptor, IStrictEnergyStorage, IEnergyHandler, IComputerIntegration, ISpecialConfigData, ISecurityTile
|
||||
{
|
||||
public int[] getBoundSlots(Coord4D location, int side);
|
||||
|
||||
|
|
|
@ -74,6 +74,17 @@ public class BlockBounding extends Block
|
|||
world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).onNeighborBlockChange(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, this);
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
|
||||
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).getBlockHardness(world, x, y, z);
|
||||
} catch(Exception e) {
|
||||
return blockHardness;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random)
|
||||
|
|
|
@ -454,6 +454,11 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
if(getOwner(itemstack) == null)
|
||||
{
|
||||
setOwner(itemstack, entityplayer.getCommandSenderName());
|
||||
}
|
||||
|
||||
if(SecurityUtils.canAccess(entityplayer, itemstack))
|
||||
{
|
||||
InventoryPersonalChest inventory = new InventoryPersonalChest(entityplayer);
|
||||
|
@ -543,10 +548,10 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
return itemstack;
|
||||
}
|
||||
}
|
||||
else {
|
||||
SecurityUtils.displayNoAccess(entityplayer);
|
||||
}
|
||||
}
|
||||
else {
|
||||
SecurityUtils.displayNoAccess(entityplayer);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
@ -952,7 +957,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
{
|
||||
MachineType type = MachineType.get(stack);
|
||||
|
||||
if(type != MachineType.LASER)
|
||||
if(type != MachineType.LASER && type != MachineType.CHARGEPAD)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,9 +4,11 @@ import io.netty.buffer.ByteBuf;
|
|||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.network.PacketSecurityMode.SecurityModeMessage;
|
||||
import mekanism.common.security.ISecurityItem;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.security.ISecurityTile.SecurityMode;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
|
@ -18,15 +20,27 @@ public class PacketSecurityMode implements IMessageHandler<SecurityModeMessage,
|
|||
public IMessage onMessage(SecurityModeMessage message, MessageContext context)
|
||||
{
|
||||
EntityPlayer player = PacketHandler.getPlayer(context);
|
||||
TileEntity tileEntity = message.coord4D.getTileEntity(player.worldObj);
|
||||
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
if(message.packetType == SecurityPacketType.BLOCK)
|
||||
{
|
||||
String owner = ((ISecurityTile)tileEntity).getSecurity().getOwner();
|
||||
TileEntity tileEntity = message.coord4D.getTileEntity(player.worldObj);
|
||||
|
||||
if(owner != null && player.getCommandSenderName().equals(owner))
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
{
|
||||
((ISecurityTile)tileEntity).getSecurity().setMode(message.value);
|
||||
String owner = ((ISecurityTile)tileEntity).getSecurity().getOwner();
|
||||
|
||||
if(owner != null && player.getCommandSenderName().equals(owner))
|
||||
{
|
||||
((ISecurityTile)tileEntity).getSecurity().setMode(message.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if(stack.getItem() instanceof ISecurityItem)
|
||||
{
|
||||
((ISecurityItem)stack.getItem()).setSecurity(stack, message.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +49,7 @@ public class PacketSecurityMode implements IMessageHandler<SecurityModeMessage,
|
|||
|
||||
public static class SecurityModeMessage implements IMessage
|
||||
{
|
||||
public SecurityPacketType packetType;
|
||||
public Coord4D coord4D;
|
||||
public SecurityMode value;
|
||||
|
||||
|
@ -42,17 +57,31 @@ public class PacketSecurityMode implements IMessageHandler<SecurityModeMessage,
|
|||
|
||||
public SecurityModeMessage(Coord4D coord, SecurityMode control)
|
||||
{
|
||||
packetType = SecurityPacketType.BLOCK;
|
||||
|
||||
coord4D = coord;
|
||||
value = control;
|
||||
}
|
||||
|
||||
public SecurityModeMessage(SecurityMode control)
|
||||
{
|
||||
packetType = SecurityPacketType.ITEM;
|
||||
|
||||
value = control;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(coord4D.xCoord);
|
||||
dataStream.writeInt(coord4D.yCoord);
|
||||
dataStream.writeInt(coord4D.zCoord);
|
||||
dataStream.writeInt(coord4D.dimensionId);
|
||||
dataStream.writeInt(packetType.ordinal());
|
||||
|
||||
if(packetType == SecurityPacketType.BLOCK)
|
||||
{
|
||||
dataStream.writeInt(coord4D.xCoord);
|
||||
dataStream.writeInt(coord4D.yCoord);
|
||||
dataStream.writeInt(coord4D.zCoord);
|
||||
dataStream.writeInt(coord4D.dimensionId);
|
||||
}
|
||||
|
||||
dataStream.writeInt(value.ordinal());
|
||||
}
|
||||
|
@ -60,8 +89,20 @@ public class PacketSecurityMode implements IMessageHandler<SecurityModeMessage,
|
|||
@Override
|
||||
public void fromBytes(ByteBuf dataStream)
|
||||
{
|
||||
coord4D = Coord4D.read(dataStream);
|
||||
packetType = SecurityPacketType.values()[dataStream.readInt()];
|
||||
|
||||
if(packetType == SecurityPacketType.BLOCK)
|
||||
{
|
||||
coord4D = Coord4D.read(dataStream);
|
||||
}
|
||||
|
||||
value = SecurityMode.values()[dataStream.readInt()];
|
||||
}
|
||||
}
|
||||
|
||||
public static enum SecurityPacketType
|
||||
{
|
||||
BLOCK,
|
||||
ITEM
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,15 +21,17 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.inputs.MachineInput;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.outputs.MachineOutput;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>, OUTPUT extends MachineOutput<OUTPUT>, RECIPE extends MachineRecipe<INPUT, OUTPUT, RECIPE>> extends TileEntityNoisyElectricBlock implements IElectricMachine<INPUT, OUTPUT, RECIPE>, IComputerIntegration, ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess
|
||||
public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>, OUTPUT extends MachineOutput<OUTPUT>, RECIPE extends MachineRecipe<INPUT, OUTPUT, RECIPE>> extends TileEntityNoisyElectricBlock implements IElectricMachine<INPUT, OUTPUT, RECIPE>, IComputerIntegration, ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess, ISecurityTile
|
||||
{
|
||||
/** How much energy this machine uses per tick, un-upgraded. */
|
||||
public double BASE_ENERGY_PER_TICK;
|
||||
|
@ -69,6 +71,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
|||
public TileComponentUpgrade upgradeComponent;
|
||||
public TileComponentEjector ejectorComponent;
|
||||
public TileComponentConfig configComponent;
|
||||
public TileComponentSecurity securityComponent;
|
||||
|
||||
/**
|
||||
* The foundation of all machines - a simple tile entity with a facing, active state, initialized state, sound effect, and animated texture.
|
||||
|
@ -89,6 +92,8 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
|||
ticksRequired = baseTicksRequired;
|
||||
guiLocation = location;
|
||||
isActive = false;
|
||||
|
||||
securityComponent = new TileComponentSecurity(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -293,4 +298,10 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
|||
{
|
||||
return ejectorComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,10 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.GasInput;
|
||||
import mekanism.common.recipe.machines.CrystallizerRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -41,7 +43,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISideConfiguration, IUpgradeTile, ISustainedData, ITankManager, IConfigCardAccess
|
||||
public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISideConfiguration, IUpgradeTile, ISustainedData, ITankManager, IConfigCardAccess, ISecurityTile
|
||||
{
|
||||
public static final int MAX_GAS = 10000;
|
||||
|
||||
|
@ -77,7 +79,8 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
|||
public TileComponentUpgrade upgradeComponent;
|
||||
public TileComponentEjector ejectorComponent;
|
||||
public TileComponentConfig configComponent;
|
||||
|
||||
public TileComponentSecurity securityComponent;
|
||||
|
||||
public TileEntityChemicalCrystallizer()
|
||||
{
|
||||
super("machine.crystallizer", "ChemicalCrystallizer", MachineType.CHEMICAL_CRYSTALLIZER.baseEnergy);
|
||||
|
@ -104,6 +107,8 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
|||
|
||||
ejectorComponent = new TileComponentEjector(this);
|
||||
ejectorComponent.setOutputData(TransmissionType.ITEM, configComponent.getOutputs(TransmissionType.ITEM).get(2));
|
||||
|
||||
securityComponent = new TileComponentSecurity(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -488,4 +493,10 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
|||
{
|
||||
return new Object[] {inputTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,9 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.DissolutionRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentAdvancedUpgrade;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -37,7 +39,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData, ITankManager
|
||||
public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData, ITankManager, ISecurityTile
|
||||
{
|
||||
public GasTank injectTank = new GasTank(MAX_GAS);
|
||||
public GasTank outputTank = new GasTank(MAX_GAS);
|
||||
|
@ -73,6 +75,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
|||
public DissolutionRecipe cachedRecipe;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentAdvancedUpgrade(this, 4);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
|
@ -503,4 +506,10 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
|||
{
|
||||
return new Object[] {injectTank, outputTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ChemicalPairInput;
|
||||
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -37,7 +39,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler, ITankManager
|
||||
public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler, ITankManager, ISecurityTile
|
||||
{
|
||||
public GasTank leftTank = new GasTank(MAX_GAS);
|
||||
public GasTank rightTank = new GasTank(MAX_GAS);
|
||||
|
@ -64,6 +66,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
|||
public double clientEnergyUsed;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 4);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
/** This machine's current RedstoneControl type. */
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
@ -556,4 +559,10 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
|||
{
|
||||
return new Object[] {leftTank, rightTank, centerTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.OxidationRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -34,7 +36,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData, ITankManager
|
||||
public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData, ITankManager, ISecurityTile
|
||||
{
|
||||
public GasTank gasTank = new GasTank(MAX_GAS);
|
||||
|
||||
|
@ -65,6 +67,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
|||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 3);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityChemicalOxidizer()
|
||||
{
|
||||
|
@ -402,4 +405,10 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
|||
{
|
||||
return new Object[] {gasTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.GasInput;
|
||||
import mekanism.common.recipe.machines.WasherRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.FluidContainerUtils;
|
||||
|
@ -48,7 +50,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IFluidHandler, IUpgradeTile, ISustainedData, IUpgradeInfoHandler, ITankManager
|
||||
public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IFluidHandler, IUpgradeTile, ISustainedData, IUpgradeInfoHandler, ITankManager, ISecurityTile
|
||||
{
|
||||
public FluidTank fluidTank = new FluidTank(MAX_FLUID);
|
||||
public GasTank inputTank = new GasTank(MAX_GAS);
|
||||
|
@ -78,6 +80,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
|||
public double clientEnergyUsed;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 4);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
/** This machine's current RedstoneControl type. */
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
@ -605,4 +608,10 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
|||
{
|
||||
return new Object[] {fluidTank, inputTank, outputTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ import mekanism.common.content.transporter.TransporterManager;
|
|||
import mekanism.common.inventory.container.ContainerFilter;
|
||||
import mekanism.common.inventory.container.ContainerNull;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -115,6 +116,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 28);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityDigitalMiner()
|
||||
{
|
||||
|
@ -1489,4 +1491,10 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ import mekanism.common.base.ISustainedTank;
|
|||
import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.FluidContainerUtils;
|
||||
|
@ -45,7 +47,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntityElectricPump extends TileEntityElectricBlock implements IFluidHandler, ISustainedTank, IConfigurable, IRedstoneControl, IUpgradeTile, ITankManager, IComputerIntegration
|
||||
public class TileEntityElectricPump extends TileEntityElectricBlock implements IFluidHandler, ISustainedTank, IConfigurable, IRedstoneControl, IUpgradeTile, ITankManager, IComputerIntegration, ISecurityTile
|
||||
{
|
||||
/** This pump's tank */
|
||||
public FluidTank fluidTank = new FluidTank(10000);
|
||||
|
@ -75,6 +77,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 3);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityElectricPump()
|
||||
{
|
||||
|
@ -580,6 +583,12 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recalculateUpgradables(Upgrade upgrade)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,9 @@ import mekanism.common.recipe.RecipeHandler.Recipe;
|
|||
import mekanism.common.recipe.inputs.FluidInput;
|
||||
import mekanism.common.recipe.machines.SeparatorRecipe;
|
||||
import mekanism.common.recipe.outputs.ChemicalPairOutput;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.TileEntityGasTank.GasMode;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.FluidContainerUtils;
|
||||
|
@ -51,7 +53,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IComputerIntegration, ITubeConnection, ISustainedData, IGasHandler, IUpgradeTile, IUpgradeInfoHandler, ITankManager, IRedstoneControl, IActiveState
|
||||
public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IComputerIntegration, ITubeConnection, ISustainedData, IGasHandler, IUpgradeTile, IUpgradeInfoHandler, ITankManager, IRedstoneControl, IActiveState, ISecurityTile
|
||||
{
|
||||
/** This separator's water slot. */
|
||||
public FluidTank fluidTank = new FluidTank(24000);
|
||||
|
@ -94,6 +96,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
public double clientEnergyUsed;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 4);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
/** This machine's current RedstoneControl type. */
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
@ -818,6 +821,12 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
return upgradeComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recalculateUpgradables(Upgrade upgrade)
|
||||
{
|
||||
|
|
|
@ -46,8 +46,10 @@ import mekanism.common.recipe.inputs.InfusionInput;
|
|||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.machines.BasicMachineRecipe;
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -60,7 +62,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntityFactory extends TileEntityNoisyElectricBlock implements IComputerIntegration, ISideConfiguration, IUpgradeTile, IRedstoneControl, IGasHandler, ITubeConnection, ISpecialConfigData
|
||||
public class TileEntityFactory extends TileEntityNoisyElectricBlock implements IComputerIntegration, ISideConfiguration, IUpgradeTile, IRedstoneControl, IGasHandler, ITubeConnection, ISpecialConfigData, ISecurityTile
|
||||
{
|
||||
/** This Factory's tier. */
|
||||
public FactoryTier tier;
|
||||
|
@ -130,6 +132,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
|||
public TileComponentUpgrade upgradeComponent;
|
||||
public TileComponentEjector ejectorComponent;
|
||||
public TileComponentConfig configComponent;
|
||||
public TileComponentSecurity securityComponent;
|
||||
|
||||
public TileEntityFactory()
|
||||
{
|
||||
|
@ -157,6 +160,8 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
|||
|
||||
ejectorComponent = new TileComponentEjector(this);
|
||||
ejectorComponent.setOutputData(TransmissionType.ITEM, configComponent.getOutputs(TransmissionType.ITEM).get(2));
|
||||
|
||||
securityComponent = new TileComponentSecurity(this);
|
||||
}
|
||||
|
||||
public TileEntityFactory(FactoryTier type, MachineType machine)
|
||||
|
@ -1193,4 +1198,10 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
|||
{
|
||||
return tier.getBaseTier().getLocalizedName() + " " + recipeType.getLocalizedName() + " " + super.getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
|
@ -15,6 +15,8 @@ import mekanism.common.base.IFluidContainerManager;
|
|||
import mekanism.common.base.ISustainedTank;
|
||||
import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.FluidContainerUtils;
|
||||
import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -34,7 +36,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntityFluidTank extends TileEntityContainerBlock implements IActiveState, IConfigurable, IFluidHandler, ISustainedTank, IFluidContainerManager, ITankManager
|
||||
public class TileEntityFluidTank extends TileEntityContainerBlock implements IActiveState, IConfigurable, IFluidHandler, ISustainedTank, IFluidContainerManager, ITankManager, ISecurityTile
|
||||
{
|
||||
public boolean isActive;
|
||||
|
||||
|
@ -57,6 +59,8 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
|||
|
||||
public boolean needsPacket;
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityFluidTank()
|
||||
{
|
||||
super("FluidTank");
|
||||
|
@ -575,4 +579,10 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
|
|||
{
|
||||
return new Object[] {fluidTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,10 @@ import mekanism.common.base.IUpgradeTile;
|
|||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.content.assemblicator.RecipeFormula;
|
||||
import mekanism.common.item.ItemCraftingFormula;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
|
@ -28,7 +30,7 @@ import net.minecraft.inventory.InventoryCrafting;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock implements ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess
|
||||
public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock implements ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess, ISecurityTile
|
||||
{
|
||||
public InventoryCrafting dummyInv = MekanismUtils.getDummyCraftingInv();
|
||||
|
||||
|
@ -55,6 +57,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
|||
public TileComponentUpgrade upgradeComponent;
|
||||
public TileComponentEjector ejectorComponent;
|
||||
public TileComponentConfig configComponent;
|
||||
public TileComponentSecurity securityComponent;
|
||||
|
||||
public TileEntityFormulaicAssemblicator()
|
||||
{
|
||||
|
@ -77,6 +80,8 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
|||
|
||||
ejectorComponent = new TileComponentEjector(this);
|
||||
ejectorComponent.setOutputData(TransmissionType.ITEM, configComponent.getOutputs(TransmissionType.ITEM).get(2));
|
||||
|
||||
securityComponent = new TileComponentSecurity(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -663,6 +668,12 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
|
|||
return ejectorComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recalculateUpgradables(Upgrade upgrade)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,8 @@ import mekanism.common.Mekanism;
|
|||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -23,7 +25,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLaserAmplifier extends TileEntityContainerBlock implements ILaserReceptor, IRedstoneControl, ICableOutputter, IStrictEnergyStorage, IComputerIntegration
|
||||
public class TileEntityLaserAmplifier extends TileEntityContainerBlock implements ILaserReceptor, IRedstoneControl, ICableOutputter, IStrictEnergyStorage, IComputerIntegration, ISecurityTile
|
||||
{
|
||||
public static final double MAX_ENERGY = 5E9;
|
||||
public double collectedEnergy = 0;
|
||||
|
@ -43,6 +45,8 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
|||
|
||||
public boolean emittingRedstone;
|
||||
public boolean entityDetection;
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityLaserAmplifier()
|
||||
{
|
||||
|
@ -332,4 +336,10 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
|||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ import mekanism.common.LaserManager;
|
|||
import mekanism.common.LaserManager.LaserInfo;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -21,7 +23,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLaserTractorBeam extends TileEntityContainerBlock implements ILaserReceptor
|
||||
public class TileEntityLaserTractorBeam extends TileEntityContainerBlock implements ILaserReceptor, ISecurityTile
|
||||
{
|
||||
public static final double MAX_ENERGY = 5E9;
|
||||
public double collectedEnergy = 0;
|
||||
|
@ -33,6 +35,8 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
|||
public double diggingProgress;
|
||||
|
||||
public static int[] availableSlotIDs = InventoryUtils.getIntRange(0, 26);
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityLaserTractorBeam()
|
||||
{
|
||||
|
@ -217,4 +221,10 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ import mekanism.common.content.transporter.TItemStackFilter;
|
|||
import mekanism.common.content.transporter.TransporterFilter;
|
||||
import mekanism.common.content.transporter.TransporterManager;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.TransporterUtils;
|
||||
|
@ -37,7 +39,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLogisticalSorter extends TileEntityElectricBlock implements IRedstoneControl, IActiveState, ISpecialConfigData, ISustainedData
|
||||
public class TileEntityLogisticalSorter extends TileEntityElectricBlock implements IRedstoneControl, IActiveState, ISpecialConfigData, ISustainedData, ISecurityTile
|
||||
{
|
||||
public HashList<TransporterFilter> filters = new HashList<TransporterFilter>();
|
||||
|
||||
|
@ -60,6 +62,8 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
|||
public boolean clientActive;
|
||||
|
||||
public final double ENERGY_PER_ITEM = 5;
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityLogisticalSorter()
|
||||
{
|
||||
|
@ -587,6 +591,12 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getConfigurationData(NBTTagCompound nbtTags)
|
||||
|
|
|
@ -17,6 +17,8 @@ import mekanism.common.base.IRedstoneControl;
|
|||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -27,7 +29,7 @@ import net.minecraft.nbt.NBTTagList;
|
|||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TileEntityOredictionificator extends TileEntityContainerBlock implements IRedstoneControl, ISpecialConfigData, ISustainedData
|
||||
public class TileEntityOredictionificator extends TileEntityContainerBlock implements IRedstoneControl, ISpecialConfigData, ISustainedData, ISecurityTile
|
||||
{
|
||||
public static final int MAX_LENGTH = 24;
|
||||
|
||||
|
@ -39,6 +41,8 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
|
||||
public boolean didProcess;
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntityOredictionificator()
|
||||
{
|
||||
super(MachineType.OREDICTIONIFICATOR.name);
|
||||
|
@ -410,6 +414,12 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
|
||||
public static class OredictionificatorFilter
|
||||
{
|
||||
public String filter;
|
||||
|
|
|
@ -25,6 +25,8 @@ import mekanism.common.base.ITankManager;
|
|||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.FluidContainerUtils;
|
||||
|
@ -44,7 +46,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedData, IFluidHandler, IGasHandler, ITubeConnection, IRedstoneControl, IUpgradeTile, IUpgradeInfoHandler, ITankManager
|
||||
public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedData, IFluidHandler, IGasHandler, ITubeConnection, IRedstoneControl, IUpgradeTile, IUpgradeInfoHandler, ITankManager, ISecurityTile
|
||||
{
|
||||
public GasTank gasTank = new GasTank(MAX_FLUID);
|
||||
|
||||
|
@ -72,6 +74,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
public double clientEnergyUsed;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 5);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
/** This machine's current RedstoneControl type. */
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
@ -587,4 +590,10 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
{
|
||||
return new Object[] {gasTank, fluidTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,13 +14,15 @@ import mekanism.common.base.IActiveState;
|
|||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntitySeismicVibrator extends TileEntityElectricBlock implements IActiveState, IRedstoneControl
|
||||
public class TileEntitySeismicVibrator extends TileEntityElectricBlock implements IActiveState, IRedstoneControl, ISecurityTile
|
||||
{
|
||||
public boolean isActive;
|
||||
|
||||
|
@ -32,6 +34,8 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
|||
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntitySeismicVibrator()
|
||||
{
|
||||
super("SeismicVibrator", MachineType.SEISMIC_VIBRATOR.baseEnergy);
|
||||
|
@ -204,4 +208,10 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
|||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.GasInput;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -30,7 +32,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.world.biome.BiomeGenDesert;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock implements IRedstoneControl, IBoundingBlock, IGasHandler, ITubeConnection, IActiveState, ISustainedData, ITankManager
|
||||
public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock implements IRedstoneControl, IBoundingBlock, IGasHandler, ITubeConnection, IActiveState, ISustainedData, ITankManager, ISecurityTile
|
||||
{
|
||||
public GasTank inputTank = new GasTank(MAX_GAS);
|
||||
public GasTank outputTank = new GasTank(MAX_GAS);
|
||||
|
@ -53,6 +55,8 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
|||
/** This machine's current RedstoneControl type. */
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntitySolarNeutronActivator()
|
||||
{
|
||||
super("SolarNeutronActivator");
|
||||
|
@ -400,4 +404,10 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
|||
{
|
||||
return new Object[] {inputTank, outputTank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentSecurity getSecurity()
|
||||
{
|
||||
return securityComponent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,11 +75,14 @@ public final class SecurityUtils
|
|||
|
||||
public static SecurityFrequency getFrequency(String owner)
|
||||
{
|
||||
for(Frequency f : Mekanism.securityFrequencies.getFrequencies())
|
||||
if(owner != null)
|
||||
{
|
||||
if(f instanceof SecurityFrequency && f.owner.equals(owner))
|
||||
for(Frequency f : Mekanism.securityFrequencies.getFrequencies())
|
||||
{
|
||||
return (SecurityFrequency)f;
|
||||
if(f instanceof SecurityFrequency && f.owner.equals(owner))
|
||||
{
|
||||
return (SecurityFrequency)f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue