From ee9b263815abe1e158b057996ce76f33dbf82f1e Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 18 Feb 2019 22:37:09 +0100 Subject: several fixes: -removeal of Axe for base entites -streamlined single block NaquadahReactor -fixed basegenerator for naquadagen Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../gregtech/api/interfaces/metatileentity/IMetaTileEntity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java') diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 1ebeda2895..576b2ca3ca 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -47,10 +47,10 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle - * 12 = BaseMetaPipeEntity, Axe lvl 0 to dismantle - * 13 = BaseMetaPipeEntity, Axe lvl 1 to dismantle - * 14 = BaseMetaPipeEntity, Axe lvl 2 to dismantle - * 15 = BaseMetaPipeEntity, Axe lvl 3 to dismantle + * 12 = GT++ + * 13 = GT++ + * 14 = GT++ + * 15 = GT++ */ byte getTileEntityBaseType(); -- cgit From 1b7d5e176ec01d7b8fec464371b3e79144fffa8a Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 15 Jul 2019 19:47:31 -0700 Subject: IC2 ENet compat for GT transformers & GT cables * Fixes every face of ic2 nuclear reactors giving full energy * Should reduce performance concerns from previous ic2 energy compat * Removes Tec's workaround --- .../interfaces/metatileentity/IMetaTileEntity.java | 2 + .../api/metatileentity/BaseMetaPipeEntity.java | 11 +- .../api/metatileentity/BaseMetaTileEntity.java | 10 +- .../api/metatileentity/BaseTileEntity.java | 53 +++++++++ .../api/metatileentity/MetaPipeEntity.java | 4 +- .../api/metatileentity/MetaTileEntity.java | 8 +- .../api/metatileentity/TileIC2EnergySink.java | 131 +++++++++++++++++++++ .../implementations/GT_MetaPipeEntity_Cable.java | 49 +++----- .../GT_MetaTileEntity_Transformer.java | 30 ++--- src/main/java/gregtech/common/GT_Proxy.java | 3 - 10 files changed, 239 insertions(+), 62 deletions(-) create mode 100644 src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java (limited to 'src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java') diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 576b2ca3ca..4ed01fd0b3 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -406,4 +406,6 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand boolean hasAlternativeModeText(); String getAlternativeModeText(); + + boolean shouldJoinIc2Enet(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index d2ac134dbe..6d9ce47ef2 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -273,6 +273,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE for (byte i = 0; i < 6; i++) mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]); issueBlockUpdate(); + joinEnet(); } if (xCoord != oX || yCoord != oY || zCoord != oZ) { @@ -433,6 +434,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } tList.add("Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " : EnumChatFormatting.RED+" not "+EnumChatFormatting.RESET) + "accessible for you"); } + if(joinedIc2Enet) + tList.add("Joined IC2 ENet"); + return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList); } @@ -498,7 +502,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE } @Override - public void setFrontFacing(byte aFacing) {/*Do nothing*/} + public void setFrontFacing(byte aFacing) { + doEnetUpdate(); + } @Override public int getSizeInventory() { @@ -556,6 +562,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE mMetaTileEntity.onRemoval(); mMetaTileEntity.setBaseMetaTileEntity(null); } + leaveEnet(); super.invalidate(); } @@ -864,6 +871,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE //logic handled internally GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); } + doEnetUpdate(); return true; } @@ -876,6 +884,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); } + doEnetUpdate(); return true; } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 75b34fa73f..1da2dffca9 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -378,6 +378,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE oRedstone = mRedstone; issueBlockUpdate(); } + if(mTickTimer == 10) joinEnet(); if (xCoord != oX || yCoord != oY || zCoord != oZ) { oX = xCoord; @@ -417,6 +418,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } } + if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { long tOutputVoltage = Math.max(oOutput, oOutput + (1 << GT_Utility.getTier(oOutput))), tUsableAmperage = Math.min(getOutputAmperage(), (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); if (tUsableAmperage > 0) { @@ -746,6 +748,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (!mHasEnoughEnergy) tList.add(EnumChatFormatting.RED+"ATTENTION: This Device needs more power."+EnumChatFormatting.RESET); } + if(joinedIc2Enet) + tList.add("Joined IC2 ENet"); return mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList); } @@ -816,6 +820,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE mFacing = aFacing; mMetaTileEntity.onFacingChange(); onMachineBlockUpdate(); + doEnetUpdate(); } } @@ -875,6 +880,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE @Override public void invalidate() { tileEntityInvalid = false; + leaveEnet(); if (canAccessData()) { mMetaTileEntity.onRemoval(); mMetaTileEntity.setBaseMetaTileEntity(null); @@ -1355,7 +1361,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE mStrongRedstone ^= (1 << tSide); GT_Utility.sendChatToPlayer(aPlayer, trans("091","Redstone Output at Side ") + tSide + trans("092"," set to: ") + ((mStrongRedstone & (1 << tSide)) != 0 ? trans("093","Strong") : trans("094","Weak"))); GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(103), 3.0F, -1, xCoord, yCoord, zCoord); - } + } + doEnetUpdate(); return true; } @@ -1365,6 +1372,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE //logic handled internally GT_Utility.sendSoundToPlayers(worldObj, GregTech_API.sSoundList.get(100), 1.0F, -1, xCoord, yCoord, zCoord); } + doEnetUpdate(); return true; } diff --git a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java index 66d1ade42d..eb18ef0d0c 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -1,10 +1,14 @@ package gregtech.api.metatileentity; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.net.GT_Packet_Block_Event; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -13,6 +17,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidHandler; @@ -398,12 +403,14 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public void invalidate() { + leaveEnet(); clearNullMarkersFromTileEntityBuffer(); super.invalidate(); } @Override public void onChunkUnload() { + leaveEnet(); clearNullMarkersFromTileEntityBuffer(); super.onChunkUnload(); isDead = true; @@ -442,4 +449,50 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje public String trans(String aKey, String aEnglish){ return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_"+aKey, aEnglish, false); } + + /* + * IC2 Energy Compat + */ + protected TileIC2EnergySink ic2EnergySink = null; + protected boolean joinedIc2Enet = false; + + public IMetaTileEntity getMetaTileEntity() { return null; } + + protected void createIc2Sink() { + if(ic2EnergySink == null && FMLCommonHandler.instance().getEffectiveSide().isServer() && shouldJoinIc2Enet()) { + ic2EnergySink = new TileIC2EnergySink((IGregTechTileEntity)this); + ic2EnergySink.xCoord = xCoord; + ic2EnergySink.yCoord = yCoord; + ic2EnergySink.zCoord = zCoord; + ic2EnergySink.setWorldObj(worldObj); + } + } + + public void doEnetUpdate() { + leaveEnet(); + joinEnet(); + } + + protected void joinEnet() { + if (joinedIc2Enet || !shouldJoinIc2Enet()) return; + + if(ic2EnergySink == null) createIc2Sink(); + + if (ic2EnergySink != null) { + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(ic2EnergySink)); + joinedIc2Enet = true; + } + } + + protected void leaveEnet() { + if (joinedIc2Enet && ic2EnergySink != null && FMLCommonHandler.instance().getEffectiveSide().isServer()) { + joinedIc2Enet = false; + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(ic2EnergySink)); + } + } + + public boolean shouldJoinIc2Enet() { + final IMetaTileEntity meta = getMetaTileEntity(); + return meta != null && meta.shouldJoinIc2Enet(); + } } \ No newline at end of file diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index 7129c174df..6b66b64fa0 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -2,7 +2,6 @@ package gregtech.api.metatileentity; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IConnectable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -838,4 +837,7 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { public boolean canConnect(byte aSide, TileEntity tTileEntity) { return false; } public boolean getGT6StyleConnection() { return false; } + + public boolean shouldJoinIc2Enet() { return false; } + } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 5aced1f177..e7c35e9b08 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -43,7 +43,7 @@ import static gregtech.api.enums.GT_Values.V; * Call the Constructor like the following example inside the Load Phase, to register it. * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");" */ -public abstract class MetaTileEntity implements IMetaTileEntity { +public abstract class MetaTileEntity implements IMetaTileEntity { /** * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName. */ @@ -86,10 +86,6 @@ public abstract class MetaTileEntity implements IMetaTileEntity { GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); mInventory = new ItemStack[aInvSlotCount]; -// if (GT.isClientSide()) { -// ItemStack tStack = new ItemStack(GregTech_API.sBlockMachines, 1, aID); -// tStack.getItem().addInformation(tStack, null, new ArrayList(), true); -// } } /** @@ -936,4 +932,6 @@ public abstract class MetaTileEntity implements IMetaTileEntity { public String getAlternativeModeText(){ return ""; } + + public boolean shouldJoinIc2Enet() { return false; } } diff --git a/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java new file mode 100644 index 0000000000..6a4b952735 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/TileIC2EnergySink.java @@ -0,0 +1,131 @@ +package gregtech.api.metatileentity; + +import com.google.common.collect.Sets; +import gregtech.api.interfaces.metatileentity.IConnectable; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.util.GT_Utility; +import ic2.api.energy.tile.IEnergySink; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileIC2EnergySink extends TileEntity implements IEnergySink { + private IGregTechTileEntity myMeta; + private GT_MetaPipeEntity_Cable cableMeta = null; + + public TileIC2EnergySink(IGregTechTileEntity meta) { + if (meta == null) throw new NullPointerException("no null metas"); + myMeta = meta; + final IMetaTileEntity metaTile = myMeta.getMetaTileEntity(); + if (metaTile instanceof IMetaTileEntityCable) { + cableMeta = (GT_MetaPipeEntity_Cable) metaTile; + } + } + /* + * + * IC2 enet compat - IEnergySink + * + */ + + /** + * Determine how much energy the sink accepts. + * + * Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0. + * + * @note Modifying the energy net from this method is disallowed. + * + * @return max accepted input in eu + */ + @Override + public double getDemandedEnergy() { + if(cableMeta != null) { + return (cableMeta.mVoltage * cableMeta.mAmperage); + } + else + return myMeta.getEUCapacity() - myMeta.getStoredEU(); + } + + + + /** + * Determine the tier of this energy sink. + * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. + * @note Return Integer.MAX_VALUE to allow any voltage. + * + * @return tier of this energy sink + */ + @Override + public int getSinkTier() { + return GT_Utility.getTier(cableMeta != null ? cableMeta.mVoltage : myMeta.getInputVoltage()); + } + + /** + * Transfer energy to the sink. + * + * It's highly recommended to accept all energy by letting the internal buffer overflow to + * increase the performance and accuracy of the distribution simulation. + * + * @param directionFrom direction from which the energy comes from + * @param amount energy to be transferred + * @return Energy not consumed (leftover) + */ + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { + + final long amps =(long)Math.max(amount / (cableMeta != null ? cableMeta.mVoltage : myMeta.getInputVoltage() * 1.0), 1.0); + final long euPerAmp = (long)(amount / (amps * 1.0)); + + final IMetaTileEntity metaTile = myMeta.getMetaTileEntity(); + if (metaTile == null) return amount; + + final long usedAmps; + if(cableMeta != null) { + usedAmps = ((IMetaTileEntityCable) metaTile).transferElectricity((byte) directionFrom.ordinal(), Math.min(euPerAmp, cableMeta.mVoltage), amps, Sets.newHashSet((TileEntity) myMeta)); + + // [23:17:00] [Client thread/INFO]: [CHAT] §9(§aAOE §aSafe §aMode §ais §aenabled§9) §cOperation §cCanceled §cbecause §ca §ctile §centity §cwas §cdetected + //[23:17:01] [Server thread/ERROR] [FML]: Exception caught during firing event cpw.mods.fml.common.gameevent.TickEvent$WorldTickEvent@1b066533: + //java.lang.NullPointerException + // at gregtech.api.metatileentity.TileIC2EnergySink.injectEnergy(TileIC2EnergySink.java:83) ~[TileIC2EnergySink.class:?] + // at ic2.core.energy.EnergyNetLocal.processChanges(EnergyNetLocal.java:704) ~[EnergyNetLocal.class:?] + // at ic2.core.energy.EnergyNetLocal.onTickEnd(EnergyNetLocal.java:389) ~[EnergyNetLocal.class:?] + // at ic2.core.energy.EnergyNetGlobal.onTickEnd(EnergyNetGlobal.java:69) ~[EnergyNetGlobal.class:?] + // at ic2.core.TickHandler.onWorldTick(TickHandler.java:79) ~[TickHandler.class:?] + // at cpw.mods.fml.common.eventhandler.ASMEventHandler_85_TickHandler_onWorldTick_WorldTickEvent.invoke(.dynamic) ~[?:?] + // at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?] + // at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?] + // at cpw.mods.fml.common.FMLCommonHandler.onPostWorldTick(FMLCommonHandler.java:255) ~[FMLCommonHandler.class:?] + // at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:645) ~[MinecraftServer.class:?] + // at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) ~[MinecraftServer.class:?] + // at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111) ~[bsx.class:?] + // at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396) [MinecraftServer.class:?] + // at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [?:?] + } + else + usedAmps = myMeta.injectEnergyUnits((byte) directionFrom.ordinal(), Math.min(euPerAmp, myMeta.getInputVoltage()), amps); + return amount - ( usedAmps * euPerAmp); + + // transferElectricity for cables + } + + /** + * Determine if this acceptor can accept current from an adjacent emitter in a direction. + * + * The TileEntity in the emitter parameter is what was originally added to the energy net, + * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. + * + * @param emitter energy emitter, may also be null or an IMetaDelegate + * @param direction direction the energy is being received from + */ + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { + final IMetaTileEntity metaTile = myMeta.getMetaTileEntity(); + if(metaTile instanceof IMetaTileEntityCable && (direction == ForgeDirection.UNKNOWN || ((IConnectable)metaTile).isConnectedAtSide(direction.ordinal()))) + return true; + else + return myMeta.inputEnergyFrom((byte) direction.ordinal(), false); + + } + +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index 5b75b89d23..c55e346546 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -156,34 +156,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile return (int) mAmperage * 64; } - private void pullFromIc2EnergySources(IGregTechTileEntity aBaseMetaTileEntity) { - if(!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return; - - for( byte aSide = 0 ; aSide < 6 ; aSide++) if(isConnectedAtSide(aSide)) { - final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(aSide); - final TileEntity tEmitter; - if (tTileEntity instanceof IReactorChamber) - tEmitter = (TileEntity) ((IReactorChamber) tTileEntity).getReactor(); - else tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity : - EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord); - - if (tEmitter instanceof IEnergySource) { - final GT_CoverBehavior coverBehavior = aBaseMetaTileEntity.getCoverBehaviorAtSide(aSide); - final int coverId = aBaseMetaTileEntity.getCoverIDAtSide(aSide), - coverData = aBaseMetaTileEntity.getCoverDataAtSide(aSide); - final ForgeDirection tDirection = ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)); - - if (((IEnergySource) tEmitter).emitsEnergyTo((TileEntity) aBaseMetaTileEntity, tDirection) && - coverBehavior.letsEnergyIn(aSide, coverId, coverData, aBaseMetaTileEntity)) { - final long tEU = (long) ((IEnergySource) tEmitter).getOfferedEnergy(); - - if (transferElectricity(aSide, tEU, 1, Sets.newHashSet((TileEntity) aBaseMetaTileEntity)) > 0) - ((IEnergySource) tEmitter).drawEnergy(tEU); - } - } - } - } - @Override public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { if (!isConnectedAtSide(aSide) && aSide != 6) @@ -324,8 +296,6 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - if (GT_Mod.gregtechproxy.ic2EnergySourceCompat) pullFromIc2EnergySources(aBaseMetaTileEntity); - { //amp handler long worldTick = aBaseMetaTileEntity.getWorld().getTotalWorldTime(); @@ -604,4 +574,23 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile if (inputAABB.intersectsWith(aabb)) outputAABB.add(aabb); } } + + @Override + public boolean shouldJoinIc2Enet() { + if (!GT_Mod.gregtechproxy.ic2EnergySourceCompat) return false; + + if (mConnections != 0) { + final IGregTechTileEntity baseMeta = getBaseMetaTileEntity(); + for( byte aSide = 0 ; aSide < 6 ; aSide++) if(isConnectedAtSide(aSide)) { + final TileEntity tTileEntity = baseMeta.getTileEntityAtSide(aSide); + final TileEntity tEmitter = (tTileEntity == null || tTileEntity instanceof IEnergyTile || EnergyNet.instance == null) ? tTileEntity : + EnergyNet.instance.getTileEntity(tTileEntity.getWorldObj(), tTileEntity.xCoord, tTileEntity.yCoord, tTileEntity.zCoord); + + if (tEmitter instanceof IEnergyEmitter) + return true; + + } + } + return false; + } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java index 72b24182df..f33b8aa3d9 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Transformer.java @@ -1,23 +1,16 @@ package gregtech.api.metatileentity.implementations; -import appeng.api.parts.IPartHost; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyStorage; import crazypants.enderio.machine.capbank.TileCapBank; import crazypants.enderio.machine.capbank.network.ICapBankNetwork; import crazypants.enderio.power.IPowerContainer; -import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Proxy; -import ic2.api.energy.tile.IEnergySource; -import ic2.api.reactor.IReactor; -import ic2.api.reactor.IReactorChamber; -import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -147,30 +140,20 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide()) { + if (aBaseMetaTileEntity.isServerSide() && GregTech_API.mInputRF) { aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()); for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++) if (aBaseMetaTileEntity.inputEnergyFrom(i)) { TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); - if (tTileEntity instanceof IReactorChamber) { - tTileEntity = (TileEntity) ((IReactorChamber) tTileEntity).getReactor(); - } - if(tTileEntity instanceof IReactor && !GT_Mod.gregtechproxy.reactorsDone.add((IReactor) tTileEntity)){ - continue; - } - if (tTileEntity instanceof IEnergySource && !(tTileEntity instanceof IPartHost) && ((IEnergySource) tTileEntity).emitsEnergyTo((TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)))) { - long tEU = Math.min(maxEUInput(), (long) ((IEnergySource) tTileEntity).getOfferedEnergy()); - ((IEnergySource) tTileEntity).drawEnergy(tEU); - aBaseMetaTileEntity.injectEnergyUnits((byte) 6, tEU, 1); - } else if (GregTech_API.mInputRF && tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), 1, true) == 1) { + if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), 1, true) == 1) { long tEU = (long) ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)), GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), false); tEU = tEU * GregTech_API.mRFtoEU / 100; aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); - } else if (GregTech_API.mInputRF && tTileEntity instanceof IEnergyStorage && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) { + } else if (tTileEntity instanceof IEnergyStorage && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) { long tEU = (long) ((IEnergyStorage) tTileEntity).extractEnergy(GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU), false); tEU = tEU * GregTech_API.mRFtoEU / 100; aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1); - } else if (GregTech_API.mInputRF && GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) { + } else if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) { int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored(); int extractRF = GT_Utility.safeInt(maxEUInput() * 100L / GregTech_API.mRFtoEU); long tEU = 0; @@ -233,4 +216,9 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi maxAmperesOut() + trans("149","A"); } + + @Override + public boolean shouldJoinIc2Enet() { + return true; + } } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 855367f5ff..6d50c6964a 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -29,7 +29,6 @@ import gregtech.common.gui.GT_GUIContainerVolumetricFlask; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.armor.ModularArmor_Item; import gregtech.common.items.armor.gui.*; -import ic2.api.reactor.IReactor; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -216,7 +215,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean gt6Cable = true; public boolean ic2EnergySourceCompat = true; public boolean costlyCableConnection = false; - public final HashSet reactorsDone=new HashSet<>(); public GT_Proxy() { GameRegistry.registerFuelHandler(this); @@ -1234,7 +1232,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { - reactorsDone.clear(); } @SubscribeEvent -- cgit From 112940c9fc61e578470554bb775471952437e64f Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Mon, 15 Jul 2019 19:57:44 -0700 Subject: spaces --- .../java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java | 2 +- src/main/java/gregtech/api/metatileentity/MetaTileEntity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java') diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 4ed01fd0b3..e973301395 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -408,4 +408,4 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand String getAlternativeModeText(); boolean shouldJoinIc2Enet(); -} \ No newline at end of file +} diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index e7c35e9b08..1753d2677c 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -43,7 +43,7 @@ import static gregtech.api.enums.GT_Values.V; * Call the Constructor like the following example inside the Load Phase, to register it. * "new GT_MetaTileEntity_E_Furnace(54, "GT_E_Furnace", "Automatic E-Furnace");" */ -public abstract class MetaTileEntity implements IMetaTileEntity { +public abstract class MetaTileEntity implements IMetaTileEntity { /** * Only assigned for the MetaTileEntity in the List! Also only used to get the localized Name for the ItemStack and for getInvName. */ -- cgit From 1922f34f1f8782f160e4808f4f6bb75a50703871 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Tue, 17 Mar 2020 19:12:19 +0100 Subject: Refactored Interfaces Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> --- .../gregtech/api/interfaces/IBlockOnWalkOver.java | 2 +- .../api/interfaces/IColorModulationContainer.java | 2 +- .../java/gregtech/api/interfaces/ICondition.java | 16 +- .../gregtech/api/interfaces/IDamagableItem.java | 2 +- .../gregtech/api/interfaces/IDebugableBlock.java | 2 +- .../java/gregtech/api/interfaces/IDescribable.java | 2 +- .../java/gregtech/api/interfaces/IFoodStat.java | 12 +- .../gregtech/api/interfaces/IIconContainer.java | 6 +- .../gregtech/api/interfaces/IItemBehaviour.java | 24 +- .../gregtech/api/interfaces/IItemContainer.java | 32 +- .../api/interfaces/IOreRecipeRegistrator.java | 2 +- .../gregtech/api/interfaces/IProjectileItem.java | 6 +- .../api/interfaces/IRedstoneCircuitBlock.java | 24 +- .../gregtech/api/interfaces/ISubTagContainer.java | 6 +- .../java/gregtech/api/interfaces/ITexture.java | 14 +- .../java/gregtech/api/interfaces/IToolStats.java | 71 ++--- .../interfaces/internal/IGT_CraftingRecipe.java | 2 +- .../gregtech/api/interfaces/internal/IGT_Mod.java | 12 +- .../api/interfaces/internal/IGT_RecipeAdder.java | 344 +++++++++++---------- .../api/interfaces/internal/IThaumcraftCompat.java | 56 +++- .../interfaces/metatileentity/IConnectable.java | 21 +- .../interfaces/metatileentity/IMetaTileEntity.java | 6 +- .../metatileentity/IMetaTileEntityCable.java | 4 +- .../metatileentity/IMetaTileEntityItemPipe.java | 15 +- .../tileentity/IBasicEnergyContainer.java | 34 +- .../interfaces/tileentity/IColoredTileEntity.java | 4 +- .../api/interfaces/tileentity/ICoverable.java | 26 +- .../api/interfaces/tileentity/IDigitalChest.java | 8 +- .../interfaces/tileentity/IEnergyConductor.java | 12 +- .../interfaces/tileentity/IEnergyConnected.java | 58 ++-- .../tileentity/IExperimentalEnergyTileEntity.java | 8 +- .../api/interfaces/tileentity/IFibreConnected.java | 10 +- .../tileentity/IGearEnergyTileEntity.java | 4 +- .../tileentity/IGregTechDeviceInformation.java | 4 +- .../interfaces/tileentity/IGregTechTileEntity.java | 48 +-- .../api/interfaces/tileentity/IHasInventory.java | 8 +- .../tileentity/IHasWorldObjectAndCoords.java | 122 ++++---- .../tileentity/IMachineBlockUpdateable.java | 2 +- .../interfaces/tileentity/IMachineProgress.java | 24 +- .../tileentity/IPipeRenderedTileEntity.java | 6 +- .../interfaces/tileentity/IRedstoneReceiver.java | 8 +- .../interfaces/tileentity/IRedstoneTileEntity.java | 2 +- .../interfaces/tileentity/ITexturedTileEntity.java | 2 +- 43 files changed, 555 insertions(+), 518 deletions(-) (limited to 'src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java') diff --git a/src/main/java/gregtech/api/interfaces/IBlockOnWalkOver.java b/src/main/java/gregtech/api/interfaces/IBlockOnWalkOver.java index a2e7858fbd..8957f3bbbc 100644 --- a/src/main/java/gregtech/api/interfaces/IBlockOnWalkOver.java +++ b/src/main/java/gregtech/api/interfaces/IBlockOnWalkOver.java @@ -4,5 +4,5 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; public interface IBlockOnWalkOver { - public void onWalkOver(EntityLivingBase aEntity, World aWorld, int aX, int aY, int aZ); + void onWalkOver(EntityLivingBase aEntity, World aWorld, int aX, int aY, int aZ); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java b/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java index ad3aa3c908..d3c312e610 100644 --- a/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java +++ b/src/main/java/gregtech/api/interfaces/IColorModulationContainer.java @@ -1,5 +1,5 @@ package gregtech.api.interfaces; public interface IColorModulationContainer { - public short[] getRGBA(); + short[] getRGBA(); } diff --git a/src/main/java/gregtech/api/interfaces/ICondition.java b/src/main/java/gregtech/api/interfaces/ICondition.java index 9e31da7338..3fb47251c7 100644 --- a/src/main/java/gregtech/api/interfaces/ICondition.java +++ b/src/main/java/gregtech/api/interfaces/ICondition.java @@ -1,11 +1,11 @@ package gregtech.api.interfaces; public interface ICondition { - public boolean isTrue(O aObject); + boolean isTrue(O aObject); // Utility Classes for adding relations between Conditions. - public static class Not implements ICondition { + class Not implements ICondition { private final ICondition mCondition; public Not(ICondition aCondition) { @@ -18,7 +18,7 @@ public interface ICondition { } } - public static class Or implements ICondition { + class Or implements ICondition { private final ICondition[] mConditions; public Or(ICondition... aConditions) { @@ -32,7 +32,7 @@ public interface ICondition { } } - public static class Nor implements ICondition { + class Nor implements ICondition { private final ICondition[] mConditions; public Nor(ICondition... aConditions) { @@ -46,7 +46,7 @@ public interface ICondition { } } - public static class And implements ICondition { + class And implements ICondition { private final ICondition[] mConditions; public And(ICondition... aConditions) { @@ -60,7 +60,7 @@ public interface ICondition { } } - public static class Nand implements ICondition { + class Nand implements ICondition { private final ICondition[] mConditions; public Nand(ICondition... aConditions) { @@ -74,7 +74,7 @@ public interface ICondition { } } - public static class Xor implements ICondition { + class Xor implements ICondition { private final ICondition mCondition1, mCondition2; public Xor(ICondition aCondition1, ICondition aCondition2) { @@ -88,7 +88,7 @@ public interface ICondition { } } - public static class Equal implements ICondition { + class Equal implements ICondition { private final ICondition mCondition1, mCondition2; public Equal(ICondition aCondition1, ICondition aCondition2) { diff --git a/src/main/java/gregtech/api/interfaces/IDamagableItem.java b/src/main/java/gregtech/api/interfaces/IDamagableItem.java index b7ebd6690d..37bb9a2794 100644 --- a/src/main/java/gregtech/api/interfaces/IDamagableItem.java +++ b/src/main/java/gregtech/api/interfaces/IDamagableItem.java @@ -3,5 +3,5 @@ package gregtech.api.interfaces; import net.minecraft.item.ItemStack; public interface IDamagableItem { - public boolean doDamageToItem(ItemStack aStack, int aVanillaDamage); + boolean doDamageToItem(ItemStack aStack, int aVanillaDamage); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java index bdb550ff53..dd72b4d71e 100644 --- a/src/main/java/gregtech/api/interfaces/IDebugableBlock.java +++ b/src/main/java/gregtech/api/interfaces/IDebugableBlock.java @@ -23,5 +23,5 @@ public interface IDebugableBlock { * 3 = Debug ONLY * @return a String-Array containing the DebugInfo, every Index is a separate line (0 = first Line) */ - public ArrayList getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel); + ArrayList getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IDescribable.java b/src/main/java/gregtech/api/interfaces/IDescribable.java index d4bcf58de8..3e72f587db 100644 --- a/src/main/java/gregtech/api/interfaces/IDescribable.java +++ b/src/main/java/gregtech/api/interfaces/IDescribable.java @@ -7,5 +7,5 @@ public interface IDescribable { /** * The Tooltip Text */ - public String[] getDescription(); + String[] getDescription(); } diff --git a/src/main/java/gregtech/api/interfaces/IFoodStat.java b/src/main/java/gregtech/api/interfaces/IFoodStat.java index b6773e9d65..eec89795fd 100644 --- a/src/main/java/gregtech/api/interfaces/IFoodStat.java +++ b/src/main/java/gregtech/api/interfaces/IFoodStat.java @@ -9,27 +9,27 @@ public interface IFoodStat { /** * Warning the "aPlayer" Parameter may be null! */ - public int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + int getFoodLevel(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - public float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + float getSaturation(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - public boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + boolean alwaysEdible(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - public boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + boolean isRotten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); /** * Warning the "aPlayer" Parameter may be null! */ - public EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack); + EnumAction getFoodAction(GT_MetaBase_Item aItem, ItemStack aStack); - public void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); + void onEaten(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IIconContainer.java b/src/main/java/gregtech/api/interfaces/IIconContainer.java index c8b995e9a7..0b185b387a 100644 --- a/src/main/java/gregtech/api/interfaces/IIconContainer.java +++ b/src/main/java/gregtech/api/interfaces/IIconContainer.java @@ -7,15 +7,15 @@ public interface IIconContainer { /** * @return A regular Icon. */ - public IIcon getIcon(); + IIcon getIcon(); /** * @return Icon of the Overlay (or null if there is no Icon) */ - public IIcon getOverlayIcon(); + IIcon getOverlayIcon(); /** * @return the Default Texture File for this Icon. */ - public ResourceLocation getTextureFile(); + ResourceLocation getTextureFile(); } diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java index 1d75f41e17..32d0c0948a 100644 --- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java +++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java @@ -14,27 +14,27 @@ import net.minecraft.world.World; import java.util.List; public interface IItemBehaviour { - public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity); + boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity); - public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ); + boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ); - public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ); + boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ); - public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer); + ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer); - public List getAdditionalToolTips(E aItem, List aList, ItemStack aStack); + List getAdditionalToolTips(E aItem, List aList, ItemStack aStack); - public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand); + void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand); - public boolean isItemStackUsable(E aItem, ItemStack aStack); + boolean isItemStackUsable(E aItem, ItemStack aStack); - public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack); + boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack); - public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack); + ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack); - public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack); + boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack); - public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); + EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); - public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); + EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IItemContainer.java b/src/main/java/gregtech/api/interfaces/IItemContainer.java index 3c1bd87543..7ce2ad7403 100644 --- a/src/main/java/gregtech/api/interfaces/IItemContainer.java +++ b/src/main/java/gregtech/api/interfaces/IItemContainer.java @@ -5,35 +5,35 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public interface IItemContainer { - public Item getItem(); + Item getItem(); - public Block getBlock(); + Block getBlock(); - public boolean isStackEqual(Object aStack); + boolean isStackEqual(Object aStack); - public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT); + boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT); - public ItemStack get(long aAmount, Object... aReplacements); + ItemStack get(long aAmount, Object... aReplacements); - public ItemStack getWildcard(long aAmount, Object... aReplacements); + ItemStack getWildcard(long aAmount, Object... aReplacements); - public ItemStack getUndamaged(long aAmount, Object... aReplacements); + ItemStack getUndamaged(long aAmount, Object... aReplacements); - public ItemStack getAlmostBroken(long aAmount, Object... aReplacements); + ItemStack getAlmostBroken(long aAmount, Object... aReplacements); - public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements); + ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements); - public IItemContainer set(Item aItem); + IItemContainer set(Item aItem); - public IItemContainer set(ItemStack aStack); + IItemContainer set(ItemStack aStack); - public IItemContainer registerOre(Object... aOreNames); + IItemContainer registerOre(Object... aOreNames); - public IItemContainer registerWildcardAsOre(Object... aOreNames); + IItemContainer registerWildcardAsOre(Object... aOreNames); - public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements); + ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements); - public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements); + ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements); - public boolean hasBeenSet(); + boolean hasBeenSet(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java b/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java index 1f0ec91bba..d10c34ef51 100644 --- a/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java +++ b/src/main/java/gregtech/api/interfaces/IOreRecipeRegistrator.java @@ -12,5 +12,5 @@ public interface IOreRecipeRegistrator { * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based! * @param aStack always != null */ - public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack); + void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IProjectileItem.java b/src/main/java/gregtech/api/interfaces/IProjectileItem.java index 22211a6f0c..6e58d54823 100644 --- a/src/main/java/gregtech/api/interfaces/IProjectileItem.java +++ b/src/main/java/gregtech/api/interfaces/IProjectileItem.java @@ -10,15 +10,15 @@ public interface IProjectileItem { /** * @return if this Item has an Arrow Entity */ - public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack); + boolean hasProjectile(SubTag aProjectileType, ItemStack aStack); /** * @return an Arrow Entity to be spawned. If null then this is not an Arrow. Note: Other Projectiles still extend EntityArrow */ - public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); + EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); /** * @return an Arrow Entity to be spawned. If null then this is not an Arrow. Note: Other Projectiles still extend EntityArrow */ - public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); + EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java b/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java index 8838992c62..73a81cc74b 100644 --- a/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java +++ b/src/main/java/gregtech/api/interfaces/IRedstoneCircuitBlock.java @@ -12,55 +12,55 @@ public interface IRedstoneCircuitBlock { /** * The Output Direction the Circuit Block is Facing */ - public byte getOutputFacing(); + byte getOutputFacing(); /** * sets Output Redstone State at Side */ - public boolean setRedstone(byte aStrength, byte aSide); + boolean setRedstone(byte aStrength, byte aSide); /** * returns Output Redstone State at Side * Note that setRedstone checks if there is a Difference between the old and the new Setting before consuming any Energy */ - public byte getOutputRedstone(byte aSide); + byte getOutputRedstone(byte aSide); /** * returns Input Redstone Signal at Side */ - public byte getInputRedstone(byte aSide); + byte getInputRedstone(byte aSide); /** * If this Side is Covered up and therefor not doing any Redstone */ - public GT_CoverBehavior getCover(byte aSide); + GT_CoverBehavior getCover(byte aSide); - public int getCoverID(byte aSide); + int getCoverID(byte aSide); - public int getCoverVariable(byte aSide); + int getCoverVariable(byte aSide); /** * returns whatever Block-ID is adjacent to the Redstone Circuit Block */ - public Block getBlockAtSide(byte aSide); + Block getBlockAtSide(byte aSide); /** * returns whatever Meta-Value is adjacent to the Redstone Circuit Block */ - public byte getMetaIDAtSide(byte aSide); + byte getMetaIDAtSide(byte aSide); /** * returns whatever TileEntity is adjacent to the Redstone Circuit Block */ - public TileEntity getTileEntityAtSide(byte aSide); + TileEntity getTileEntityAtSide(byte aSide); /** * returns whatever TileEntity is used by the Redstone Circuit Block */ - public ICoverable getOwnTileEntity(); + ICoverable getOwnTileEntity(); /** * returns worldObj.rand.nextInt(aRange) */ - public int getRandom(int aRange); + int getRandom(int aRange); } diff --git a/src/main/java/gregtech/api/interfaces/ISubTagContainer.java b/src/main/java/gregtech/api/interfaces/ISubTagContainer.java index c7ccc45e96..92e4af0469 100644 --- a/src/main/java/gregtech/api/interfaces/ISubTagContainer.java +++ b/src/main/java/gregtech/api/interfaces/ISubTagContainer.java @@ -6,15 +6,15 @@ public interface ISubTagContainer { /** * @return if the Tag is inside the List. */ - public boolean contains(SubTag aTag); + boolean contains(SubTag aTag); /** * @return The ISubTagContainer you called this Function on, for convenience. */ - public ISubTagContainer add(SubTag... aTags); + ISubTagContainer add(SubTag... aTags); /** * @return if the Tag was there before it has been removed. */ - public boolean remove(SubTag aTag); + boolean remove(SubTag aTag); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/ITexture.java b/src/main/java/gregtech/api/interfaces/ITexture.java index 43efeac7c4..9d08713281 100644 --- a/src/main/java/gregtech/api/interfaces/ITexture.java +++ b/src/main/java/gregtech/api/interfaces/ITexture.java @@ -4,17 +4,17 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; public interface ITexture { - public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); - public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); - public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); - public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); - public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); - public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); + void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); - public boolean isValidTexture(); + boolean isValidTexture(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java index 70aaeb206b..d282c02b11 100644 --- a/src/main/java/gregtech/api/interfaces/IToolStats.java +++ b/src/main/java/gregtech/api/interfaces/IToolStats.java @@ -22,107 +22,108 @@ public interface IToolStats { /** * Called when aPlayer crafts this Tool */ - public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer); + void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer); /** * Called when this gets added to a Tool Item */ - public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID); + void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID); /** * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU). */ - public int getToolDamagePerBlockBreak(); + int getToolDamagePerBlockBreak(); /** * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU). */ - public int getToolDamagePerDropConversion(); + int getToolDamagePerDropConversion(); /** * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal. */ - public int getToolDamagePerContainerCraft(); + int getToolDamagePerContainerCraft(); /** * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons. */ - public int getToolDamagePerEntityAttack(); + int getToolDamagePerEntityAttack(); /** * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible. */ - public int getBaseQuality(); + int getBaseQuality(); /** * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch. */ - public float getBaseDamage(); + float getBaseDamage(); /** * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum) */ - public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity); + int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity); /** * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed. */ - public float getSpeedMultiplier(); + float getSpeedMultiplier(); /** * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability. */ - public float getMaxDurabilityMultiplier(); + float getMaxDurabilityMultiplier(); - public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity); + DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity); - public String getMiningSound(); + String getMiningSound(); - public String getCraftingSound(); + String getCraftingSound(); - public String getEntityHitSound(); + String getEntityHitSound(); - public String getBreakingSound(); + String getBreakingSound(); - public Enchantment[] getEnchantments(ItemStack aStack); + Enchantment[] getEnchantments(ItemStack aStack); - public int[] getEnchantmentLevels(ItemStack aStack); + int[] getEnchantmentLevels(ItemStack aStack); /** * @return If this Tool can be used for blocking Damage like a Sword. */ - public boolean canBlock(); + boolean canBlock(); /** * @return If this Tool can be used as an RC Crowbar. */ - public boolean isCrowbar(); + boolean isCrowbar(); /** * @return If this Tool can be used as an FR Grafter. */ - public boolean isGrafter(); + boolean isGrafter(); + + boolean isChainsaw(); - public boolean isChainsaw(); /** * @return If this Tool can be used as an BC Wrench. */ - public boolean isWrench(); - + boolean isWrench(); + /** * @return If this Tool can be used as Weapon i.e. if that is the main purpose. */ - public boolean isWeapon(); + boolean isWeapon(); /** * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something */ - public boolean isRangedWeapon(); + boolean isRangedWeapon(); /** * @return If this Tool can be used as Weapon i.e. if that is the main purpose. */ - public boolean isMiningTool(); + boolean isMiningTool(); /** * aBlock.getHarvestTool(aMetaData) can return the following Values for example. @@ -130,33 +131,33 @@ public interface IToolStats { * * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check. */ - public boolean isMinableBlock(Block aBlock, byte aMetaData); + boolean isMinableBlock(Block aBlock, byte aMetaData); /** * This lets you modify the Drop List, when this type of Tool has been used. * * @return the Amount of modified Items. */ - public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent); + int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent); /** * @return Returns a broken Version of the Item. */ - public ItemStack getBrokenItem(ItemStack aStack); + ItemStack getBrokenItem(ItemStack aStack); /** * @return the Damage actually done to the Mob. */ - public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); + float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); /** * @return the Damage actually done to the Mob. */ - public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); + float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); - public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); + IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); - public short[] getRGBa(boolean aIsToolHead, ItemStack aStack); + short[] getRGBa(boolean aIsToolHead, ItemStack aStack); - public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, int aY, int aZ); + float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, int aX, int aY, int aZ); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java b/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java index 4c1aa49c05..0bb4155214 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_CraftingRecipe.java @@ -3,5 +3,5 @@ package gregtech.api.interfaces.internal; import net.minecraft.item.crafting.IRecipe; public interface IGT_CraftingRecipe extends IRecipe { - public boolean isRemovable(); + boolean isRemovable(); } diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java b/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java index 945c988480..ff7b255f0e 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_Mod.java @@ -13,22 +13,22 @@ public interface IGT_Mod { /** * This means that Server specific Basefiles are definitely existing! Not if the World is actually server side or not! */ - public boolean isServerSide(); + boolean isServerSide(); /** * This means that Client specific Basefiles are definitely existing! Not if the World is actually client side or not! */ - public boolean isClientSide(); + boolean isClientSide(); /** * This means that Bukkit specific Basefiles are definitely existing! Not if the World is actually bukkit server or not! */ - public boolean isBukkitSide(); + boolean isBukkitSide(); /** * works only ClientSide otherwise returns null */ - public EntityPlayer getThePlayer(); + EntityPlayer getThePlayer(); //---------- Internal Usage Only ---------- @@ -37,10 +37,10 @@ public interface IGT_Mod { * * @return the Index of the added Armor */ - public int addArmor(String aArmorPrefix); + int addArmor(String aArmorPrefix); /** * Plays the Sonictron Sound for the ItemStack on the Client Side */ - public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ); + void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java index 40a30ebf8a..a6bc3e2b46 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java +++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java @@ -10,20 +10,20 @@ public interface IGT_RecipeAdder { * Does not work anymore! */ @Deprecated - public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); /** * Adds a FusionreactorRecipe * * @param aInput1 = first Input (not null, and respects StackSize) * @param aInput2 = second Input (not null, and respects StackSize) - * @param aOutput1 = Output of the Fusion (can be null, and respects StackSize) + * @param aOutput1 = Output of the Fusion (can be null, and respects StackSize) * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) * @param aFusionEnergyPerTick = The EU generated per Tick (can even be negative!) * @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); + boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aFusionDurationInTicks, int aFusionEnergyPerTick, int aEnergyNeededForStartingFusion); /** * Adds a Centrifuge Recipe @@ -36,9 +36,9 @@ public interface IGT_RecipeAdder { * @param aOutput4 can be null * @param aDuration must be > 0 */ - public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration); + boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration); - public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); + boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); /** * Adds a Centrifuge Recipe @@ -50,17 +50,17 @@ public interface IGT_RecipeAdder { * @param aOutput4 can be null * @param aDuration must be > 0 */ - public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + + boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); - public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom); /** - * * @param aInput1 must be != null * @param aOutput1 must be != null * @param aDuration must be > 0 * @return */ - public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); + boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Electrolyzer Recipe @@ -74,7 +74,7 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); + boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt); /** * Adds a Electrolyzer Recipe @@ -88,29 +88,29 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); + boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt); /** * Adds a Chemical Recipe * * @param aInput1 must be != null * @param aInput2 must be != null - * @param aOutput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 */ - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration); + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration); - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt); + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Chemical Recipe * * @param aInput1 must be != null * @param aInput2 must be != null - * @param aOutput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 */ - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration); + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration); /** * Adds a Chemical Recipe @@ -122,7 +122,7 @@ public interface IGT_RecipeAdder { * @param aOutput2 must be != null * @param aDuration must be > 0 */ - public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); + boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); /** @@ -134,16 +134,17 @@ public interface IGT_RecipeAdder { * @param aOutput2 must be != null * @param aDuration must be > 0 */ - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration); + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration); /** * Adds Recipes for creating a radically polymerized polymer from a base Material (for example Ethylene -> Polyethylene) - * @param aBasicMaterial The basic Material + * + * @param aBasicMaterial The basic Material * @param aBasicMaterialCell The corresponding Cell basic Material - * @param aPolymer The polymer + * @param aPolymer The polymer */ - public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, ItemStack aBasicMaterialCell, Fluid aPolymer); - + void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, ItemStack aBasicMaterialCell, Fluid aPolymer); + /** * Adds a Chemical Recipe * @@ -153,9 +154,10 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUtick must be > 0 */ - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUtick); + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUtick); + + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom); - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom); /** * Adds a Chemical Recipe * @@ -166,22 +168,23 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUtick must be > 0 */ - public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); + boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick); /** - + * Adds a Chemical Recipe that only exists in the Large Chemical Reactor - + * - + * @param aInputs item inputs - + * @param aFluidInputs fluid inputs - + * @param aFluidOutputs fluid outputs - + * @param aOutputs item outputs - + * @param aDuration must be > 0 - + * @param aEUtick must be > 0 - + * aInputs and aFluidInputs must contain at least one valid input. - + * aOutputs and aFluidOutputs must contain at least one valid output. - + */ + * + * Adds a Chemical Recipe that only exists in the Large Chemical Reactor + * + * + * + * @param aInputs item inputs + * + * @param aFluidInputs fluid inputs + * + * @param aFluidOutputs fluid outputs + * + * @param aOutputs item outputs + * + * @param aDuration must be > 0 + * + * @param aEUtick must be > 0 + * + * aInputs and aFluidInputs must contain at least one valid input. + * + * aOutputs and aFluidOutputs must contain at least one valid output. + * + + */ - public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick); + boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick); /** @@ -196,7 +199,7 @@ public interface IGT_RecipeAdder { * @param aLevel should be > 0 is the minimum Heat Level needed for this Recipe */ @Deprecated - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); /** * Adds a Blast Furnace Recipe @@ -209,20 +212,20 @@ public interface IGT_RecipeAdder { * @param aEUt should be > 0 * @param aLevel should be > 0 is the minimum Heat Level needed for this Recipe */ - public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); /** * Adds a Blast Furnace Recipe * - * @param aInput1 must be != null if aInput2 == null - * @param aInput2 must be != null if aInput1 == null + * @param aInput1 must be != null if aInput2 == null + * @param aInput2 must be != null if aInput1 == null * @param aCoalAmount must be > 0 - * @param aOutput1 must be != null if aOutput2 == null - * @param aOutput2 must be != null if aOutput1 == null - * @param aDuration must be > 0 + * @param aOutput1 must be != null if aOutput2 == null + * @param aOutput2 must be != null if aOutput1 == null + * @param aDuration must be > 0 */ - public boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration); + boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration); /** @@ -233,7 +236,7 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0, 100 ticks is standard. * @param aEUt should be > 0, 1 EU/t is standard. */ - public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); /** * Adds an Alloy Smelter Recipe @@ -245,9 +248,9 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); - public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden); + boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden); /** @@ -258,28 +261,29 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addCNCRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); + boolean addCNCRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds an Assembler Recipe * * @param aInput1 must be != null * @param aOutput1 must be != null - * @param aInput2 must be != null + * @param aInput2 must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); /** - + * Adds an Assembler Recipe - + * - + * @param aInputs must be != null - + * @param aOutput1 must be != null - + * @param aDuration must be > 0 - + * @param aEUt should be > 0 - + */ - public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); + * + * Adds an Assembler Recipe + * + * + * + * @param aInputs must be != null + * + * @param aOutput1 must be != null + * + * @param aDuration must be > 0 + * + * @param aEUt should be > 0 + * + + */ + boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds an Assembler Recipe @@ -289,48 +293,49 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); - public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); - public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); - public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom); + boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom); - public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom); + boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom); /** * Adds an Circuit Assembler Recipe * - * @param aInputs must be 1-6 ItemStacks + * @param aInputs must be 1-6 ItemStacks * @param aFluidInput 0-1 fluids - * @param aOutput must be != null - * @param aDuration must be > 0 - * @param aEUt should be > 0 + * @param aOutput must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 */ - public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt); + boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt); - public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom); + boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom); /** * Adds an Assemblyline Recipe * - * @param aInputs must be != null, 4-16 inputs + * @param aInputs must be != null, 4-16 inputs * @param aFluidInputs 0-4 fluids - * @param aOutput1 must be != null - * @param aDuration must be > 0 - * @param aEUt should be > 0 + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 */ - public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Assemblyline Recipe - * @param aInputs elements should be: ItemStack for single item; - * ItemStack[] for multiple equivalent items; - * {OreDict, amount} for oredict. + * + * @param aInputs elements should be: ItemStack for single item; + * ItemStack[] for multiple equivalent items; + * {OreDict, amount} for oredict. */ - public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); + boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Forge Hammer Recipe @@ -340,70 +345,69 @@ public interface IGT_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); + boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Wiremill Recipe * - * @param aInput must be != null - * @param aOutput must be != null + * @param aInput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Polariser Recipe * - * @param aInput must be != null - * @param aOutput must be != null + * @param aInput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Plate Bending Machine Recipe * - * @param aInput must be != null - * @param aOutput must be != null + * @param aInput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addBenderRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + boolean addBenderRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Extruder Machine Recipe * - * @param aInput must be != null + * @param aInput must be != null * @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item. - * @param aOutput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt); + boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Slicer Machine Recipe * - * @param aInput must be != null + * @param aInput must be != null * @param aShape must be != null, Set the stackSize to 0 if you don't want to let it consume this Item. - * @param aOutput must be != null + * @param aOutput must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addSlicerRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt); + boolean addSlicerRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt); /** - * - * @param aInput must be != null - * @param aFluidInput must be != null - * @param aOutput1 must be != null - * @param aDuration must be > 0 - * @param aEUt should be > 0 + * @param aInput must be != null + * @param aFluidInput must be != null + * @param aOutput1 must be != null + * @param aDuration must be > 0 + * @param aEUt should be > 0 * @return */ - public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt); + boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt); /** * Adds an Implosion Compressor Recipe @@ -413,7 +417,7 @@ public interface IGT_RecipeAdder { * @param aOutput1 must be != null * @param aOutput2 can be null */ - public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2); + boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2); /** * Adds a Grinder Recipe @@ -425,71 +429,71 @@ public interface IGT_RecipeAdder { * @param aOutput3 can be null * @param aOutput4 can be null */ - public boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4); + boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4); /** * Adds a Distillation Tower Recipe * - * @param aInput must be != null + * @param aInput must be != null * @param aOutputs must be != null 1-5 Fluids * @param aOutput2 can be null */ - public boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt); + boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt); - public boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); - public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); - public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidPutput, int[] aChances, int aDuration, int aEUt); + boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidPutput, int[] aChances, int aDuration, int aEUt); /** * Adds a Distillation Tower Recipe */ - public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); + boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); /** * Adds a Lathe Machine Recipe */ - public boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); /** * Adds a Cutter Recipe */ - public boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); /** * Adds Cutter Recipes with default Lubricants */ - public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); - public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom); + boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom); - public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); + boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt); - public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom); + boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom); + + boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial); - public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial); /** * Adds a Boxing Recipe */ - public boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt); + boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt); /** - * - * @param aInput must be != null + * @param aInput must be != null * @param aOutput1 must be != null * @param aDuration must be > 0 * @param aEUt should be > 0 * @return */ - public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt); + boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt); /** * Adds an Unboxing Recipe */ - public boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt); + boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt); /** * Adds a Vacuum Freezer Recipe @@ -498,9 +502,9 @@ public interface IGT_RecipeAdder { * @param aOutput1 must be != null * @param aDuration must be > 0 */ - public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration); + boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration); - public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); + boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); /** * Adds a Fuel for My Generators @@ -510,162 +514,164 @@ public interface IGT_RecipeAdder { * @param aEU EU per MilliBucket. If no Liquid Form of this Container is available, then it will give you EU*1000 per Item. * @param aType 0 = Diesel; 1 = Gas Turbine; 2 = Thermal; 3 = Dense Fluid; 4 = Plasma; 5 = Magic; And if something is unclear or missing, then look at the GT_Recipe-Class */ - public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType); + boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType); /** * Adds an Amplifier Recipe for the Amplifabricator */ - public boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted); + boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted); /** * Adds a Recipe for the Brewing Machine (intentionally limited to Fluid IDs) */ - public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden); + boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden); - public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden); + boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden); - public boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); + boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); /** * Adds a Recipe for the Fermenter */ - public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden); + boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden); - public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUT, boolean aHidden); + boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUT, boolean aHidden); /** * Adds a Recipe for the Fluid Heater */ - public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); + boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); /** * Adds a Recipe for the Distillery */ - public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); + boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); - public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); + boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); - public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); + boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); - public boolean addDistilleryRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); + boolean addDistilleryRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden); /** * Adds a Recipe for the Fluid Solidifier */ - public boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt); + boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Recipe for Fluid Smelting */ - public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt); + boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt); /** * Adds a Recipe for Fluid Smelting */ - public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden); + boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden); /** * Adds a Recipe for Fluid Extraction */ - public boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt); + boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt); /** * Adds a Recipe for the Fluid Canner */ - public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput); + boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput); + + boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt); - public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration,int aEUt); /** * Adds a Recipe for the Chemical Bath */ - public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Electromagnetic Separator */ - public boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); + boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Extractor */ - public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Recipe for the Printer */ - public boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt); + boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Recipe for the Autoclave */ - public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt); + boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt); /** * Adds a Recipe for the Autoclave */ - public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom); + boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom); - public boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom); + boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom); /** * Adds a Recipe for the Mixer */ - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); + boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); + boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); - public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); + boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8, ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Recipe for the Laser Engraver */ - public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt); + boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt); + /** * Adds a Recipe for the Laser Engraver */ - public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom); + boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom); /** * Adds a Recipe for the Forming Press */ - public boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt); + boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt); /** * Adds a Recipe for the Sifter. (up to 9 Outputs) */ - public boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt); + boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Arc Furnace. (up to 4 Outputs) */ - public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Arc Furnace. (up to 4 Outputs) */ - public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden); + boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden); /** * Adds a Recipe for the GT Pulveriser. (up to 4 Outputs) */ - public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); + boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the GT Pulveriser. (up to 4 Outputs) */ - public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden); + boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden); /** * Adds a Distillation Tower Recipe * Every Fluid also gets separate distillation recipes * - * @param aInput must be != null + * @param aInput must be != null * @param aOutputs must be != null 1-5 Fluids * @param aOutput2 can be null */ - public boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt); + boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt); /** * Adds Pyrolyse Recipe @@ -677,7 +683,7 @@ public interface IGT_RecipeAdder { * @param aDuration * @param aEUt */ - public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt); + boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt); /** * Adds Oil Cracking Recipe @@ -689,20 +695,20 @@ public interface IGT_RecipeAdder { */ @Deprecated - public boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); + boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); /** * Adds Oil Cracking Recipe * * @param circuitConfig The circuit configuration to control cracking severity - * @param aInput The fluid to be cracked - * @param aInput2 The fluid to catalyze the cracking (typically Hydrogen or Steam) - * @param aOutput The cracked fluid + * @param aInput The fluid to be cracked + * @param aInput2 The fluid to catalyze the cracking (typically Hydrogen or Steam) + * @param aOutput The cracked fluid * @param aDuration * @param aEUt */ - public boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt); + boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt); /** * Adds a Sound to the Sonictron9001 @@ -712,5 +718,5 @@ public interface IGT_RecipeAdder { * @param aSoundName = The Name of the Sound in the resources/newsound-folder like Vanillasounds * @return true if the Sound got added, otherwise false. */ - public boolean addSonictronSound(ItemStack aItemStack, String aSoundName); + boolean addSonictronSound(ItemStack aItemStack, String aSoundName); } diff --git a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java index 2c1f930835..c4f416c823 100644 --- a/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java +++ b/src/main/java/gregtech/api/interfaces/internal/IThaumcraftCompat.java @@ -8,23 +8,49 @@ import net.minecraft.item.ItemStack; import java.util.List; public interface IThaumcraftCompat { - public static final int RESEARCH_TYPE_NORMAL = 0, RESEARCH_TYPE_SECONDARY = 1, RESEARCH_TYPE_FREE = 2, RESEARCH_TYPE_HIDDEN = 4, RESEARCH_TYPE_VIRTUAL = 8, RESEARCH_TYPE_ROUND = 16, RESEARCH_TYPE_SPECIAL = 32, RESEARCH_TYPE_AUTOUNLOCK = 64; + int + RESEARCH_TYPE_NORMAL = 0, + RESEARCH_TYPE_SECONDARY = 1, + RESEARCH_TYPE_FREE = 2, + RESEARCH_TYPE_HIDDEN = 4, + RESEARCH_TYPE_VIRTUAL = 8, + RESEARCH_TYPE_ROUND = 16, + RESEARCH_TYPE_SPECIAL = 32, + RESEARCH_TYPE_AUTOUNLOCK = 64; /** * The Research Keys of GT */ - public static final String - IRON_TO_STEEL = "GT_IRON_TO_STEEL", FILL_WATER_BUCKET = "GT_FILL_WATER_BUCKET", WOOD_TO_CHARCOAL = "GT_WOOD_TO_CHARCOAL", TRANSZINC = "GT_TRANSZINC", TRANSNICKEL = "GT_TRANSNICKEL", TRANSCOBALT = "GT_TRANSCOBALT", TRANSBISMUTH = "GT_TRANSBISMUTH", TRANSANTIMONY = "GT_TRANSANTIMONY", TRANSCUPRONICKEL = "GT_TRANSCUPRONICKEL", TRANSBATTERYALLOY = "GT_TRANSBATTERYALLOY", TRANSSOLDERINGALLOY = "GT_TRANSSOLDERINGALLOY", TRANSBRASS = "GT_TRANSBRASS", TRANSBRONZE = "GT_TRANSBRONZE", TRANSINVAR = "GT_TRANSINVAR", TRANSELECTRUM = "GT_TRANSELECTRUM", TRANSALUMINIUM = "GT_TRANSALUMINIUM", CRYSTALLISATION = "GT_CRYSTALLISATION", ADVANCEDENTROPICPROCESSING = "GT_ADVANCEDENTROPICPROCESSING", ADVANCEDMETALLURGY = "GT_ADVANCEDMETALLURGY"; - - public boolean registerPortholeBlacklistedBlock(Block aBlock); - - public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List aAspects, boolean aAdditive); - - public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List aAspects, String aOreDict); - - public Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List aAspects); - - public Object addInfusionRecipe(String aResearch, ItemStack aMainInput, ItemStack[] aSideInputs, ItemStack aOutput, int aInstability, List aAspects); - - public Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List aAspects, ItemStack[] aResearchTriggers, Object[] aPages); + String + IRON_TO_STEEL = "GT_IRON_TO_STEEL", + FILL_WATER_BUCKET = "GT_FILL_WATER_BUCKET", + WOOD_TO_CHARCOAL = "GT_WOOD_TO_CHARCOAL", + TRANSZINC = "GT_TRANSZINC", + TRANSNICKEL = "GT_TRANSNICKEL", + TRANSCOBALT = "GT_TRANSCOBALT", + TRANSBISMUTH = "GT_TRANSBISMUTH", + TRANSANTIMONY = "GT_TRANSANTIMONY", + TRANSCUPRONICKEL = "GT_TRANSCUPRONICKEL", + TRANSBATTERYALLOY = "GT_TRANSBATTERYALLOY", + TRANSSOLDERINGALLOY = "GT_TRANSSOLDERINGALLOY", + TRANSBRASS = "GT_TRANSBRASS", + TRANSBRONZE = "GT_TRANSBRONZE", + TRANSINVAR = "GT_TRANSINVAR", + TRANSELECTRUM = "GT_TRANSELECTRUM", + TRANSALUMINIUM = "GT_TRANSALUMINIUM", + CRYSTALLISATION = "GT_CRYSTALLISATION", + ADVANCEDENTROPICPROCESSING = "GT_ADVANCEDENTROPICPROCESSING", + ADVANCEDMETALLURGY = "GT_ADVANCEDMETALLURGY"; + + boolean registerPortholeBlacklistedBlock(Block aBlock); + + boolean registerThaumcraftAspectsToItem(ItemStack aStack, List aAspects, boolean aAdditive); + + boolean registerThaumcraftAspectsToItem(ItemStack aStack, List aAspects, String aOreDict); + + Object addCrucibleRecipe(String aResearch, Object aInput, ItemStack aOutput, List aAspects); + + Object addInfusionRecipe(String aResearch, ItemStack aMainInput, ItemStack[] aSideInputs, ItemStack aOutput, int aInstability, List aAspects); + + Object addResearch(String aResearch, String aName, String aText, String[] aParentResearches, String aCategory, ItemStack aIcon, int aComplexity, int aType, int aX, int aY, List aAspects, ItemStack[] aResearchTriggers, Object[] aPages); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java index 96c03bbd6d..16fe07812f 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IConnectable.java @@ -4,15 +4,16 @@ package gregtech.api.interfaces.metatileentity; * For pipes, wires, and other MetaTiles which need to be decided whether they should connect to the block at each side. */ public interface IConnectable { - /** - * Try to connect to the Block at the specified side - * returns the connection state. Non-positive values for failed, others for succeeded. - */ - public int connect(byte aSide); - /** - * Try to disconnect to the Block at the specified side - */ - public void disconnect(byte aSide); + /** + * Try to connect to the Block at the specified side + * returns the connection state. Non-positive values for failed, others for succeeded. + */ + int connect(byte aSide); - public boolean isConnectedAtSide(int aSide); + /** + * Try to disconnect to the Block at the specified side + */ + void disconnect(byte aSide); + + boolean isConnectedAtSide(int aSide); } diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index e973301395..a518b3baaf 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -389,7 +389,7 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand void onColorChangeClient(byte aColor); int getLightOpacity(); - + boolean allowGeneralRedstoneOutput(); void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider); @@ -402,9 +402,9 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand * The onCreated Function of the Item Class redirects here */ void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer); - + boolean hasAlternativeModeText(); - + String getAlternativeModeText(); boolean shouldJoinIc2Enet(); diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java index ead9c8bf8f..a7c1209d24 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityCable.java @@ -7,9 +7,9 @@ import java.util.HashSet; public interface IMetaTileEntityCable extends IMetaTileEntity { @Deprecated - public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList); + long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList aAlreadyPassedTileEntityList); - default public long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet aAlreadyPassedSet) { + default long transferElectricity(byte aSide, long aVoltage, long aAmperage, HashSet aAlreadyPassedSet) { return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<>(aAlreadyPassedSet)); } } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java index 7187ccb04b..b61fe99904 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java @@ -10,12 +10,12 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { /** * @return if this Pipe can still be used. */ - public boolean pipeCapacityCheck(); + boolean pipeCapacityCheck(); /** * @return if this Pipe can still be used. */ - public boolean incrementTransferCounter(int aIncrement); + boolean incrementTransferCounter(int aIncrement); /** * Sends an ItemStack from aSender to the adjacent Blocks. @@ -23,7 +23,7 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { * @param aSender the BaseMetaTileEntity sending the Stack. * @return if it was able to send something */ - public boolean sendItemStack(Object aSender); + boolean sendItemStack(Object aSender); /** * Executes the Sending Code for inserting Stacks into the TileEntities. @@ -32,19 +32,19 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { * @param aSide the Side of the PIPE facing the TileEntity. * @return if this Side was allowed to Output into the Block. */ - public boolean insertItemStackIntoTileEntity(Object aSender, byte aSide); + boolean insertItemStackIntoTileEntity(Object aSender, byte aSide); /** * Can be used to make flow control Pipes, like Redpowers Restriction Tubes. * Every normal Pipe returns a Value of 32768, so you can easily insert lower Numbers to set Routing priorities. * Negative Numbers to "suck" Items into a certain direction are also possible. */ - public int getStepSize(); + int getStepSize(); /** * Utility for the Item Network */ - public static class Util { + class Util { /** * @return a List of connected Item Pipes */ @@ -55,7 +55,8 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { IGregTechTileEntity aBaseMetaTileEntity = aMetaTileEntity.getBaseMetaTileEntity(); aMap.put(aMetaTileEntity, aStep); for (byte i = 0, j = 0; i < 6; i++) { - if (aMetaTileEntity instanceof IConnectable && !((IConnectable) aMetaTileEntity).isConnectedAtSide(i)) continue; + if (aMetaTileEntity instanceof IConnectable && !((IConnectable) aMetaTileEntity).isConnectedAtSide(i)) + continue; j = GT_Utility.getOppositeSide(i); if (aSuckItems) { if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsItemsIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), -2, aBaseMetaTileEntity)) { diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java b/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java index 423b3d4379..b795c793bc 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IBasicEnergyContainer.java @@ -9,83 +9,83 @@ public interface IBasicEnergyContainer extends IEnergyConnected { * It is used for checking the contained Energy before consuming it. * If this returns false, it will also give a Message inside the Scanner, that this Machine doesn't have enough Energy. */ - public boolean isUniversalEnergyStored(long aEnergyAmount); + boolean isUniversalEnergyStored(long aEnergyAmount); /** * Gets the stored electric, kinetic or steam Energy (with EU as reference Value) * Always returns the largest one. */ - public long getUniversalEnergyStored(); + long getUniversalEnergyStored(); /** * Gets the largest electric, kinetic or steam Energy Capacity (with EU as reference Value) */ - public long getUniversalEnergyCapacity(); + long getUniversalEnergyCapacity(); /** * Gets the amount of Energy Packets per tick. */ - public long getOutputAmperage(); + long getOutputAmperage(); /** * Gets the Output in EU/p. */ - public long getOutputVoltage(); + long getOutputVoltage(); /** * Gets the amount of Energy Packets per tick. */ - public long getInputAmperage(); + long getInputAmperage(); /** * Gets the maximum Input in EU/p. */ - public long getInputVoltage(); + long getInputVoltage(); /** * Decreases the Amount of stored universal Energy. If ignoring too less Energy, then it just sets the Energy to 0 and returns false. */ - public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy); + boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy); /** * Increases the Amount of stored electric Energy. If ignoring too much Energy, then the Energy Limit is just being ignored. */ - public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy); + boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy); /** * Drain Energy Call for Electricity. */ - public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage); + boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage); /** * returns the amount of Electricity, accepted by this Block the last 5 ticks as Average. */ - public long getAverageElectricInput(); + long getAverageElectricInput(); /** * returns the amount of Electricity, outputted by this Block the last 5 ticks as Average. */ - public long getAverageElectricOutput(); + long getAverageElectricOutput(); /** * returns the amount of electricity contained in this Block, in EU units! */ - public long getStoredEU(); + long getStoredEU(); /** * returns the amount of electricity containable in this Block, in EU units! */ - public long getEUCapacity(); + long getEUCapacity(); /** * returns the amount of Steam contained in this Block, in EU units! */ - public long getStoredSteam(); + long getStoredSteam(); /** * returns the amount of Steam containable in this Block, in EU units! */ - public long getSteamCapacity(); + long getSteamCapacity(); /** * Increases stored Energy. Energy Base Value is in EU, even though it's Steam! @@ -96,5 +96,5 @@ public interface IBasicEnergyContainer extends IEnergyConnected { *

* And yes, you can't directly decrease the Steam of a Machine. That is done by decreaseStoredEnergyUnits */ - public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy); + boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java index 6b69911ad2..ddbb550dfc 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java @@ -4,12 +4,12 @@ public interface IColoredTileEntity { /** * @return 0 - 15 are Colors, while -1 means uncolored */ - public byte getColorization(); + byte getColorization(); /** * Sets the Color Modulation of the Block * * @param aColor the Color you want to set it to. -1 for reset. */ - public byte setColorization(byte aColor); + byte setColorization(byte aColor); } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java index 99ec88c149..912dc554c0 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/ICoverable.java @@ -4,41 +4,41 @@ import gregtech.api.util.GT_CoverBehavior; import net.minecraft.item.ItemStack; public interface ICoverable extends IRedstoneTileEntity, IHasInventory, IBasicEnergyContainer { - public boolean canPlaceCoverIDAtSide(byte aSide, int aID); + boolean canPlaceCoverIDAtSide(byte aSide, int aID); - public boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover); + boolean canPlaceCoverItemAtSide(byte aSide, ItemStack aCover); - public boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced); + boolean dropCover(byte aSide, byte aDroppedSide, boolean aForced); - public void setCoverDataAtSide(byte aSide, int aData); + void setCoverDataAtSide(byte aSide, int aData); - public void setCoverIDAtSide(byte aSide, int aID); + void setCoverIDAtSide(byte aSide, int aID); - public void setCoverItemAtSide(byte aSide, ItemStack aCover); + void setCoverItemAtSide(byte aSide, ItemStack aCover); - public int getCoverDataAtSide(byte aSide); + int getCoverDataAtSide(byte aSide); - public int getCoverIDAtSide(byte aSide); + int getCoverIDAtSide(byte aSide); - public ItemStack getCoverItemAtSide(byte aSide); + ItemStack getCoverItemAtSide(byte aSide); - public GT_CoverBehavior getCoverBehaviorAtSide(byte aSide); + GT_CoverBehavior getCoverBehaviorAtSide(byte aSide); /** * For use by the regular MetaTileEntities. Returns the Cover Manipulated input Redstone. * Don't use this if you are a Cover Behavior. Only for MetaTileEntities. */ - public byte getInternalInputRedstoneSignal(byte aSide); + byte getInternalInputRedstoneSignal(byte aSide); /** * For use by the regular MetaTileEntities. This makes it not conflict with Cover based Redstone Signals. * Don't use this if you are a Cover Behavior. Only for MetaTileEntities. */ - public void setInternalOutputRedstoneSignal(byte aSide, byte aStrength); + void setInternalOutputRedstoneSignal(byte aSide, byte aStrength); /** * Causes a general Cover Texture update. * Sends 6 Integers to Client + causes @issueTextureUpdate() */ - public void issueCoverUpdate(byte aSide); + void issueCoverUpdate(byte aSide); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java b/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java index 8f55b75fcf..d7c39c900c 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IDigitalChest.java @@ -11,21 +11,21 @@ public interface IDigitalChest extends IHasWorldObjectAndCoords { * I need things like this Function for MetaTileEntities, you MUST check this!!! * Do not assume that it's a Digital Chest or similar Device, when it just implements this Interface. */ - public boolean isDigitalChest(); + boolean isDigitalChest(); /** * Gives an Array of Stacks with Size (of all the Data-stored Items) of the correspondent Item kinds (regular QChests have only one) * Does NOT include the 64 "ready" Items inside the Slots, and neither the 128 Items in the overflow Buffer. */ - public ItemStack[] getStoredItemData(); + ItemStack[] getStoredItemData(); /** * A generic Interface for just setting the amount of contained Items */ - public void setItemCount(int aCount); + void setItemCount(int aCount); /** * Gets the maximum Item count for this QChest alike Storage. This applies to the Data-Storage, not for the up to 192 buffered Items! */ - public int getMaxItemCount(); + int getMaxItemCount(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java index 2384678529..32fd276600 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConductor.java @@ -11,30 +11,30 @@ public interface IEnergyConductor extends IEnergyConnected { /** * @return if this is actually a Cable. (you must check this) */ - public boolean isConductor(); + boolean isConductor(); /** * @return the maximum Voltage of the Cable. */ - public long getMaxVoltage(); + long getMaxVoltage(); /** * @return the maximum Amperage of the Cable, per Wire. */ - public long getMaxAmperage(); + long getMaxAmperage(); /** * @return the Loss of the Cable, per Meter. */ - public long getLossPerMeter(); + long getLossPerMeter(); /** * @return the Material the Cable consists of. (may return Materials._NULL) */ - public Materials getCableMaterial(); + Materials getCableMaterial(); /** * @return the Material the Cable Insulation consists of. (may return Materials._NULL) */ - public Materials getInsulationMaterial(); + Materials getInsulationMaterial(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java index 73436e3b2a..47bec844ee 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IEnergyConnected.java @@ -29,28 +29,30 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd * @param aSide 0 - 5 = Vanilla Directions of YOUR Block the Energy gets inserted to. 6 = No specific Side (don't do Side checks for this Side) * @return amount of used Amperes. 0 if not accepted anything. */ - public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage); + long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage); /** * Sided Energy Input */ - public boolean inputEnergyFrom(byte aSide); - default public boolean inputEnergyFrom(byte aSide, boolean waitForActive) { + boolean inputEnergyFrom(byte aSide); + + default boolean inputEnergyFrom(byte aSide, boolean waitForActive) { return inputEnergyFrom(aSide); } /** * Sided Energy Output */ - public boolean outputsEnergyTo(byte aSide); - default public boolean outputsEnergyTo(byte aSide, boolean waitForActive) { + boolean outputsEnergyTo(byte aSide); + + default boolean outputsEnergyTo(byte aSide, boolean waitForActive) { return outputsEnergyTo(aSide); } /** * Utility for the Network */ - public static class Util { + class Util { /** * Emits Energy to the E-net. Also compatible with adjacent IC2 TileEntities. * @@ -84,33 +86,33 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd if (rfOut > 32L * GregTech_API.mEUtoRF / 100L) { int aExplosionPower = rfOut; float tStrength = - aExplosionPower < V[0] ? 1.0F : - aExplosionPower < V[1] ? 2.0F : - aExplosionPower < V[2] ? 3.0F : - aExplosionPower < V[3] ? 4.0F : - aExplosionPower < V[4] ? 5.0F : - aExplosionPower < V[4] * 2 ? 6.0F : - aExplosionPower < V[5] ? 7.0F : - aExplosionPower < V[6] ? 8.0F : - aExplosionPower < V[7] ? 9.0F : - aExplosionPower < V[8] ? 10.0F : - aExplosionPower < V[8] * 2 ? 11.0F : - aExplosionPower < V[9] ? 12.0F : - aExplosionPower < V[10] ? 13.0F : - aExplosionPower < V[11] ? 14.0F : - aExplosionPower < V[12] ? 15.0F : - aExplosionPower < V[12] * 2 ? 16.0F : - aExplosionPower < V[13] ? 17.0F : - aExplosionPower < V[14] ? 18.0F : - aExplosionPower < V[15] ? 19.0F : 20.0F; + aExplosionPower < V[0] ? 1.0F : + aExplosionPower < V[1] ? 2.0F : + aExplosionPower < V[2] ? 3.0F : + aExplosionPower < V[3] ? 4.0F : + aExplosionPower < V[4] ? 5.0F : + aExplosionPower < V[4] * 2 ? 6.0F : + aExplosionPower < V[5] ? 7.0F : + aExplosionPower < V[6] ? 8.0F : + aExplosionPower < V[7] ? 9.0F : + aExplosionPower < V[8] ? 10.0F : + aExplosionPower < V[8] * 2 ? 11.0F : + aExplosionPower < V[9] ? 12.0F : + aExplosionPower < V[10] ? 13.0F : + aExplosionPower < V[11] ? 14.0F : + aExplosionPower < V[12] ? 15.0F : + aExplosionPower < V[12] * 2 ? 16.0F : + aExplosionPower < V[13] ? 17.0F : + aExplosionPower < V[14] ? 18.0F : + aExplosionPower < V[15] ? 19.0F : 20.0F; int tX = tTileEntity.xCoord, tY = tTileEntity.yCoord, tZ = tTileEntity.zCoord; World tWorld = tTileEntity.getWorldObj(); GT_Utility.sendSoundToPlayers(tWorld, GregTech_API.sSoundList.get(209), 1.0F, -1, tX, tY, tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) - if(GT_Mod.gregtechproxy.mPollution) - GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX,tZ), 100000); - tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); + if (GT_Mod.gregtechproxy.mPollution) + GT_Pollution.addPollution(tWorld.getChunkFromBlockCoords(tX, tZ), 100000); + tWorld.createExplosion(null, tX + 0.5, tY + 0.5, tZ + 0.5, tStrength, true); } } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java index 7e86701f6b..3a32a557fb 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IExperimentalEnergyTileEntity.java @@ -25,22 +25,22 @@ public interface IExperimentalEnergyTileEntity extends IColoredTileEntity, IHasW * @param aSide 0 - 5 = Vanilla Directions of YOUR Block the Energy gets inserted to. 6 = No specific Side (don't do Side checks for this Side) * @return amount of used Amperes. 0 if not accepted anything. */ - public long injectEnergy(SubTag aEnergyType, byte aSide, long aPrimary, long aSecondary); + long injectEnergy(SubTag aEnergyType, byte aSide, long aPrimary, long aSecondary); /** * Sided Energy Input */ - public boolean inputEnergyFrom(SubTag aEnergyType, byte aSide); + boolean inputEnergyFrom(SubTag aEnergyType, byte aSide); /** * Sided Energy Output */ - public boolean outputsEnergyTo(SubTag aEnergyType, byte aSide); + boolean outputsEnergyTo(SubTag aEnergyType, byte aSide); /** * Utility for the Network */ - public static class Util { + class Util { public static int RF_PER_EU = 4; private static boolean RF_ENERGY = false, IC_ENERGY = false, CHECK_ALL = true; diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java b/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java index edcf5bdb89..bde86524c5 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IFibreConnected.java @@ -7,25 +7,25 @@ public interface IFibreConnected extends IColoredTileEntity, IHasWorldObjectAndC /** * If this Blocks accepts Fibre from this Side */ - public void inputFibreFrom(byte aSide); + void inputFibreFrom(byte aSide); /** * If this Blocks emits Fibre to this Side */ - public void outputsFibreTo(byte aSide); + void outputsFibreTo(byte aSide); /** * Sets the Signal this Blocks outputs to this Fibre Color */ - public void setFibreOutput(byte aSide, byte aColor, byte aRedstoneStrength); + void setFibreOutput(byte aSide, byte aColor, byte aRedstoneStrength); /** * Gets the Signal this Blocks outputs to this Fibre Color */ - public byte getFibreOutput(byte aSide, byte aColor); + byte getFibreOutput(byte aSide, byte aColor); /** * Gets the Signal this Blocks receives from this Fibre Color */ - public byte getFibreInput(byte aSide, byte aColor); + byte getFibreInput(byte aSide, byte aColor); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java index 796f0a11b3..54fe151cb1 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGearEnergyTileEntity.java @@ -5,7 +5,7 @@ public interface IGearEnergyTileEntity { * If Rotation Energy can be accepted on this Side. * This means that the Gear/Axle will connect to this Side, and can cause the Gear/Axle to stop if the Energy isn't accepted. */ - public boolean acceptsRotationalEnergy(byte aSide); + boolean acceptsRotationalEnergy(byte aSide); /** * Inject Energy Call for Rotational Energy. @@ -13,5 +13,5 @@ public interface IGearEnergyTileEntity { * * @param aSpeed Positive = Clockwise, Negative = Counterclockwise */ - public boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy); + boolean injectRotationalEnergy(byte aSide, long aSpeed, long aEnergy); } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java index e4bb4f1371..39c779e69c 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechDeviceInformation.java @@ -9,7 +9,7 @@ public interface IGregTechDeviceInformation { * I need things like this Function for MetaTileEntities, you MUST check this!!! * Do not assume that it's a Information returning Device, when it just implements this Interface. */ - public boolean isGivingInformation(); + boolean isGivingInformation(); /** * Up to 8 Strings can be returned. @@ -17,5 +17,5 @@ public interface IGregTechDeviceInformation { * * @return an Array of Information Strings. Don't return null! */ - public String[] getInfoData(); + String[] getInfoData(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java index 8bd8c5b678..af9ead9543 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java @@ -25,27 +25,27 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil /** * gets the Error displayed on the GUI */ - public int getErrorDisplayID(); + int getErrorDisplayID(); /** * sets the Error displayed on the GUI */ - public void setErrorDisplayID(int aErrorID); + void setErrorDisplayID(int aErrorID); /** * @return the MetaID of the Block or the MetaTileEntity ID. */ - public int getMetaTileID(); + int getMetaTileID(); /** * Internal Usage only! */ - public int setMetaTileID(short aID); + int setMetaTileID(short aID); /** * @return the MetaTileEntity which is belonging to this, or null if it doesnt has one. */ - public IMetaTileEntity getMetaTileEntity(); + IMetaTileEntity getMetaTileEntity(); /** * Sets the MetaTileEntity. @@ -54,54 +54,54 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil * * @param aMetaTileEntity */ - public void setMetaTileEntity(IMetaTileEntity aMetaTileEntity); + void setMetaTileEntity(IMetaTileEntity aMetaTileEntity); /** * Causes a general Texture update. *

* Only used Client Side to mark Blocks dirty. */ - public void issueTextureUpdate(); + void issueTextureUpdate(); /** * Causes the Machine to send its initial Data, like Covers and its ID. */ - public void issueClientUpdate(); + void issueClientUpdate(); /** * causes Explosion. Strength in Overload-EU */ - public void doExplosion(long aExplosionEU); + void doExplosion(long aExplosionEU); /** * Sets the Block on Fire in all 6 Directions */ - public void setOnFire(); + void setOnFire(); /** * Sets the Block to Fire */ - public void setToFire(); + void setToFire(); /** * Sets the Owner of the Machine. Returns the set Name. */ - public String setOwnerName(String aName); + String setOwnerName(String aName); /** * gets the Name of the Machines Owner or "Player" if not set. */ - public String getOwnerName(); + String getOwnerName(); /** * Gets the UniqueID of the Machines Owner. */ - public UUID getOwnerUuid(); + UUID getOwnerUuid(); /** * Sets the UniqueID of the Machines Owner. */ - public void setOwnerUuid(UUID uuid); + void setOwnerUuid(UUID uuid); /** * Sets initial Values from NBT @@ -109,30 +109,30 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil * @param aNBT is the NBTTag of readFromNBT * @param aID is the MetaTileEntityID */ - public void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID); + void setInitialValuesAsNBT(NBTTagCompound aNBT, short aID); /** * Called when leftclicking the TileEntity */ - public void onLeftclick(EntityPlayer aPlayer); + void onLeftclick(EntityPlayer aPlayer); /** * Called when rightclicking the TileEntity */ - public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float par1, float par2, float par3); + boolean onRightclick(EntityPlayer aPlayer, byte aSide, float par1, float par2, float par3); - public float getBlastResistance(byte aSide); + float getBlastResistance(byte aSide); - public ArrayList getDrops(); + ArrayList getDrops(); /** * 255 = 100% */ - public int getLightOpacity(); + int getLightOpacity(); - public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider); + void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider); - public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); + AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); - public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider); + void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java b/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java index 3bd8b0429c..42df520ff4 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IHasInventory.java @@ -8,12 +8,12 @@ public interface IHasInventory extends ISidedInventory, IHasWorldObjectAndCoords /** * if the Inventory of this TileEntity got modified this tick */ - public boolean hasInventoryBeenModified(); + boolean hasInventoryBeenModified(); /** * if this is just a Holoslot */ - public boolean isValidSlot(int aIndex); + boolean isValidSlot(int aIndex); /** * Tries to add a Stack to the Slot. @@ -21,7 +21,7 @@ public interface IHasInventory extends ISidedInventory, IHasWorldObjectAndCoords * * @return true if aStack == null, then false if aIndex is out of bounds, then false if aStack cannot be added, and then true if aStack has been added */ - public boolean addStackToSlot(int aIndex, ItemStack aStack); + boolean addStackToSlot(int aIndex, ItemStack aStack); /** * Tries to add X Items of a Stack to the Slot. @@ -29,5 +29,5 @@ public interface IHasInventory extends ISidedInventory, IHasWorldObjectAndCoords * * @return true if aStack == null, then false if aIndex is out of bounds, then false if aStack cannot be added, and then true if aStack has been added */ - public boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount); + boolean addStackToSlot(int aIndex, ItemStack aStack, int aAmount); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java index c86ac0f33f..9b7489cf00 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java @@ -17,153 +17,153 @@ import net.minecraftforge.fluids.IFluidHandler; * Note: It doesn't have to be a TileEntity in certain cases! And only certain cases, such as the Recipe checking of the findRecipe Function. */ public interface IHasWorldObjectAndCoords { - public World getWorld(); + World getWorld(); - public int getXCoord(); + int getXCoord(); - public short getYCoord(); + short getYCoord(); - public int getZCoord(); + int getZCoord(); - public boolean isServerSide(); + boolean isServerSide(); - public boolean isClientSide(); + boolean isClientSide(); - public int getRandomNumber(int aRange); + int getRandomNumber(int aRange); - public TileEntity getTileEntity(int aX, int aY, int aZ); + TileEntity getTileEntity(int aX, int aY, int aZ); - public TileEntity getTileEntityOffset(int aX, int aY, int aZ); + TileEntity getTileEntityOffset(int aX, int aY, int aZ); - public TileEntity getTileEntityAtSide(byte aSide); + TileEntity getTileEntityAtSide(byte aSide); - public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance); + TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance); - public IInventory getIInventory(int aX, int aY, int aZ); + IInventory getIInventory(int aX, int aY, int aZ); - public IInventory getIInventoryOffset(int aX, int aY, int aZ); + IInventory getIInventoryOffset(int aX, int aY, int aZ); - public IInventory getIInventoryAtSide(byte aSide); + IInventory getIInventoryAtSide(byte aSide); - public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance); + IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance); - public IFluidHandler getITankContainer(int aX, int aY, int aZ); + IFluidHandler getITankContainer(int aX, int aY, int aZ); - public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ); + IFluidHandler getITankContainerOffset(int aX, int aY, int aZ); - public IFluidHandler getITankContainerAtSide(byte aSide); + IFluidHandler getITankContainerAtSide(byte aSide); - public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance); + IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance); - public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ); + IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ); - public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ); + IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ); - public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide); + IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide); - public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance); + IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance); - public Block getBlock(int aX, int aY, int aZ); + Block getBlock(int aX, int aY, int aZ); - public Block getBlockOffset(int aX, int aY, int aZ); + Block getBlockOffset(int aX, int aY, int aZ); - public Block getBlockAtSide(byte aSide); + Block getBlockAtSide(byte aSide); - public Block getBlockAtSideAndDistance(byte aSide, int aDistance); + Block getBlockAtSideAndDistance(byte aSide, int aDistance); - public byte getMetaID(int aX, int aY, int aZ); + byte getMetaID(int aX, int aY, int aZ); - public byte getMetaIDOffset(int aX, int aY, int aZ); + byte getMetaIDOffset(int aX, int aY, int aZ); - public byte getMetaIDAtSide(byte aSide); + byte getMetaIDAtSide(byte aSide); - public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance); + byte getMetaIDAtSideAndDistance(byte aSide, int aDistance); - public byte getLightLevel(int aX, int aY, int aZ); + byte getLightLevel(int aX, int aY, int aZ); - public byte getLightLevelOffset(int aX, int aY, int aZ); + byte getLightLevelOffset(int aX, int aY, int aZ); - public byte getLightLevelAtSide(byte aSide); + byte getLightLevelAtSide(byte aSide); - public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance); + byte getLightLevelAtSideAndDistance(byte aSide, int aDistance); - public boolean getOpacity(int aX, int aY, int aZ); + boolean getOpacity(int aX, int aY, int aZ); - public boolean getOpacityOffset(int aX, int aY, int aZ); + boolean getOpacityOffset(int aX, int aY, int aZ); - public boolean getOpacityAtSide(byte aSide); + boolean getOpacityAtSide(byte aSide); - public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance); + boolean getOpacityAtSideAndDistance(byte aSide, int aDistance); - public boolean getSky(int aX, int aY, int aZ); + boolean getSky(int aX, int aY, int aZ); - public boolean getSkyOffset(int aX, int aY, int aZ); + boolean getSkyOffset(int aX, int aY, int aZ); - public boolean getSkyAtSide(byte aSide); + boolean getSkyAtSide(byte aSide); - public boolean getSkyAtSideAndDistance(byte aSide, int aDistance); + boolean getSkyAtSideAndDistance(byte aSide, int aDistance); - public boolean getAir(int aX, int aY, int aZ); + boolean getAir(int aX, int aY, int aZ); - public boolean getAirOffset(int aX, int aY, int aZ); + boolean getAirOffset(int aX, int aY, int aZ); - public boolean getAirAtSide(byte aSide); + boolean getAirAtSide(byte aSide); - public boolean getAirAtSideAndDistance(byte aSide, int aDistance); + boolean getAirAtSideAndDistance(byte aSide, int aDistance); - public BiomeGenBase getBiome(); + BiomeGenBase getBiome(); - public BiomeGenBase getBiome(int aX, int aZ); + BiomeGenBase getBiome(int aX, int aZ); - public int getOffsetX(byte aSide, int aMultiplier); + int getOffsetX(byte aSide, int aMultiplier); - public short getOffsetY(byte aSide, int aMultiplier); + short getOffsetY(byte aSide, int aMultiplier); - public int getOffsetZ(byte aSide, int aMultiplier); + int getOffsetZ(byte aSide, int aMultiplier); /** * Checks if the TileEntity is Invalid or Unloaded. Stupid Minecraft cannot do that btw. */ - public boolean isDead(); + boolean isDead(); /** * Sends a Block Event to the Client TileEntity, the byte Parameters are only for validation as Minecraft doesn't properly write Packet Data. */ - public void sendBlockEvent(byte aID, byte aValue); + void sendBlockEvent(byte aID, byte aValue); /** * @return the Time this TileEntity has been loaded. */ - public long getTimer(); + long getTimer(); /** * Sets the Light Level of this Block on a Scale of 0 - 15 * It could be that it doesn't work. This is just for convenience. */ - public void setLightValue(byte aLightValue); + void setLightValue(byte aLightValue); /** * Function of the regular TileEntity */ - public void writeToNBT(NBTTagCompound aNBT); + void writeToNBT(NBTTagCompound aNBT); /** * Function of the regular TileEntity */ - public void readFromNBT(NBTTagCompound aNBT); + void readFromNBT(NBTTagCompound aNBT); /** * Function of the regular TileEntity */ - public boolean isInvalidTileEntity(); + boolean isInvalidTileEntity(); /** * Opens the GUI with this ID of this MetaTileEntity */ - public boolean openGUI(EntityPlayer aPlayer, int aID); + boolean openGUI(EntityPlayer aPlayer, int aID); /** * Opens the GUI with the ID = 0 of this TileEntity */ - public boolean openGUI(EntityPlayer aPlayer); + boolean openGUI(EntityPlayer aPlayer); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java index bb34419357..c7f6fe5f23 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java @@ -12,5 +12,5 @@ public interface IMachineBlockUpdateable { * I suggest to wait 1-5 seconds before actually checking the Machine Parts. * RP-Frames could for example cause Problems when you instacheck the Machine Parts. */ - public void onMachineBlockUpdate(); + void onMachineBlockUpdate(); } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java index 00bb7b9a7d..588158d16c 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineProgress.java @@ -7,63 +7,63 @@ public interface IMachineProgress extends IHasWorldObjectAndCoords { /** * returns the Progress this Machine has made. Warning, this can also be negative! */ - public int getProgress(); + int getProgress(); /** * returns the Progress the Machine needs to complete its task. */ - public int getMaxProgress(); + int getMaxProgress(); /** * increases the Progress of the Machine */ - public boolean increaseProgress(int aProgressAmountInTicks); + boolean increaseProgress(int aProgressAmountInTicks); /** * returns if the Machine currently does something. */ - public boolean hasThingsToDo(); + boolean hasThingsToDo(); /** * returns if the Machine just got enableWorking called after being disabled. * Used for Translocators, which need to check if they need to transfer immediately. */ - public boolean hasWorkJustBeenEnabled(); + boolean hasWorkJustBeenEnabled(); /** * allows Machine to work */ - public void enableWorking(); + void enableWorking(); /** * disallows Machine to work */ - public void disableWorking(); + void disableWorking(); /** * if the Machine is allowed to Work */ - public boolean isAllowedToWork(); + boolean isAllowedToWork(); /** * used to control Machines via Redstone Signal Strength by special Covers * In case of 0 the Machine is very likely doing nothing, or is just not being controlled at all. */ - public byte getWorkDataValue(); + byte getWorkDataValue(); /** * used to control Machines via Redstone Signal Strength by special Covers * only Values between 0 and 15! */ - public void setWorkDataValue(byte aValue); + void setWorkDataValue(byte aValue); /** * gives you the Active Status of the Machine */ - public boolean isActive(); + boolean isActive(); /** * sets the visible Active Status of the Machine */ - public void setActive(boolean aActive); + void setActive(boolean aActive); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java index 6618e4b4fd..909f4077f0 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IPipeRenderedTileEntity.java @@ -3,9 +3,9 @@ package gregtech.api.interfaces.tileentity; import gregtech.api.interfaces.ITexture; public interface IPipeRenderedTileEntity extends ICoverable, ITexturedTileEntity { - public float getThickNess(); + float getThickNess(); - public byte getConnections(); + byte getConnections(); - public ITexture[] getTextureUncovered(byte aSide); + ITexture[] getTextureUncovered(byte aSide); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java index f5b0f76bad..8c644be2e6 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneReceiver.java @@ -10,20 +10,20 @@ public interface IRedstoneReceiver extends IHasWorldObjectAndCoords { * Do not use this if ICoverable is implemented. ICoverable has @getInternalInputRedstoneSignal for Machine internal Input Redstone * This returns the true incoming Redstone Signal. Only Cover Behaviors should check it, not MetaTileEntities. */ - public byte getInputRedstoneSignal(byte aSide); + byte getInputRedstoneSignal(byte aSide); /** * gets the strongest Redstone Level the TileEntity receives */ - public byte getStrongestRedstone(); + byte getStrongestRedstone(); /** * gets if the TileEntity receives Redstone */ - public boolean getRedstone(); + boolean getRedstone(); /** * gets if the TileEntity receives Redstone at this Side */ - public boolean getRedstone(byte aSide); + boolean getRedstone(byte aSide); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java index f1cf01d291..6100572a7d 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IRedstoneTileEntity.java @@ -13,5 +13,5 @@ public interface IRedstoneTileEntity extends IRedstoneEmitter, IRedstoneReceiver * Causes a general Block update. * Sends nothing to Client, just causes a Block Update. */ - public void issueBlockUpdate(); + void issueBlockUpdate(); } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java index 048ddbdd06..b16ae65548 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/ITexturedTileEntity.java @@ -7,5 +7,5 @@ public interface ITexturedTileEntity { /** * @return the Textures rendered by the GT Rendering */ - public ITexture[] getTexture(Block aBlock, byte aSide); + ITexture[] getTexture(Block aBlock, byte aSide); } \ No newline at end of file -- cgit From 9bef8b3a8a8270db9c289c05c998e71273ca20fc Mon Sep 17 00:00:00 2001 From: Technus Date: Wed, 15 Apr 2020 19:01:06 +0200 Subject: Refactor to fixed thread pool executor Use actually something made for this task... --- src/main/java/gregtech/GT_Mod.java | 5 +- .../interfaces/metatileentity/IMetaTileEntity.java | 26 ++- .../interfaces/tileentity/IGregTechTileEntity.java | 21 ++ .../tileentity/IMachineBlockUpdateable.java | 7 + .../api/metatileentity/BaseMetaPipeEntity.java | 11 ++ .../api/metatileentity/BaseMetaTileEntity.java | 11 ++ .../api/metatileentity/MetaPipeEntity.java | 4 + .../api/metatileentity/MetaTileEntity.java | 1 - .../implementations/GT_MetaPipeEntity_Frame.java | 5 + .../threads/GT_Runnable_MachineBlockUpdate.java | 217 ++++++++------------- 10 files changed, 161 insertions(+), 147 deletions(-) (limited to 'src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 9272ed20e2..22b677337e 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -1189,7 +1189,7 @@ public class GT_Mod implements IGT_Mod { aEvent.registerServerCommand(new GT_Command()); //Sets a new Machine Block Update Thread everytime a world is loaded - GT_Runnable_MachineBlockUpdate.initThread(); + GT_Runnable_MachineBlockUpdate.initExecutorService(); } public boolean isServerSide() { @@ -1232,7 +1232,6 @@ public class GT_Mod implements IGT_Mod { @Mod.EventHandler public void onServerStopping(FMLServerStoppingEvent aEvent) { - for (Runnable tRunnable : GregTech_API.sBeforeGTServerstop) { try { tRunnable.run(); @@ -1316,7 +1315,7 @@ public class GT_Mod implements IGT_Mod { } } //Interrupt IDLE Threads to close down cleanly - GT_Runnable_MachineBlockUpdate.getINSTANCETHREAD().interrupt(); + GT_Runnable_MachineBlockUpdate.shutdownExecutorService(); } private void addSolidFakeLargeBoilerFuels() { diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index a518b3baaf..f0ca426616 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGearEnergyTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_Config; import net.minecraft.block.Block; @@ -31,7 +32,7 @@ import java.util.List; *

* Don't implement this yourself and expect it to work. Extend @MetaTileEntity itself. */ -public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHandler, IGearEnergyTileEntity { +public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHandler, IGearEnergyTileEntity, IMachineBlockUpdateable { /** * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. *

@@ -233,11 +234,6 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand */ boolean isAccessAllowed(EntityPlayer aPlayer); - /** - * When a Machine Update occurs - */ - void onMachineBlockUpdate(); - /** * a Player rightclicks the Machine * Sneaky rightclicks are not getting passed to this! @@ -408,4 +404,22 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand String getAlternativeModeText(); boolean shouldJoinIc2Enet(); + + /** + * The Machine Update, which is called when the Machine needs an Update of its Parts. + * I suggest to wait 1-5 seconds before actually checking the Machine Parts. + * RP-Frames could for example cause Problems when you instacheck the Machine Parts. + * + * just do stuff since we are already in meta tile... + */ + @Override + void onMachineBlockUpdate(); + + /** + * just return in should recurse since we are already in meta tile... + */ + @Override + default boolean isMachineBlockUpdateRecursive(){ + return true; + } } diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java index af9ead9543..8e135fbc85 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java @@ -135,4 +135,25 @@ public interface IGregTechTileEntity extends ITexturedTileEntity, IGearEnergyTil AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ); void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider); + + /** + * Checks validity of meta tile and delegates to it + */ + @Override + default void onMachineBlockUpdate(){ + if(!isDead() && getMetaTileEntity()!=null && + getMetaTileEntity().getBaseMetaTileEntity()==this){ + getMetaTileEntity().onMachineBlockUpdate(); + } + } + + /** + * Checks validity of meta tile and delegates to it + */ + @Override + default boolean isMachineBlockUpdateRecursive() { + return !isDead() && getMetaTileEntity()!=null && + getMetaTileEntity().getBaseMetaTileEntity()==this && + getMetaTileEntity().isMachineBlockUpdateRecursive(); + } } \ No newline at end of file diff --git a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java index c7f6fe5f23..31590f3d57 100644 --- a/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java +++ b/src/main/java/gregtech/api/interfaces/tileentity/IMachineBlockUpdateable.java @@ -13,4 +13,11 @@ public interface IMachineBlockUpdateable { * RP-Frames could for example cause Problems when you instacheck the Machine Parts. */ void onMachineBlockUpdate(); + + /** + * Should recurse? + */ + default boolean isMachineBlockUpdateRecursive(){ + return true; + } } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 881d4a814e..ae8fc7324d 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -584,11 +584,22 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE return stack; } + /** + * Checks validity of meta tile and delegates to it + */ @Override public void onMachineBlockUpdate() { if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate(); } + /** + * Checks validity of meta tile and delegates to it + */ + @Override + public boolean isMachineBlockUpdateRecursive() { + return canAccessData() && mMetaTileEntity.isMachineBlockUpdateRecursive(); + } + @Override public int getProgress() { return canAccessData() ? mMetaTileEntity.getProgresstime() : 0; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 58a97f644a..1ae88ade41 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -913,11 +913,22 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE return stack; } + /** + * Checks validity of meta tile and delegates to it + */ @Override public void onMachineBlockUpdate() { if (canAccessData()) mMetaTileEntity.onMachineBlockUpdate(); } + /** + * Checks validity of meta tile and delegates to it + */ + @Override + public boolean isMachineBlockUpdateRecursive() { + return canAccessData() && mMetaTileEntity.isMachineBlockUpdateRecursive(); + } + @Override public int getProgress() { return canAccessData() ? mMetaTileEntity.getProgresstime() : 0; diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index 6614cca210..9fa16b9890 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -840,4 +840,8 @@ public abstract class MetaPipeEntity implements IMetaTileEntity, IConnectable { public boolean shouldJoinIc2Enet() { return false; } + @Override + public boolean isMachineBlockUpdateRecursive() { + return false; + } } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 1753d2677c..d08a8d9da5 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -85,7 +85,6 @@ public abstract class MetaTileEntity implements IMetaTileEntity { getBaseMetaTileEntity().setMetaTileID((short) aID); GT_LanguageManager.addStringLocalization("gt.blockmachines." + mName + ".name", aRegionalName); mInventory = new ItemStack[aInvSlotCount]; - } /** diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java index 9db9ad910e..7074d63422 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Frame.java @@ -97,4 +97,9 @@ public class GT_MetaPipeEntity_Frame extends MetaPipeEntity { @Override public void disconnect(byte aSide) {/* Do nothing*/} + + @Override + public boolean isMachineBlockUpdateRecursive() { + return true; + } } \ No newline at end of file diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java index c811f3a614..fedf13673d 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java @@ -1,152 +1,90 @@ package gregtech.api.threads; +import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; -import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; import java.util.HashSet; -import java.util.Queue; import java.util.Set; -import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; public class GT_Runnable_MachineBlockUpdate implements Runnable { - - private static int mX; - private static int mY; - private static int mZ; - private static World mWorld; - private static final Set mVisited = new HashSet<>(80); + //used by runner thread + private final int x, y, z; + private final World world; + private final Set visited = new HashSet<>(80); //Threading - private static boolean allowedToRun; //makes if this thread is idle - private static final Queue toUpdate = new ConcurrentLinkedQueue<>(); //blocks added while this thread ran - private static Thread INSTANCETHREAD; //Instance of this thread + private static final ThreadFactory THREAD_FACTORY= r -> { + Thread thread=new Thread(r); + thread.setName("GT_MachineBlockUpdate"); + return thread; + }; + private static ExecutorService EXECUTOR_SERVICE; //This class should never be initiated outside of this class! - private GT_Runnable_MachineBlockUpdate() { - } - - public static synchronized void setmX(int mX) { - GT_Runnable_MachineBlockUpdate.mX = mX; - } - - public static synchronized void setmY(int mY) { - GT_Runnable_MachineBlockUpdate.mY = mY; - } - - public static synchronized void setmZ(int mZ) { - GT_Runnable_MachineBlockUpdate.mZ = mZ; - } - - public static synchronized void setmWorld(World mWorld) { - GT_Runnable_MachineBlockUpdate.mWorld = mWorld; + private GT_Runnable_MachineBlockUpdate(World aWorld, int aX, int aY, int aZ) { + this.world = aWorld; + this.x = aX; + this.y = aY; + this.z = aZ; } /** - * Clears the mVisited HashSet + * If the thread is idle, sets new values and remove the idle flag, otherwise, queue the cooridinates. */ - public static synchronized void resetVisited() { - synchronized (GT_Runnable_MachineBlockUpdate.mVisited) { - GT_Runnable_MachineBlockUpdate.mVisited.clear(); - } + public static void setMachineUpdateValues(World aWorld, int aX, int aY, int aZ) { + EXECUTOR_SERVICE.submit(new GT_Runnable_MachineBlockUpdate(aWorld,aX,aY,aZ)); } - /** - * Never call this Method without checking if the thead is NOT allowed to run! - */ - private static void setMachineUpdateValuesUnsafe(World aWorld, int aX, int aY, int aZ){ - setmZ(aZ); - setmY(aY); - setmX(aX); - setmWorld(aWorld); - resetVisited(); - setAllowedToRun(true); - synchronized (toUpdate) { - if (getINSTANCETHREAD().getState() == Thread.State.WAITING) - toUpdate.notify(); - } + public static void initExecutorService() { + EXECUTOR_SERVICE = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(),THREAD_FACTORY); + //Executors.newSingleThreadExecutor(THREAD_FACTORY); + //Executors.newCachedThreadPool(THREAD_FACTORY); + //Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(),THREAD_FACTORY); } - /** - * If the thread is idleing, sets new values and remove the idle flag, otherwise, queue the cooridinates. - */ - public static synchronized void setMachineUpdateValues(World aWorld, int aX, int aY, int aZ) { - if (GT_Runnable_MachineBlockUpdate.isAllowedToRun()) { - toUpdate.add(new Coordinates(aX, aY, aZ, aWorld)); - } else { - GT_Runnable_MachineBlockUpdate.setMachineUpdateValuesUnsafe(aWorld, aX, aY, aZ); - } - } - - public static class Coordinates { - - protected final int mX; - protected final int mY; - protected final int mZ; - protected final World mWorld; - - public Coordinates(int mX, int mY, int mZ, World mWorld) { - this.mX = mX; - this.mY = mY; - this.mZ = mZ; - this.mWorld = mWorld; - } - - /** - * Updated the Main Update Thread while its Idle - */ - public void update() { - GT_Runnable_MachineBlockUpdate.setMachineUpdateValues(this.mWorld,this.mX,this.mY,this.mZ); + public static void shutdownExecutorService() { + try { + EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS); + } catch (InterruptedException e) { + GT_Mod.GT_FML_LOGGER.error("Well this interruption got interrupted...", e); } - } - - public static synchronized boolean isAllowedToRun() { - return allowedToRun; - } - - public static synchronized void setAllowedToRun(boolean unlocked) { - GT_Runnable_MachineBlockUpdate.allowedToRun = unlocked; - } - - public static synchronized void initThread() { - GT_Runnable_MachineBlockUpdate.INSTANCETHREAD = new Thread(new GT_Runnable_MachineBlockUpdate(), "GT Machine Block Updates"); - GT_Runnable_MachineBlockUpdate.INSTANCETHREAD.start(); - } - - public static synchronized Thread getINSTANCETHREAD() { - return INSTANCETHREAD; + //terminates executor permanently + EXECUTOR_SERVICE.shutdownNow(); } private boolean shouldRecurse(TileEntity aTileEntity, int aX, int aY, int aZ) { - if (aTileEntity instanceof IGregTechTileEntity) { - // Stop recursion on GregTech cables, item pipes, and fluid pipes - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aTileEntity).getMetaTileEntity(); - if ((tMetaTileEntity instanceof GT_MetaPipeEntity_Cable) || - (tMetaTileEntity instanceof GT_MetaPipeEntity_Fluid) || - (tMetaTileEntity instanceof GT_MetaPipeEntity_Item)) - return false; + //no check on IGregTechTileEntity as it should call the underlying meta tile isMachineBlockUpdateRecursive + //if (aTileEntity instanceof IGregTechTileEntity) { + // return ((IGregTechTileEntity) aTileEntity).isMachineBlockUpdateRecursive(); + //} + return (aTileEntity instanceof IMachineBlockUpdateable && + ((IMachineBlockUpdateable) aTileEntity).isMachineBlockUpdateRecursive()) || + GregTech_API.isMachineBlock(world.getBlock(aX, aY, aZ), world.getBlockMetadata(aX, aY, aZ)); + } + + private void causeUpdate(TileEntity tileEntity){ + //no check for IGregTechTileEntity as it should call the underlying meta tile onMachineBlockUpdate + if (tileEntity instanceof IMachineBlockUpdateable) { + ((IMachineBlockUpdateable) tileEntity).onMachineBlockUpdate(); } - - return (aTileEntity instanceof IMachineBlockUpdateable) || - GregTech_API.isMachineBlock(mWorld.getBlock(aX, aY, aZ), mWorld.getBlockMetadata(aX, aY, aZ)); } private void stepToUpdateMachine(int aX, int aY, int aZ) { - if (!mVisited.add(new ChunkPosition(aX, aY, aZ))) + if (!visited.add(new ChunkPosition(aX, aY, aZ))) return; + TileEntity tTileEntity = world.getTileEntity(aX, aY, aZ); - TileEntity tTileEntity = mWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity instanceof IMachineBlockUpdateable) - ((IMachineBlockUpdateable) tTileEntity).onMachineBlockUpdate(); + causeUpdate(tTileEntity); - if (mVisited.size() < 5 || shouldRecurse(tTileEntity, aX, aY, aZ)) { + if (visited.size() < 5 || shouldRecurse(tTileEntity, aX, aY, aZ)) { stepToUpdateMachine(aX + 1, aY, aZ); stepToUpdateMachine(aX - 1, aY, aZ); stepToUpdateMachine(aX, aY + 1, aZ); @@ -154,33 +92,38 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { stepToUpdateMachine(aX, aY, aZ + 1); stepToUpdateMachine(aX, aY, aZ - 1); } - } @Override public void run() { - for(;;) { //infinite loop - if (isAllowedToRun()) {//Are we ready to work? - try { - stepToUpdateMachine(mX, mY, mZ); - } catch (Throwable e) {/**/} - setAllowedToRun(false); //Work is finished, wait for new Coords. - } else { - //Checkes if the Update Queue has members - //DO NOT USE OPTIONALS HERE! - synchronized (toUpdate) { - Coordinates coordinates = toUpdate.poll(); - if (coordinates != null) { - coordinates.update(); - } else { - try { - toUpdate.wait(); - } catch (InterruptedException ignored) { - return; - } - } - } - } + try { + stepToUpdateMachine(x, y, z); + } catch (Exception e) { + GT_Mod.GT_FML_LOGGER.error("Well this update was broken... " + new Coordinates(x,y,z,world), e); + } + } + + public static class Coordinates { + public final int mX; + public final int mY; + public final int mZ; + public final World mWorld; + + public Coordinates(int mX, int mY, int mZ, World mWorld) { + this.mX = mX; + this.mY = mY; + this.mZ = mZ; + this.mWorld = mWorld; + } + + @Override + public String toString() { + return "Coordinates{" + + "mX=" + mX + + ", mY=" + mY + + ", mZ=" + mZ + + ", mWorld=" + mWorld.getProviderName()+ " @dimId " + mWorld.provider.dimensionId + + '}'; } } } \ No newline at end of file -- cgit