diff options
Diffstat (limited to 'src/main/java/gregtech/common/covers')
30 files changed, 355 insertions, 159 deletions
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java index fd4f2a684c..7d824565cb 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java @@ -6,6 +6,7 @@ import gregtech.api.gui.widgets.GT_GuiFakeItemButton; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -27,7 +28,16 @@ public class GT_Cover_Arm extends GT_CoverBehavior { protected static final int SLOT_ID_MIN = 0; protected static final int CONVERTED_BIT = 0x80000000; + /** + * @deprecated use {@link #GT_Cover_Arm(int aTickRate, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_Arm(int aTickRate) { + this(aTickRate, null); + } + + public GT_Cover_Arm(int aTickRate, ITexture coverTexture) { + super(coverTexture); this.mTickRate = aTickRate; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index 6fd6eb1337..dda79321c9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -5,6 +5,7 @@ import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -16,6 +17,19 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class GT_Cover_ControlsWork extends GT_CoverBehavior { + + /** + * @deprecated use {@link #GT_Cover_ControlsWork(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_ControlsWork() { + this(null); + } + + public GT_Cover_ControlsWork(ITexture coverTexture) { + super(coverTexture); + } + @Override public int doCoverThings( byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java index 592475b610..ebd87e85ab 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -6,6 +6,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -20,12 +21,24 @@ public class GT_Cover_Conveyor extends GT_CoverBehavior { public final int mTickRate; private final int mMaxStacks; + /** + * @deprecated use {@link #GT_Cover_Conveyor(int aTickRate, int maxStacks, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_Conveyor(int aTickRate) { - this.mTickRate = aTickRate; - this.mMaxStacks = 1; + this(aTickRate, 1, null); } + /** + * @deprecated use {@link #GT_Cover_Conveyor(int aTickRate, int maxStacks, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_Conveyor(int aTickRate, int maxStacks) { + this(aTickRate, maxStacks, null); + } + + public GT_Cover_Conveyor(int aTickRate, int maxStacks, ITexture coverTexture) { + super(coverTexture); this.mTickRate = aTickRate; this.mMaxStacks = maxStacks; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java index 61f7aefed9..95d5236f60 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Crafting.java @@ -1,5 +1,6 @@ package gregtech.common.covers; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; import net.minecraft.entity.player.EntityPlayer; @@ -8,6 +9,19 @@ import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.network.play.server.S2DPacketOpenWindow; public class GT_Cover_Crafting extends GT_CoverBehavior { + + /** + * @deprecated use {@link #GT_Cover_Crafting(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_Crafting() { + this(null); + } + + public GT_Cover_Crafting(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java index 54ca59b373..c37e4b5cbb 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -5,6 +5,7 @@ import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -15,6 +16,19 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; public class GT_Cover_DoesWork extends GT_CoverBehavior { + + /** + * @deprecated use {@link #GT_Cover_DoesWork(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_DoesWork() { + this(null); + } + + public GT_Cover_DoesWork(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java index c2a831cd6e..cb93df0bd2 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -1,6 +1,7 @@ package gregtech.common.covers; import gregtech.api.enums.Materials; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.util.GT_CoverBehavior; @@ -15,6 +16,19 @@ import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidHandler; public class GT_Cover_Drain extends GT_CoverBehavior { + + /** + * @deprecated use {@link #GT_Cover_Drain(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_Drain() { + this(null); + } + + public GT_Cover_Drain(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java index 81b8fa8283..c9e7ef363a 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -7,6 +7,7 @@ import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -28,8 +29,17 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; public class GT_Cover_EUMeter extends GT_CoverBehaviorBase<GT_Cover_EUMeter.EUMeterData> { + + /** + * @deprecated use {@link #GT_Cover_EUMeter(ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_EUMeter() { - super(EUMeterData.class); + this(null); + } + + public GT_Cover_EUMeter(ITexture coverTexture) { + super(EUMeterData.class, coverTexture); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java deleted file mode 100644 index 53951ea771..0000000000 --- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java +++ /dev/null @@ -1,126 +0,0 @@ -package gregtech.common.covers; - -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IMachineProgress; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fluids.Fluid; - -public class GT_Cover_EnergyOnly extends GT_CoverBehavior { - @Override - public boolean isRedstoneSensitive( - byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - return false; - } - - @Override - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { - aCoverVariable = (aCoverVariable + 1) % 3; - switch (aCoverVariable) { - case 0: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("028", "Allow")); - break; - case 1: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("029", "Allow (conditional)")); - break; - case 2: - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("030", "Disallow (conditional)")); - break; - } - return aCoverVariable; - } - - @Override - public float getBlastProofLevel(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return 20.0F; - } - - @Override - public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { - if (((IMachineProgress) aTileEntity).isAllowedToWork()) { - return false; - } - } - return true; - } - - @Override - public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - if ((aCoverVariable > 1) && ((aTileEntity instanceof IMachineProgress))) { - if (((IMachineProgress) aTileEntity).isAllowedToWork()) { - return false; - } - } - return true; - } - - @Override - public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean isGUIClickable(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean manipulatesSidedRedstoneOutput( - byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return false; - } - - @Override - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { - return false; - } - - @Override - public boolean onCoverRemoval( - byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { - return true; - } -} diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java b/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java index addc154cfb..1332fa66c6 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FacadeBase.java @@ -137,6 +137,12 @@ public abstract class GT_Cover_FacadeBase extends GT_CoverBehaviorBase<GT_Cover_ } @Override + protected ITexture getSpecialCoverFGTextureImpl( + byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { + return getSpecialCoverTextureImpl(aSide, aCoverID, aCoverVariable, aTileEntity); + } + + @Override protected ITexture getSpecialCoverTextureImpl( byte aSide, int aCoverID, FacadeData aCoverVariable, ICoverable aTileEntity) { if (GT_Utility.isStackInvalid(aCoverVariable.mStack)) return Textures.BlockIcons.ERROR_RENDERING[0]; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java index a6c07e71f8..0dffd08c5e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidLimiter.java @@ -4,6 +4,7 @@ import com.google.common.io.ByteArrayDataInput; import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_TileEntityCoverNew; import gregtech.api.util.GT_CoverBehaviorBase; @@ -27,8 +28,16 @@ import net.minecraftforge.fluids.IFluidHandler; */ public class GT_Cover_FluidLimiter extends GT_CoverBehaviorBase<GT_Cover_FluidLimiter.FluidLimiterData> { + /** + * @deprecated use {@link #GT_Cover_FluidLimiter(ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_FluidLimiter() { - super(FluidLimiterData.class); + this(null); + } + + public GT_Cover_FluidLimiter(ITexture coverTexture) { + super(FluidLimiterData.class, coverTexture); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java index 0bc34b147d..fa20d8206e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidRegulator.java @@ -6,6 +6,7 @@ import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCoverNew; @@ -50,8 +51,16 @@ public class GT_Cover_FluidRegulator extends GT_CoverBehaviorBase<GT_Cover_Fluid public final int mTransferRate; private boolean allowFluid = false; + /** + * @deprecated use {@link #GT_Cover_FluidRegulator(int aTransferRate, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_FluidRegulator(int aTransferRate) { - super(FluidRegulatorData.class); + this(aTransferRate, null); + } + + public GT_Cover_FluidRegulator(int aTransferRate, ITexture coverTexture) { + super(FluidRegulatorData.class, coverTexture); if (aTransferRate > (-1 >>> (Integer.SIZE - SPEED_LENGTH))) throw new IllegalArgumentException("aTransferRate too big: " + aTransferRate); this.mTransferRate = aTransferRate; diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java index a90d2f2213..8f03f7fff9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java @@ -19,6 +19,7 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONIT import com.google.common.io.ByteArrayDataInput; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.ITextureBuilder; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_CoverBehaviorBase; @@ -44,6 +45,10 @@ import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; +/** + * TODO: Implement overlay rendering only with + * {@link GT_CoverBehaviorBase#getSpecialCoverFGTextureImpl(byte, int, ISerializableObject, ICoverable)} + */ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_FluidStorageMonitor.FluidStorageData> { private static final IIconContainer[] icons = new IIconContainer[] { OVERLAY_FLUID_STORAGE_MONITOR0, @@ -107,31 +112,39 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ } @Override + protected ITexture getSpecialCoverFGTextureImpl( + byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity) { + return getSpecialCoverTextureImpl(aSide, aCoverID, aCoverVariable, aTileEntity); + } + + @Override protected ITexture getSpecialCoverTextureImpl( byte aSide, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity) { if (aCoverVariable.slot == -1 || aCoverVariable.fluid == null || aCoverVariable.scale == 0) { return TextureFactory.of(OVERLAY_FLUID_STORAGE_MONITOR0); } - return TextureFactory.of( - TextureFactory.of( - new IIconContainer() { - @Override - public IIcon getIcon() { - return aCoverVariable.fluid.getStillIcon(); - } - - @Override - public IIcon getOverlayIcon() { - return null; - } - - @Override - public ResourceLocation getTextureFile() { - return TextureMap.locationBlocksTexture; - } - }, - colorToRGBA(aCoverVariable.fluid.getColor())), - TextureFactory.of(icons[aCoverVariable.scale])); + final IIconContainer fluidIcon = new IIconContainer() { + @Override + public IIcon getIcon() { + return aCoverVariable.fluid.getStillIcon(); + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + }; + + final short[] fluidRGBA = colorToRGBA(aCoverVariable.fluid.getColor()); + final ITextureBuilder fluidTextureBuilder = + TextureFactory.builder().addIcon(fluidIcon).setRGBA(fluidRGBA); + if (aCoverVariable.fluid.getLuminosity() > 0) fluidTextureBuilder.glow(); + return TextureFactory.of(fluidTextureBuilder.build(), TextureFactory.of(icons[aCoverVariable.scale])); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java index 1da703cbb7..ace1645a0f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Fluidfilter.java @@ -8,6 +8,7 @@ import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiFakeItemButton; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_TileEntityCoverNew; import gregtech.api.util.GT_CoverBehaviorBase; @@ -39,8 +40,16 @@ public class GT_Cover_Fluidfilter extends GT_CoverBehaviorBase<GT_Cover_Fluidfil private final int ANY_INPUT_FILTER_OUTPUT = 6; // 110 private final int ANY_INPUT_INVERT_OUTPUT = 7; // 111 - public GT_Cover_Fluidfilter() { - super(FluidFilterData.class); + /** + * @deprecated use {@link #GT_Cover_Fluidfilter(ITexture coverTexture)} instead + */ + @Deprecated + GT_Cover_Fluidfilter() { + this(null); + } + + public GT_Cover_Fluidfilter(ITexture coverTexture) { + super(FluidFilterData.class, coverTexture); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java index b50cdb7194..aee762f36c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemFilter.java @@ -10,6 +10,7 @@ import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiFakeItemButton; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_TileEntityCoverNew; import gregtech.api.util.GT_CoverBehaviorBase; @@ -34,8 +35,16 @@ public class GT_Cover_ItemFilter extends GT_CoverBehaviorBase<GT_Cover_ItemFilte private final boolean mExport; + /** + * @deprecated use {@link #GT_Cover_ItemFilter(boolean isExport, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_ItemFilter(boolean isExport) { - super(ItemFilterData.class); + this(isExport, null); + } + + public GT_Cover_ItemFilter(boolean isExport, ITexture coverTexture) { + super(ItemFilterData.class, coverTexture); this.mExport = isExport; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 4b66c2eaab..82dffaf7a8 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -8,6 +8,7 @@ import gregtech.api.gui.widgets.GT_GuiFakeItemButton; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -36,8 +37,16 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter. private static final int CONVERTED_BIT = 0x80000000; private static final int INVERT_BIT = 0x40000000; + /** + * @deprecated use {@link #GT_Cover_ItemMeter(ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_ItemMeter() { - super(ItemMeterData.class); + this(null); + } + + public GT_Cover_ItemMeter(ITexture coverTexture) { + super(ItemMeterData.class, coverTexture); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java index 735959e15c..b8675bf1c2 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Lens.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Lens.java @@ -1,12 +1,22 @@ package gregtech.common.covers; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; public class GT_Cover_Lens extends GT_CoverBehavior { private final byte mColor; + /** + * @deprecated use {@link #GT_Cover_Lens(byte aColor, ITexture coverTexture)} instead. + */ + @Deprecated public GT_Cover_Lens(byte aColor) { + this(aColor, null); + } + + public GT_Cover_Lens(byte aColor, ITexture coverTexture) { + super(coverTexture); this.mColor = aColor; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 55cca29704..ce795bdd09 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -6,6 +6,7 @@ import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_TileEntityCoverNew; import gregtech.api.util.GT_CoverBehaviorBase; @@ -26,10 +27,14 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +/** + * TODO: Implement overlay rendering only with + * {@link GT_CoverBehaviorBase#getSpecialCoverFGTextureImpl(byte, int, ISerializableObject, ICoverable)} + */ public class GT_Cover_LiquidMeter extends GT_CoverBehaviorBase<GT_Cover_LiquidMeter.LiquidMeterData> { - public GT_Cover_LiquidMeter() { - super(LiquidMeterData.class); + public GT_Cover_LiquidMeter(ITexture coverTexture) { + super(LiquidMeterData.class, coverTexture); } @Override diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index baf3c6232f..369778ef12 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -18,6 +19,19 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class GT_Cover_NeedMaintainance extends GT_CoverBehavior { + + /** + * @deprecated use {@link #GT_Cover_NeedMaintainance(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_NeedMaintainance() { + this(null); + } + + public GT_Cover_NeedMaintainance(ITexture coverTexture) { + super(coverTexture); + } + private boolean isRotor(ItemStack aRotor) { return !(aRotor == null || !(aRotor.getItem() instanceof GT_MetaGenerated_Tool) diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index a0f2d830c0..338a214ada 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -19,6 +20,18 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior { private String placer = ""; private int range = 8; + /** + * @deprecated use {@link #GT_Cover_PlayerDetector(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_PlayerDetector() { + this(null); + } + + public GT_Cover_PlayerDetector(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java index 269788cb6d..db60cfa409 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.net.GT_Packet_TileEntityCover; @@ -19,7 +20,16 @@ import net.minecraftforge.fluids.IFluidHandler; public class GT_Cover_Pump extends GT_CoverBehavior { public final int mTransferRate; + /** + * @deprecated use {@link #GT_Cover_Pump(int aTransferRate, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_Pump(int aTransferRate) { + this(aTransferRate, null); + } + + public GT_Cover_Pump(int aTransferRate, ITexture coverTexture) { + super(coverTexture); this.mTransferRate = aTransferRate; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java index 06e0ec4001..4be44136e6 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -1,12 +1,18 @@ package gregtech.common.covers; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; +@SuppressWarnings("unused") // Legacy from GT4. TODO: Consider re-enable registration public class GT_Cover_RedstoneConductor extends GT_CoverBehavior { + GT_Cover_RedstoneConductor(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java index 374f5a0a81..17d6b2e1c9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverExternal.java @@ -1,9 +1,23 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; public class GT_Cover_RedstoneReceiverExternal extends GT_Cover_RedstoneWirelessBase { + + /** + * @deprecated use {@link #GT_Cover_RedstoneReceiverExternal(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_RedstoneReceiverExternal() { + this(null); + } + + public GT_Cover_RedstoneReceiverExternal(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java index 61dcb5a602..32bbd17d7f 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneReceiverInternal.java @@ -1,10 +1,24 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; public class GT_Cover_RedstoneReceiverInternal extends GT_Cover_RedstoneWirelessBase { + + /** + * @deprecated use {@link #GT_Cover_RedstoneReceiverInternal(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_RedstoneReceiverInternal() { + this(null); + } + + public GT_Cover_RedstoneReceiverInternal(ITexture coverTexture) { + super(coverTexture); + } + @Override public int doCoverThings( byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java index d4ec0a82d6..31a542a924 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -1,5 +1,6 @@ package gregtech.common.covers; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.util.GT_CoverBehavior; @@ -7,7 +8,12 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; +@SuppressWarnings("unused") // TODO: Consider re-registering this public class GT_Cover_RedstoneSignalizer extends GT_CoverBehavior { + GT_Cover_RedstoneSignalizer(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java index 0c89d7e6e4..1c6623baa7 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterExternal.java @@ -1,13 +1,27 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; public class GT_Cover_RedstoneTransmitterExternal extends GT_Cover_RedstoneWirelessBase { + + /** + * @deprecated use {@link #GT_Cover_RedstoneTransmitterExternal(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_RedstoneTransmitterExternal() { + this(null); + } + + public GT_Cover_RedstoneTransmitterExternal(ITexture coverTexture) { + super(coverTexture); + } + @Override public int doCoverThings( byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - GregTech_API.sWirelessRedstone.put(Integer.valueOf(aCoverVariable), Byte.valueOf(aInputRedstone)); + GregTech_API.sWirelessRedstone.put(aCoverVariable, aInputRedstone); return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java index 0003e063b3..a1f020c40c 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java @@ -1,9 +1,23 @@ package gregtech.common.covers; import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; public class GT_Cover_RedstoneTransmitterInternal extends GT_Cover_RedstoneWirelessBase { + + /** + * @deprecated use {@link #GT_Cover_RedstoneTransmitterInternal(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_RedstoneTransmitterInternal() { + this(null); + } + + public GT_Cover_RedstoneTransmitterInternal(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index 02f4786dee..a942d39b57 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -7,6 +7,7 @@ import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; import gregtech.api.gui.widgets.GT_GuiIntegerTextBox; import gregtech.api.interfaces.IGuiScreen; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.net.GT_Packet_WirelessRedstoneCover; import gregtech.api.util.GT_CoverBehavior; @@ -23,6 +24,18 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { private static final int PUBLIC_MASK = 0x0000FFFF; private static final int CHECKBOX_MASK = 0x00010000; + /** + * @deprecated use {@link #GT_Cover_RedstoneWirelessBase(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_RedstoneWirelessBase() { + this(null); + } + + public GT_Cover_RedstoneWirelessBase(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean onCoverRemoval( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java index 393f5ee4b4..84fc84d820 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Screen.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Screen.java @@ -1,11 +1,25 @@ package gregtech.common.covers; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.fluids.Fluid; public class GT_Cover_Screen extends GT_CoverBehavior { + + /** + * @deprecated use {@link #GT_Cover_Screen(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_Screen() { + this(null); + } + + public GT_Cover_Screen(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index 9a2ceac09b..2b15359d64 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -4,6 +4,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.gui.GT_GUICover; import gregtech.api.gui.widgets.GT_GuiIcon; import gregtech.api.gui.widgets.GT_GuiIconCheckButton; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.metatileentity.BaseMetaPipeEntity; @@ -16,6 +17,18 @@ import net.minecraftforge.fluids.Fluid; public class GT_Cover_Shutter extends GT_CoverBehavior { + /** + * @deprecated use {@link #GT_Cover_Shutter(ITexture coverTexture)} instead + */ + @Deprecated + public GT_Cover_Shutter() { + this(null); + } + + public GT_Cover_Shutter(ITexture coverTexture) { + super(coverTexture); + } + @Override public boolean isRedstoneSensitive( byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java index 068576e8ca..30c48fdf56 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SteamValve.java @@ -1,13 +1,22 @@ package gregtech.common.covers; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_ModHandler; import net.minecraftforge.fluids.FluidStack; public class GT_Cover_SteamValve extends GT_Cover_Pump { + /** + * @deprecated use {@link #GT_Cover_SteamValve(int aTransferRate, ITexture coverTexture)} instead + */ + @Deprecated public GT_Cover_SteamValve(int aTransferRate) { - super(aTransferRate); + this(aTransferRate, null); + } + + public GT_Cover_SteamValve(int aTransferRate, ITexture coverTexture) { + super(aTransferRate, coverTexture); } @Override |