From 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 10 Apr 2023 17:49:16 +0100 Subject: Update spotless config to 0.2.2 --- .../api/metatileentity/BaseMetaPipeEntity.java | 360 +++++---- .../api/metatileentity/BaseMetaTileEntity.java | 804 ++++++++++----------- .../api/metatileentity/BaseTileEntity.java | 203 +++--- .../api/metatileentity/CommonMetaTileEntity.java | 2 +- .../api/metatileentity/CoverableTileEntity.java | 226 +++--- .../api/metatileentity/MetaPipeEntity.java | 67 +- .../api/metatileentity/MetaTileEntity.java | 107 ++- .../api/metatileentity/TileIC2EnergySink.java | 22 +- .../examples/GT_MetaTileEntity_E_Furnace.java | 124 ++-- .../implementations/GT_MetaPipeEntity_Cable.java | 275 ++++--- .../implementations/GT_MetaPipeEntity_Fluid.java | 299 ++++---- .../implementations/GT_MetaPipeEntity_Frame.java | 31 +- .../implementations/GT_MetaPipeEntity_Item.java | 170 ++--- .../GT_MetaTileEntity_BasicBatteryBuffer.java | 177 +++-- .../GT_MetaTileEntity_BasicGenerator.java | 55 +- .../GT_MetaTileEntity_BasicHull.java | 16 +- .../GT_MetaTileEntity_BasicHull_NonElectric.java | 8 +- .../GT_MetaTileEntity_BasicMachine.java | 624 ++++++++-------- .../GT_MetaTileEntity_BasicMachine_Bronze.java | 171 ++--- .../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 446 ++++++------ .../GT_MetaTileEntity_BasicMachine_Steel.java | 64 +- .../GT_MetaTileEntity_BasicTank.java | 134 ++-- .../implementations/GT_MetaTileEntity_Buffer.java | 214 +++--- .../GT_MetaTileEntity_CubicMultiBlockBase.java | 42 +- .../GT_MetaTileEntity_EnhancedMultiBlockBase.java | 188 ++--- ...MetaTileEntity_ExtendedPowerMultiBlockBase.java | 112 +-- .../implementations/GT_MetaTileEntity_Hatch.java | 12 +- .../GT_MetaTileEntity_Hatch_DataAccess.java | 28 +- .../GT_MetaTileEntity_Hatch_Dynamo.java | 14 +- .../GT_MetaTileEntity_Hatch_Energy.java | 18 +- .../GT_MetaTileEntity_Hatch_Input.java | 44 +- .../GT_MetaTileEntity_Hatch_InputBus.java | 56 +- .../GT_MetaTileEntity_Hatch_Maintenance.java | 121 ++-- .../GT_MetaTileEntity_Hatch_Muffler.java | 51 +- .../GT_MetaTileEntity_Hatch_MultiInput.java | 63 +- .../GT_MetaTileEntity_Hatch_Output.java | 275 ++++--- .../GT_MetaTileEntity_Hatch_OutputBus.java | 58 +- .../GT_MetaTileEntity_MultiBlockBase.java | 779 ++++++++++---------- .../GT_MetaTileEntity_SpecialFilter.java | 144 ++-- .../GT_MetaTileEntity_TieredMachineBlock.java | 22 +- .../GT_MetaTileEntity_TooltipMultiBlockBase.java | 4 +- .../GT_MetaTileEntity_Transformer.java | 166 ++--- .../GT_MetaTileEntity_Wireless_Dynamo.java | 10 +- .../GT_MetaTileEntity_Wireless_Hatch.java | 12 +- 44 files changed, 3238 insertions(+), 3580 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity') diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 0bc1201827..36d4aadcd5 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -48,14 +48,14 @@ import gregtech.common.covers.CoverInfo; * This is the main TileEntity for EVERYTHING. */ public class BaseMetaPipeEntity extends CommonMetaTileEntity - implements IGregTechTileEntity, IPipeRenderedTileEntity, IDebugableTileEntity { + implements IGregTechTileEntity, IPipeRenderedTileEntity, IDebugableTileEntity { public byte mConnections = IConnectable.NO_CONNECTION; protected MetaPipeEntity mMetaTileEntity; private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; private boolean mWorkUpdate = false, mWorks = true; private byte mColor = 0, oColor = 0, oStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, - mLagWarningCount = 0; + mLagWarningCount = 0; private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0; protected Node node; protected NodePath nodePath; @@ -196,9 +196,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mConnections = (byte) (mMetaTileEntity.mConnections | (mConnections & ~IConnectable.CONNECTED_ALL)); // If foam not hardened, tries roll chance to harden if ((mConnections & IConnectable.HAS_FOAM) == IConnectable.HAS_FRESHFOAM - && getRandomNumber(1000) == 0) { + && getRandomNumber(1000) == 0) { mConnections = (byte) ((mConnections & ~IConnectable.HAS_FRESHFOAM) - | IConnectable.HAS_HARDENEDFOAM); + | IConnectable.HAS_HARDENEDFOAM); } if (mTickTimer > 12 && oldConnections != mConnections) GregTech_API.causeCableUpdate(worldObj, xCoord, yCoord, zCoord); @@ -235,10 +235,10 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (tData != oUpdateData) sendBlockEvent((byte) 1, oUpdateData = tData); if (mColor != oColor) sendBlockEvent((byte) 2, oColor = mColor); tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)); + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)); if (tData != oRedstoneData) sendBlockEvent((byte) 3, oRedstoneData = tData); } @@ -257,23 +257,23 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (isServerSide() && hasValidMetaTileEntity()) { tTime = System.nanoTime() - tTime; if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) - % mTimeStatistics.length] = (int) tTime; + % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1000000L) - && mTickTimer > 1000 - && getMetaTileEntity().doTickProfilingMessageDuringThisTick() - && mLagWarningCount++ < 10) + && mTickTimer > 1000 + && getMetaTileEntity().doTickProfilingMessageDuringThisTick() + && mLagWarningCount++ < 10) GT_FML_LOGGER.warn( - "WARNING: Possible Lag Source at [" + xCoord - + "," - + yCoord - + "," - + zCoord - + "] in Dimension " - + worldObj.provider.dimensionId - + " with " - + tTime - + " ns caused by an instance of " - + getMetaTileEntity().getClass()); + "WARNING: Possible Lag Source at [" + xCoord + + "," + + yCoord + + "," + + zCoord + + "] in Dimension " + + worldObj.provider.dimensionId + + " with " + + tTime + + " ns caused by an instance of " + + getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = false; @@ -282,36 +282,35 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity private void sendClientData() { if (mSendClientData) { NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_TileEntity( - xCoord, - (short) yCoord, - zCoord, - mID, - getCoverInfoAtSide((byte) 0).getCoverID(), - getCoverInfoAtSide((byte) 1).getCoverID(), - getCoverInfoAtSide((byte) 2).getCoverID(), - getCoverInfoAtSide((byte) 3).getCoverID(), - getCoverInfoAtSide((byte) 4).getCoverID(), - getCoverInfoAtSide((byte) 5).getCoverID(), - oTextureData = mConnections, - oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, - oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) - | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)), - oColor = mColor), + worldObj, + new GT_Packet_TileEntity( xCoord, - zCoord); + (short) yCoord, + zCoord, + mID, + getCoverInfoAtSide((byte) 0).getCoverID(), + getCoverInfoAtSide((byte) 1).getCoverID(), + getCoverInfoAtSide((byte) 2).getCoverID(), + getCoverInfoAtSide((byte) 3).getCoverID(), + getCoverInfoAtSide((byte) 4).getCoverID(), + getCoverInfoAtSide((byte) 5).getCoverID(), + oTextureData = mConnections, + oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, + oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)), + oColor = mColor), + xCoord, + zCoord); mSendClientData = false; } sendCoverDataIfNeeded(); } public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, - int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { + int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { issueTextureUpdate(); if (aID > 0 && mID != aID) { mID = aID; @@ -384,14 +383,14 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final ArrayList tList = new ArrayList<>(); if (aLogLevel > 3) { tList.add( - "Meta-ID: " + EnumChatFormatting.BLUE - + mID - + EnumChatFormatting.RESET - + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN + " valid" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + " invalid" + EnumChatFormatting.RESET) - + (mMetaTileEntity == null - ? EnumChatFormatting.RED + " MetaTileEntity == null!" + EnumChatFormatting.RESET - : " ")); + "Meta-ID: " + EnumChatFormatting.BLUE + + mID + + EnumChatFormatting.RESET + + (hasValidMetaTileEntity() ? EnumChatFormatting.GREEN + " valid" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + " invalid" + EnumChatFormatting.RESET) + + (mMetaTileEntity == null + ? EnumChatFormatting.RED + " MetaTileEntity == null!" + EnumChatFormatting.RESET + : " ")); } if (aLogLevel > 1) { if (mTimeStatistics.length > 0) { @@ -404,30 +403,30 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity } } tList.add( - "Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) - + "ns since " - + mTimeStatistics.length - + " ticks with worst time of " - + tWorstTime - + "ns."); + "Average CPU-load of ~" + (tAverageTime / mTimeStatistics.length) + + "ns since " + + mTimeStatistics.length + + " ticks with worst time of " + + tWorstTime + + "ns."); } if (mLagWarningCount > 0) { tList.add( - "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) - + " Lag Spike Warnings (anything taking longer than " - + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING - + "ms) on the Server."); + "Caused " + (mLagWarningCount >= 10 ? "more than 10" : mLagWarningCount) + + " Lag Spike Warnings (anything taking longer than " + + GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING + + "ms) on the Server."); } if (mMetaTileEntity != null) { tList.add( - "Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " - : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you"); + "Is" + (mMetaTileEntity.isAccessAllowed(aPlayer) ? " " + : EnumChatFormatting.RED + " not " + EnumChatFormatting.RESET) + "accessible for you"); } } if (joinedIc2Enet) tList.add("Joined IC2 ENet"); return mMetaTileEntity != null ? mMetaTileEntity.getSpecialDebugInfo(this, aPlayer, aLogLevel, tList) - : new ArrayList<>(); + : new ArrayList<>(); } @Override @@ -467,9 +466,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity public void setInventorySlotContents(int aIndex, ItemStack aStack) { markDirty(); mInventoryChanged = true; - if (canAccessData()) mMetaTileEntity.setInventorySlotContents( - aIndex, - worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); + if (canAccessData()) mMetaTileEntity + .setInventorySlotContents(aIndex, worldObj.isRemote ? aStack : GT_OreDictUnificator.setStack(true, aStack)); } @Override @@ -498,9 +496,9 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean isUseableByPlayer(EntityPlayer aPlayer) { return hasValidMetaTileEntity() && mTickTimer > 40 - && getTileEntityOffset(0, 0, 0) == this - && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 - && mMetaTileEntity.isAccessAllowed(aPlayer); + && getTileEntityOffset(0, 0, 0) == this + && aPlayer.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64 + && mMetaTileEntity.isAccessAllowed(aPlayer); } @Override @@ -735,12 +733,12 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity else if (tConnections == IConnectable.CONNECTED_NORTH || tConnections == IConnectable.CONNECTED_SOUTH) tConnections = (byte) (IConnectable.CONNECTED_NORTH | IConnectable.CONNECTED_SOUTH); if (hasValidMetaTileEntity()) return mMetaTileEntity.getTexture( - this, - aSide, - tConnections, - (byte) (mColor - 1), - tConnections == 0 || (tConnections & (1 << aSide)) != 0, - getOutputRedstoneSignal(aSide) > 0); + this, + aSide, + tConnections, + (byte) (mColor - 1), + tConnections == 0 || (tConnections & (1 << aSide)) != 0, + getOutputRedstoneSignal(aSide) > 0); return Textures.BlockIcons.ERROR_RENDERING; } @@ -782,7 +780,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { final byte tSide = (getCoverIDAtSide(aSide) == 0) ? GT_Utility.determineWrenchingSide(aSide, aX, aY, aZ) - : aSide; + : aSide; return (getCoverInfoAtSide(tSide).hasCoverGUI()); } else if (getCoverBehaviorAtSideNew(aSide).onCoverRightclickClient(aSide, this, aPlayer, aX, aY, aZ)) { return true; @@ -792,7 +790,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { if (getColorization() >= 0 - && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { + && GT_Utility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { mMetaTileEntity.markDirty(); tCurrentItem.func_150996_a(Items.bucket); setColorization((byte) -1); @@ -804,13 +802,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mMetaTileEntity.markDirty(); GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -818,34 +816,34 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (getCoverIDAtSide(aSide) == 0 && getCoverIDAtSide(tSide) != 0) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { setCoverDataAtSide( - tSide, - getCoverInfoAtSide(tSide).onCoverScrewdriverClick(aPlayer, 0.5F, 0.5F, 0.5F)); + tSide, + getCoverInfoAtSide(tSide).onCoverScrewdriverClick(aPlayer, 0.5F, 0.5F, 0.5F)); mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ); mMetaTileEntity.markDirty(); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } } else { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { setCoverDataAtSide( - aSide, - getCoverInfoAtSide(aSide).onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); + aSide, + getCoverInfoAtSide(aSide).onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); mMetaTileEntity.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); mMetaTileEntity.markDirty(); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } } return true; @@ -865,18 +863,18 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity else enableWorking(); mMetaTileEntity.markDirty(); GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") - : GT_Utility.trans("087", "Disabled"))); + aPlayer, + GT_Utility.trans("090", "Machine Processing: ") + + (isAllowedToWork() ? GT_Utility.trans("088", "Enabled") + : GT_Utility.trans("087", "Disabled"))); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -886,13 +884,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mMetaTileEntity.markDirty(); // logic handled internally GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } doEnetUpdate(); return true; @@ -903,30 +901,30 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity mMetaTileEntity.markDirty(); // logic handled internally GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_BATTERY_USE, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } else if (GT_ModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mMetaTileEntity.markDirty(); mStrongRedstone ^= (1 << tSide); GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans("091", "Redstone Output at Side ") + tSide - + GT_Utility.trans("092", " set to: ") - + ((mStrongRedstone & (1 << tSide)) != 0 ? GT_Utility.trans("093", "Strong") - : GT_Utility.trans("094", "Weak"))); + aPlayer, + GT_Utility.trans("091", "Redstone Output at Side ") + tSide + + GT_Utility.trans("092", " set to: ") + + ((mStrongRedstone & (1 << tSide)) != 0 ? GT_Utility.trans("093", "Strong") + : GT_Utility.trans("094", "Weak"))); GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 3.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_BATTERY_USE, + 3.0F, + -1, + xCoord, + yCoord, + zCoord); issueBlockUpdate(); } doEnetUpdate(); @@ -941,19 +939,19 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (coverInfo.getCoverID() == 0) { if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCovers.keySet())) { if (GregTech_API.getCoverBehaviorNew(tCurrentItem) - .isCoverPlaceable(coverSide, tCurrentItem, this) - && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { + .isCoverPlaceable(coverSide, tCurrentItem, this) + && mMetaTileEntity.allowCoverOnSide(coverSide, new GT_ItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); mMetaTileEntity.markDirty(); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.IC2_TOOLS_WRENCH, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); } return true; } @@ -961,13 +959,13 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)) { if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_BREAK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + worldObj, + SoundResource.RANDOM_BREAK, + 1.0F, + -1, + xCoord, + yCoord, + zCoord); dropCover(coverSide, aSide, false); mMetaTileEntity.markDirty(); } @@ -1055,7 +1053,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { return canAccessData() && getCoverInfoAtSide((byte) aSide).letsItemsIn(aIndex) - && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); + && mMetaTileEntity.canInsertItem(aIndex, aStack, aSide); } /** @@ -1064,11 +1062,11 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { return canAccessData() && getCoverBehaviorAtSideNew((byte) aSide).letsItemsOut( - (byte) aSide, - getCoverIDAtSide((byte) aSide), - getComplexCoverDataAtSide((byte) aSide), - aIndex, - this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); + (byte) aSide, + getCoverIDAtSide((byte) aSide), + getComplexCoverDataAtSide((byte) aSide), + aIndex, + this) && mMetaTileEntity.canExtractItem(aIndex, aStack, aSide); } @Override @@ -1199,12 +1197,10 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity if (tTileEntity != null && !mMetaTileEntity.isConnectedAtSide((byte) aSide.ordinal())) return false; if (isFill && mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid)) - return true; + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidIn(aFluid)) return true; if (!isFill && mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) - && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid)) - return true; + && getCoverInfoAtSide((byte) aSide.ordinal()).letsFluidOut(aFluid)) return true; return false; } @@ -1212,7 +1208,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public int fill(ForgeDirection aSide, FluidStack aFluidStack, boolean doFill) { if (mTickTimer > 5 && canAccessData() - && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true)) + && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), true)) return mMetaTileEntity.fill(aSide, aFluidStack, doFill); return 0; } @@ -1220,12 +1216,12 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public FluidStack drain(ForgeDirection aSide, int maxDrain, boolean doDrain) { if (mTickTimer > 5 && canAccessData() - && canMoveFluidOnSide( - aSide, - mMetaTileEntity.getFluid() == null ? null - : mMetaTileEntity.getFluid() - .getFluid(), - false)) + && canMoveFluidOnSide( + aSide, + mMetaTileEntity.getFluid() == null ? null + : mMetaTileEntity.getFluid() + .getFluid(), + false)) return mMetaTileEntity.drain(aSide, maxDrain, doDrain); return null; } @@ -1233,7 +1229,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public FluidStack drain(ForgeDirection aSide, FluidStack aFluidStack, boolean doDrain) { if (mTickTimer > 5 && canAccessData() - && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false)) + && canMoveFluidOnSide(aSide, aFluidStack == null ? null : aFluidStack.getFluid(), false)) return mMetaTileEntity.drain(aSide, aFluidStack, doDrain); return null; } @@ -1256,8 +1252,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { final CoverInfo coverInfo = getCoverInfoAtSide((byte) aSide.ordinal()); if (canAccessData() && (aSide == ForgeDirection.UNKNOWN - || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && coverInfo.letsFluidIn(null)) - || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && coverInfo.letsFluidOut(null)) + || (mMetaTileEntity.isLiquidInput((byte) aSide.ordinal()) && coverInfo.letsFluidIn(null)) + || (mMetaTileEntity.isLiquidOutput((byte) aSide.ordinal()) && coverInfo.letsFluidOut(null)) // Doesn't need to be connected to get Tank Info -- otherwise things can't connect )) return mMetaTileEntity.getTankInfo(aSide); return new FluidTankInfo[] {}; @@ -1273,8 +1269,8 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity return true; } aStack = GT_OreDictUnificator.get(aStack); - if (GT_Utility.areStacksEqual(tStack, aStack) && tStack.stackSize + aStack.stackSize - <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { + if (GT_Utility.areStacksEqual(tStack, aStack) + && tStack.stackSize + aStack.stackSize <= Math.min(aStack.getMaxStackSize(), getInventoryStackLimit())) { markDirty(); tStack.stackSize += aStack.stackSize; return true; @@ -1374,7 +1370,7 @@ public class BaseMetaPipeEntity extends CommonMetaTileEntity @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, - List outputAABB, Entity collider) { + List outputAABB, Entity collider) { mMetaTileEntity.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index c6d74a1b35..6c18d00c8c 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -80,12 +80,10 @@ import ic2.api.Direction; * This is the main TileEntity for EVERYTHING. */ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTechTileEntity, IActionHost, - IGridProxyable, IAlignmentProvider, IConstructableProvider, IDebugableTileEntity, IGregtechWailaProvider { + IGridProxyable, IAlignmentProvider, IConstructableProvider, IDebugableTileEntity, IGregtechWailaProvider { - private static final Field ENTITY_ITEM_HEALTH_FIELD = ReflectionHelper.findField( - EntityItem.class, - "health", - "field_70291_e"); + private static final Field ENTITY_ITEM_HEALTH_FIELD = ReflectionHelper + .findField(EntityItem.class, "health", "field_70291_e"); private final boolean[] mActiveEUInputs = new boolean[] { false, false, false, false, false, false }; private final boolean[] mActiveEUOutputs = new boolean[] { false, false, false, false, false, false }; private final int[] mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; @@ -97,13 +95,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec protected boolean mReleaseEnergy = false; protected long[] mAverageEUInput = new long[] { 0, 0, 0, 0, 0 }, mAverageEUOutput = new long[] { 0, 0, 0, 0, 0 }; private boolean mHasEnoughEnergy = true, mRunningThroughTick = false, mInputDisabled = false, - mOutputDisabled = false, mMuffler = false, mLockUpgrade = false; + mOutputDisabled = false, mMuffler = false, mLockUpgrade = false; private boolean mActive = false, mWorkUpdate = false, mSteamConverter = false, mWorks = true; private boolean oRedstone = false; private byte mColor = 0, oColor = 0, oStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, - oTexturePage = 0; + oTexturePage = 0; private byte oLightValueClient = 0, oLightValue = -1, mLightValue = 0, mOtherUpgrades = 0, mFacing = 0, oFacing = 0, - mWorkData = 0; + mWorkData = 0; private int mDisplayErrorCode = 0, oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0, mLagWarningCount = 0; private long oOutput = 0, mAcceptedAmperes = Long.MAX_VALUE; private long mLastCheckTick = 0; @@ -160,8 +158,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec else mID = mID > 0 ? mID : 0; if (mID != 0) createNewMetatileEntity(mID); mSidedRedstone = (hasValidMetaTileEntity() && mMetaTileEntity.hasSidedRedstoneOutputBehavior() - ? new byte[] { 0, 0, 0, 0, 0, 0 } - : new byte[] { 15, 15, 15, 15, 15, 15 }); + ? new byte[] { 0, 0, 0, 0, 0, 0 } + : new byte[] { 15, 15, 15, 15, 15, 15 }); } else { if (aID <= 0) mID = (short) aNBT.getInteger("mID"); else mID = aID; @@ -185,7 +183,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec mInputDisabled = aNBT.getBoolean("mInputDisabled"); mOutputDisabled = aNBT.getBoolean("mOutputDisabled"); mOtherUpgrades = (byte) (aNBT.getByte("mOtherUpgrades") + aNBT.getByte("mBatteries") - + aNBT.getByte("mLiBatteries")); + + aNBT.getByte("mLiBatteries")); mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents"); final int nbtVersion = aNBT.getInteger("nbtVersion"); @@ -214,13 +212,13 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec */ public void chargeItem(ItemStack aStack) { decreaseStoredEU( - GT_ModHandler.chargeElectricItem( - aStack, - (int) Math.min(Integer.MAX_VALUE, getStoredEU()), - (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), - false, - false), - true); + GT_ModHandler.chargeElectricItem( + aStack, + (int) Math.min(Integer.MAX_VALUE, getStoredEU()), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), + false, + false), + true); } /** @@ -228,14 +226,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec */ public void dischargeItem(ItemStack aStack) { increaseStoredEnergyUnits( - GT_ModHandler.dischargeElectricItem( - aStack, - (int) Math.min(Integer.MAX_VALUE, getEUCapacity() - getStoredEU()), - (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), - false, - false, - false), - true); + GT_ModHandler.dischargeElectricItem( + aStack, + (int) Math.min(Integer.MAX_VALUE, getEUCapacity() - getStoredEU()), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), + false, + false, + false), + true); } protected boolean isRainPossible() { @@ -255,14 +253,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec final int precipitationHeightAtSide4 = worldObj.getPrecipitationHeight(xCoord - 1, zCoord); final int precipitationHeightAtSide5 = worldObj.getPrecipitationHeight(xCoord + 1, zCoord); return (getCoverIDAtSide((byte) 1) == 0 && worldObj.getPrecipitationHeight(xCoord, zCoord) - 2 < yCoord) - || (getCoverIDAtSide((byte) 2) == 0 && precipitationHeightAtSide2 - 1 < yCoord - && precipitationHeightAtSide2 > -1) - || (getCoverIDAtSide((byte) 3) == 0 && precipitationHeightAtSide3 - 1 < yCoord - && precipitationHeightAtSide3 > -1) - || (getCoverIDAtSide((byte) 4) == 0 && precipitationHeightAtSide4 - 1 < yCoord - && precipitationHeightAtSide4 > -1) - || (getCoverIDAtSide((byte) 5) == 0 && precipitationHeightAtSide5 - 1 < yCoord - && precipitationHeightAtSide5 > -1); + || (getCoverIDAtSide((byte) 2) == 0 && precipitationHeightAtSide2 - 1 < yCoord + && precipitationHeightAtSide2 > -1) + || (getCoverIDAtSide((byte) 3) == 0 && precipitationHeightAtSide3 - 1 < yCoord + && precipitationHeightAtSide3 > -1) + || (getCoverIDAtSide((byte) 4) == 0 && precipitationHeightAtSide4 - 1 < yCoord + && precipitationHeightAtSide4 > -1) + || (getCoverIDAtSide((byte) 5) == 0 && precipitationHeightAtSide5 - 1 < yCoord + && precipitationHeightAtSide5 > -1); } @Override @@ -385,15 +383,14 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec } if (mMetaTileEntity.isEnetOutput() && oOutput > 0) { - final long tOutputVoltage = Math.max( - oOutput, - oOutput + (1L << Math.max(0, GT_Utility.getTier(oOutput) - 1))); + final long tOutputVoltage = Math + .max(oOutput, oOutput + (1L << Math.max(0, GT_Utility.getTier(oOutput) - 1))); final long tUsableAmperage = Math.min( - getOutputAmperage(), - (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); + getOutputAmperage(), + (getStoredEU() - mMetaTileEntity.getMinimumStoredEU()) / tOutputVoltage); if (tUsableAmperage > 0) { final long tEU = tOutputVoltage - * Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); + * Util.emitEnergyToNetwork(oOutput, tUsableAmperage, this); mAverageEUOutput[mAverageEUOutputIndex] += tEU; decreaseStoredEU(tEU, true); } @@ -417,30 +414,30 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (getRandomNumber(10) == 0) { try { GT_Mod.achievements.issueAchievement( - this.getWorldObj() - .getPlayerEntityByName(mOwnerName), - "badweather"); + this.getWorldObj() + .getPlayerEntityByName(mOwnerName), + "badweather"); } catch (Exception ignored) {} GT_Log.exp.println( - "Machine at: " + this.getXCoord() - + " | " - + this.getYCoord() - + " | " - + this.getZCoord() - + " DIMID: " - + this.worldObj.provider.dimensionId - + " explosion due to rain!"); + "Machine at: " + this.getXCoord() + + " | " + + this.getYCoord() + + " | " + + this.getZCoord() + + " DIMID: " + + this.worldObj.provider.dimensionId + + " explosion due to rain!"); doEnergyExplosion(); } else { GT_Log.exp.println( - "Machine at: " + this.getXCoord() - + " | " - + this.getYCoord() - + " | " - + this.getZCoord() - + " DIMID: " - + this.worldObj.provider.dimensionId - + " set to Fire due to rain!"); + "Machine at: " + this.getXCoord() + + " | " + + this.getYCoord() + + " | " + + this.getZCoord() + + " DIMID: " + + this.worldObj.provider.dimensionId + + " set to Fire due to rain!"); setOnFire(); } } @@ -449,22 +446,22 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec return; } if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() - && getRandomNumber(3) == 0) { + && getRandomNumber(3) == 0) { try { GT_Mod.achievements.issueAchievement( - this.getWorldObj() - .getPlayerEntityByName(mOwnerName), - "badweather"); + this.getWorldObj() + .getPlayerEntityByName(mOwnerName), + "badweather"); } catch (Exception ignored) {} GT_Log.exp.println( - "Machine at: " + this.getXCoord() - + " | " - + this.getYCoord() - + " | " - + this.getZCoord() - + " DIMID: " - + this.worldObj.provider.dimensionId - + " explosion due to Thunderstorm!"); + "Machine at: " + this.getXCoord() + + " | " + + this.getYCoord() + + " | " + + this.getZCoord() + + " DIMID: " + + this.worldObj.provider.dimensionId + + " explosion due to Thunderstorm!"); doEnergyExplosion(); } } @@ -482,16 +479,17 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aSideServer) { if (mMetaTileEntity.dechargerSlotCount() > 0 && getStoredEU() < getEUCapacity()) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), - k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { + k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) { dischargeItem(mMetaTileEntity.mInventory[i]); if (ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]) > 0) { - if ((getStoredEU() + ic2.api.info.Info.itemEnergy.getEnergyValue( - mMetaTileEntity.mInventory[i])) < getEUCapacity()) { + if ((getStoredEU() + + ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i])) + < getEUCapacity()) { increaseStoredEnergyUnits( - (long) ic2.api.info.Info.itemEnergy.getEnergyValue( - mMetaTileEntity.mInventory[i]), - false); + (long) ic2.api.info.Info.itemEnergy + .getEnergyValue(mMetaTileEntity.mInventory[i]), + false); mMetaTileEntity.mInventory[i].stackSize--; mInventoryChanged = true; } @@ -507,7 +505,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aSideServer) { if (mMetaTileEntity.rechargerSlotCount() > 0 && getStoredEU() > 0) { for (int i = mMetaTileEntity.rechargerSlotStartIndex(), - k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { + k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { if (getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { chargeItem(mMetaTileEntity.mInventory[i]); if (mMetaTileEntity.mInventory[i].stackSize <= 0) { @@ -539,9 +537,9 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (mTickTimer > 10) { byte tData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) - | (mRedstone ? 16 : 0) - | (mLockUpgrade ? 32 : 0) - | (mWorks ? 64 : 0)); + | (mRedstone ? 16 : 0) + | (mLockUpgrade ? 32 : 0) + | (mWorks ? 64 : 0)); if (tData != oTextureData) sendBlockEvent(GregTechTileClientEvents.CHANGE_COMMON_DATA, oTextureData = tData); @@ -551,15 +549,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { tData = ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage(); if (tData != oTexturePage) sendBlockEvent( - GregTechTileClientEvents.CHANGE_CUSTOM_DATA, - (byte) ((oTexturePage = tData) | 0x80)); // set last bit as a flag for page + GregTechTileClientEvents.CHANGE_CUSTOM_DATA, + (byte) ((oTexturePage = tData) | 0x80)); // set last bit as a flag for page } if (mColor != oColor) sendBlockEvent(GregTechTileClientEvents.CHANGE_COLOR, oColor = mColor); tData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)); + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)); if (tData != oRedstoneData) sendBlockEvent(GregTechTileClientEvents.CHANGE_REDSTONE_OUTPUT, oRedstoneData = tData); if (mLightValue != oLightValue) { @@ -591,23 +589,23 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec if (aSideServer && hasValidMetaTileEntity()) { tTime = System.nanoTime() - tTime; if (mTimeStatistics.length > 0) mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) - % mTimeStatistics.length] = (int) tTime; + % mTimeStatistics.length] = (int) tTime; if (tTime > 0 && tTime > (GregTech_API.MILLISECOND_THRESHOLD_UNTIL_LAG_WARNING * 1_000_000L) - && mTickTimer > 1000 - && getMetaTileEntity().doTickProfilingMessageDuringThisTick() - && mLagWarningCount++ < 10) + && mTickTimer > 1000 + && getMetaTileEntity().doTickProfilingMessageDuringThisTick() + && mLagWarningCount++ < 10) GT_FML_LOGGER.warn( - "WARNING: Possible Lag Source at [" + xCoord - + ", " - + yCoord - + ", " - + zCoord - + "] in Dimension " - + worldObj.provider.dimensionId - + " with " - + tTime - + "ns caused by an instance of " - + getMetaTileEntity().getClass()); + "WARNING: Possible Lag Source at [" + xCoord + + ", " + + yCoord + + ", " + + zCoord + + "] in Dimension " + + worldObj.provider.dimensionId + + " with " + + tTime + + "ns caused by an instance of " + + getMetaTileEntity().getClass()); } mWorkUpdate = mInventoryChanged = mRunningThroughTick = false; @@ -615,7 +613,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public void getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { if (hasValidMetaTileEntity()) { getMetaTileEntity().getWailaBody(itemStack, currenttip, accessor, config); } @@ -624,7 +622,7 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); if (hasValidMetaTileEntity()) { getMetaTileEntity().getWailaNBTData(player, tile, tag, world, x, y, z); @@ -634,44 +632,42 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec private void sendClientData() { if (mSendClientData) { NW.sendPacketToAllPlayersInRange( - worldObj, - new GT_Packet_TileEntity( - xCoord, - (short) yCoord, - zCoord, - mID, - getCoverInfoAtSide((byte) 0).getCoverID(), - getCoverInfoAtSide((byte) 1).getCoverID(), - getCoverInfoAtSide((byte) 2).getCoverID(), - getCoverInfoAtSide((byte) 3).getCoverID(), - getCoverInfoAtSide((byte) 4).getCoverID(), - getCoverInfoAtSide((byte) 5).getCoverID(), - oTextureData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) - | (mRedstone ? 16 : 0) - | (mLockUpgrade ? 32 : 0) - | (mWorks ? 64 : 0)), - oTexturePage = (hasValidMetaTileEntity() - && mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) - ? ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage() - : 0, - oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, - oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) - | ((mSidedRedstone[1] > 0) ? 2 : 0) - | ((mSidedRedstone[2] > 0) ? 4 : 0) - | ((mSidedRedstone[3] > 0) ? 8 : 0) - | ((mSidedRedstone[4] > 0) ? 16 : 0) - | ((mSidedRedstone[5] > 0) ? 32 : 0)), - oColor = mColor), + worldObj, + new GT_Packet_TileEntity( xCoord, - zCoord); + (short) yCoord, + zCoord, + mID, + getCoverInfoAtSide((byte) 0).getCoverID(), + getCoverInfoAtSide((byte) 1).getCoverID(), + getCoverInfoAtSide((byte) 2).getCoverID(), + getCoverInfoAtSide((byte) 3).getCoverID(), + getCoverInfoAtSide((byte) 4).getCoverID(), + getCoverInfoAtSide((byte) 5).getCoverID(), + oTextureData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) + | (mRedstone ? 16 : 0) + | (mLockUpgrade ? 32 : 0) + | (mWorks ? 64 : 0)), + oTexturePage = (hasValidMetaTileEntity() && mMetaTileEntity instanceof GT_MetaTileEntity_Hatch) + ? ((GT_MetaTileEntity_Hatch) mMetaTileEntity).getTexturePage() + : 0, + oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, + oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) + | ((mSidedRedstone[2] > 0) ? 4 : 0) + | ((mSidedRedstone[3] > 0) ? 8 : 0) + | ((mSidedRedstone[4] > 0) ? 16 : 0) + | ((mSidedRedstone[5] > 0) ? 32 : 0)), + oColor = mColor), + xCoord, + zCoord); mSendClientData = false; } sendCoverDataIfNeeded(); } public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, - int aCover4, int aCover5, byte aTextureData, byte aTexturePage, byte aUpdateData, byte aRedstoneData, - byte aColorData) { + int aCover4, int aCover5, byte aTextureData, byte aTexturePage, byte aUpdateData, byte aRedstoneData, + byte aColorData) { issueTextureUpdate(); if (mID != aID && aID > 0) { mID = aID; @@ -694,20 +690,20 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity implements IGregTec @Deprecated public final void receiveMetaTileEntityData(short aID, int aCover0, int aCover1, int aCover2, int aCover3, - int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { + int aCover4, int aCover5, byte aTextureData, byte aUpdateData, byte aRedstoneData, byte aColorData) { receiveMetaTileEntityData( - aID, - aCover0, -