From 08e534ddd6cf5808024f82131f39fe9890a5c1a3 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:33:55 -0600 Subject: [PATCH 01/18] AAL - remove usage of deprecated stopMachine() - move away from deprecated onWireCutterRightClick() --- src/main/java/ggfab/mte/MTEAdvAssLine.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/ggfab/mte/MTEAdvAssLine.java b/src/main/java/ggfab/mte/MTEAdvAssLine.java index a4c913207ce..ae0d4c8d306 100644 --- a/src/main/java/ggfab/mte/MTEAdvAssLine.java +++ b/src/main/java/ggfab/mte/MTEAdvAssLine.java @@ -96,6 +96,7 @@ import gregtech.api.util.OverclockCalculator; import gregtech.api.util.VoidProtectionHelper; import gregtech.api.util.shutdown.ShutDownReason; +import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.common.tileentities.machines.MTEHatchInputBusME; import gregtech.common.tileentities.machines.MTEHatchInputME; import mcp.mobius.waila.api.IWailaConfigHandler; @@ -432,12 +433,12 @@ public void loadNBTData(NBTTagCompound aNBT) { } /** - * roughly the same as {@link #criticalStopMachine()}, but does not attempt to send a halting sound if world is not + * Does a critical shutdown of the machine, but does not attempt to send a halting sound if world is not * loaded. also supports setting a stop reason */ private void criticalStopMachine(String reason) { int oMaxProgresstime = mMaxProgresstime; - stopMachine(); + stopMachine(ShutDownReasonRegistry.NONE); // don't do these at all if the machine wasn't working before anyway if (oMaxProgresstime > 0) { if (getBaseMetaTileEntity().getWorld() != null) sendSound(INTERRUPT_SOUND_INDEX); @@ -993,7 +994,7 @@ public boolean supportsBatchMode() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From c0608bd6d2391589a69d8d82cbd0f38ca39467da Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:36:23 -0600 Subject: [PATCH 02/18] EEC - move away from deprecated onSolderingToolRightClick() --- .../gregtech/multiblock/MTEExtremeEntityCrusher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index 4d1a31929c4..2a6e8600348 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -410,12 +410,12 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { mAnimationEnabled = !mAnimationEnabled; GTUtility.sendChatToPlayer(aPlayer, "Animations are " + (mAnimationEnabled ? "enabled" : "disabled")); return true; - } else return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ); + } else return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); } @SuppressWarnings("unused") From 7f11b2f224ca812aa95cc00250386d6afcc65243 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:39:04 -0600 Subject: [PATCH 03/18] GTPPMultiBlockBase - move away from deprecated onWireCutterRightClick() and onSolderingToolRightClick() --- .../implementations/base/GTPPMultiBlockBase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java index dab8f739a19..806231b4642 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java @@ -987,7 +987,7 @@ public boolean onPlungerRightClick(EntityPlayer aPlayer, ForgeDirection side, fl @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { @@ -1002,7 +1002,7 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (supportsVoidProtection() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { Set allowed = getAllowedVoidingModes(); setVoidingMode(getVoidingMode().nextInCollection(allowed)); @@ -1011,7 +1011,7 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre StatCollector.translateToLocal("GT5U.gui.button.voiding_mode") + " " + StatCollector.translateToLocal(getVoidingMode().getTransKey())); return true; - } else return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ); + } else return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); } // Only support to use meta to tier From 195523337e8af31bdc621395f335610a83473f73 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:40:01 -0600 Subject: [PATCH 04/18] MTEDrillerBase - move away from deprecated onSolderingToolRightClick() --- .../common/tileentities/machines/multi/MTEDrillerBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java index 4f7788d39c9..d8df28dc024 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java @@ -262,7 +262,7 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, - EntityPlayer entityPlayer, float aX, float aY, float aZ) { + EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { mChunkLoadingEnabled = !mChunkLoadingEnabled; GTUtility.sendChatToPlayer( @@ -271,7 +271,7 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre : GTUtility.trans("503", "Mining chunk loading disabled")); return true; } - return super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ); + return super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ, aTool); } @Override From 599639c6d8aacf06278992aa6a8956a854646262 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:40:56 -0600 Subject: [PATCH 05/18] MTEEnhancedMultiBlockBase - move away from deprecated onWrenchRightClick() --- .../implementations/MTEEnhancedMultiBlockBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java index 345ce96dbc2..090ef47cadc 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java @@ -83,9 +83,9 @@ public final boolean isFacingValid(ForgeDirection facing) { @Override public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (wrenchingSide != getBaseMetaTileEntity().getFrontFacing()) - return super.onWrenchRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ); + return super.onWrenchRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ, aTool); if (entityPlayer.isSneaking()) { if (isFlipChangeAllowed()) { toolSetFlip(getFlip().isHorizontallyFlipped() ? Flip.NONE : Flip.HORIZONTAL); From 91a03fc01fc89b8fc7a75766f604987ca130e641 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:41:40 -0600 Subject: [PATCH 06/18] Bacterial Vat - move away from deprecated onWireCutterRightClick() --- .../java/bartworks/common/tileentities/multis/MTEBioVat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java b/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java index e61650e4923..f65b9d61bfc 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java @@ -818,7 +818,7 @@ public boolean supportsBatchMode() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { From f9f1af51c3e63b90fdd0f50086bfad034b7de8b4 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:42:29 -0600 Subject: [PATCH 07/18] CAL - move away from deprecated onWireCutterRightClick() --- .../common/tileentities/multis/MTECircuitAssemblyLine.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java index 17aade3cf28..744e0c0f68c 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java @@ -588,14 +588,13 @@ protected boolean supportsSlotAutomation(int aSlot) { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (!aPlayer.isSneaking()) { if (mode == 0) return false; inputSeparation = !inputSeparation; GTUtility.sendChatToPlayer( aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - return true; } else { batchMode = !batchMode; if (batchMode) { @@ -603,8 +602,8 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench } else { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); } - return true; } + return true; } @Override From 0fe6738b63c9a1d19d1c005d36f49d866285007a Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:44:28 -0600 Subject: [PATCH 08/18] CoAL - move away from deprecated onWireCutterRightClick() --- .../blocks/tileEntity/MTEComponentAssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java index 041e8f4bcff..a957ea4b53d 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java @@ -345,7 +345,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From 0ce0f4b4dae479fe8e35931cd0079cd92b494875 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:44:51 -0600 Subject: [PATCH 09/18] Naquadah Fuel Refinery - move away from deprecated onWireCutterRightClick() - remove 3 methods identical to super - remove unused addToFRFList() --- .../tileEntity/MTEFuelRefineFactory.java | 51 +------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEFuelRefineFactory.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEFuelRefineFactory.java index bb39f70e838..68cfd3fd455 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEFuelRefineFactory.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEFuelRefineFactory.java @@ -35,11 +35,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; -import gregtech.api.metatileentity.implementations.MTEHatch; -import gregtech.api.metatileentity.implementations.MTEHatchEnergy; -import gregtech.api.metatileentity.implementations.MTEHatchInput; -import gregtech.api.metatileentity.implementations.MTEHatchInputBus; -import gregtech.api.metatileentity.implementations.MTEHatchOutput; import gregtech.api.objects.GTRenderedTexture; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; @@ -49,7 +44,6 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; -import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti; public class MTEFuelRefineFactory extends MTETooltipMultiBlockBaseEM implements IConstructable, ISurvivalConstructable { @@ -267,59 +261,16 @@ protected void setProcessingLogicPower(ProcessingLogic logic) { logic.setAvailableAmperage(1); } - public final boolean addToFRFList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else { - if (aMetaTileEntity instanceof MTEHatch) { - ((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - } - if (aMetaTileEntity instanceof MTEHatchInput) { - return this.mInputHatches.add((MTEHatchInput) aMetaTileEntity); - } else if (aMetaTileEntity instanceof MTEHatchOutput) { - return this.mOutputHatches.add((MTEHatchOutput) aMetaTileEntity); - } else if (aMetaTileEntity instanceof MTEHatchInputBus) { - return this.mInputBusses.add((MTEHatchInputBus) aMetaTileEntity); - } else if (aMetaTileEntity instanceof MTEHatchEnergy) { - return this.mEnergyHatches.add((MTEHatchEnergy) aMetaTileEntity); - } else if (aMetaTileEntity instanceof MTEHatchEnergyMulti) { - return this.eEnergyMulti.add((MTEHatchEnergyMulti) aMetaTileEntity); - } else { - return false; - } - } - } - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new MTEFuelRefineFactory(this.mName); } - @Override - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return true; } - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - @Override public String[] getInfoData() { String[] infoData = new String[super.getInfoData().length + 1]; @@ -330,7 +281,7 @@ public String[] getInfoData() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From fba42f5ed8d337d5b701e6324c45604f102b804b Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:45:16 -0600 Subject: [PATCH 10/18] MFE - move away from deprecated onWireCutterRightClick() --- .../machines/multi/MTEIndustrialElectromagneticSeparator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java index 7bcd39d1295..2c39c12a36a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java @@ -456,7 +456,7 @@ private boolean addMagHatch(IGregTechTileEntity aTileEntity, int aBaseCasingInde @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From 179bcb5ebfd3f003b1bedd57de22e43eb2cce9f1 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:45:57 -0600 Subject: [PATCH 11/18] LCR - move away from deprecated onWireCutterRightClick() --- .../tileentities/machines/multi/MTELargeChemicalReactor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java index 02c8f19ae0c..8a09cd82354 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeChemicalReactor.java @@ -297,7 +297,7 @@ public boolean supportsBatchMode() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From 9c2e5fd44d4c8290b0d3ee0ee671f386d6fadbb8 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:46:16 -0600 Subject: [PATCH 12/18] Large Fluid Extractor - move away from deprecated onWireCutterRightClick() --- .../tileentities/machines/multi/MTELargeFluidExtractor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeFluidExtractor.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeFluidExtractor.java index 14452c623f4..d0f807c173f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeFluidExtractor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeFluidExtractor.java @@ -422,7 +422,7 @@ public float getEUMultiplier() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From 60f41277a55885d7326d32c3bab84ca29bc6cf66 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:46:31 -0600 Subject: [PATCH 13/18] MABS - move away from deprecated onWireCutterRightClick() --- .../multi/production/mega/MTEMegaAlloyBlastSmelter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java index 0c5c5ba41f1..c31b92a90fe 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/MTEMegaAlloyBlastSmelter.java @@ -429,7 +429,7 @@ public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPla @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { batchMode = !batchMode; if (batchMode) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); From e668cc7ffe3d50abb16152c1f87802e233176c06 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:47:43 -0600 Subject: [PATCH 14/18] MEBF - move away from deprecated onWireCutterRightClick() - move away from deprecated survivalConstruct() --- .../tileentities/multis/mega/MTEMegaBlastFurnace.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java index fa6d5455366..8e3dda55aad 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java @@ -30,7 +30,6 @@ import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -39,8 +38,8 @@ import net.minecraftforge.fluids.FluidStack; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import bartworks.API.BorosilicateGlass; @@ -222,7 +221,7 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (!aPlayer.isSneaking()) { this.inputSeparation = !this.inputSeparation; GTUtility.sendChatToPlayer( @@ -329,12 +328,12 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); this.glassTier = 0; this.setCoilLevel(HeatingCoilLevel.None); - return this.survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, source, actor, false, true); + return this.survivialBuildPiece("main", stackSize, 7, 17, 0, realBudget, env, false, true); } public void setCoilLevel(HeatingCoilLevel aCoilLevel) { From d3e90e00d1b81d745a6f881daf621410fde2afb0 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:48:33 -0600 Subject: [PATCH 15/18] MCR - move away from deprecated onWireCutterRightClick() - move away from deprecated survivalConstruct() --- .../multis/mega/MTEMegaChemicalReactor.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java index 14e59081604..d1f1daab168 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java @@ -25,7 +25,6 @@ import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -33,8 +32,8 @@ import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import bartworks.API.BorosilicateGlass; @@ -160,7 +159,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { this.batchMode = !this.batchMode; if (this.batchMode) { @@ -185,11 +184,10 @@ public void construct(ItemStack aStack, boolean aHintsOnly) { } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - return this - .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); + return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, env, false, true); } // -------------- TEC TECH COMPAT ---------------- From fd4cd1f3c930db81aa1d34d0ae5fb81ad67b74cc Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:50:56 -0600 Subject: [PATCH 16/18] MDT - move away from deprecated onWireCutterRightClick() - move away from deprecated survivalConstruct() --- .../multis/mega/MTEMegaDistillTower.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java index 95ddef6b8af..62697dcb8fd 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java @@ -27,7 +27,6 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -36,9 +35,9 @@ import net.minecraftforge.fluids.FluidStack; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElementCheckOnly; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import bartworks.common.configs.Configuration; @@ -327,12 +326,11 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); this.mHeight = 0; - int built = this - .survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, source, actor, false, true); + int built = this.survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 7, 0, 0, realBudget, env, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { @@ -344,8 +342,7 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource 5 * this.mHeight, 0, realBudget, - source, - actor, + env, false, true); if (built >= 0) return built; @@ -358,8 +355,7 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource 5 * this.mHeight, 0, realBudget, - source, - actor, + env, false, true); } @@ -374,7 +370,7 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { this.batchMode = !this.batchMode; if (this.batchMode) { From ea27d486b35c64252fd1db53ca0a2f8eb6cc01ce Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Mon, 23 Dec 2024 19:51:41 -0600 Subject: [PATCH 17/18] Mega Oil Cracker - move away from deprecated onWireCutterRightClick() - move away from deprecated survivalConstruct() --- .../tileentities/multis/mega/MTEMegaOilCracker.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java index 30beb268d07..4235cb14baa 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java @@ -34,7 +34,6 @@ import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @@ -43,8 +42,8 @@ import net.minecraftforge.fluids.FluidStack; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; -import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import bartworks.API.BorosilicateGlass; @@ -246,11 +245,10 @@ public void construct(ItemStack aStack, boolean aHintsOnly) { } @Override - public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { + public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); - return this - .survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, source, actor, false, true); + return this.survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 6, 6, 0, realBudget, env, false, true); } // -------------- TEC TECH COMPAT ---------------- @@ -429,7 +427,7 @@ public boolean supportsBatchMode() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { From aca53b2f4b6ba5388eb2aff4c0da349901e59cc7 Mon Sep 17 00:00:00 2001 From: Crystie <50521339+CrystieColon3@users.noreply.github.com> Date: Tue, 24 Dec 2024 05:45:15 +0300 Subject: [PATCH 18/18] LES (#3702) - move away from deprecated stopMachine() - remove unused addEnergyHatchToMachineList() - remove 4 methods identical to super - clean up smaller warnings --- .../tileEntity/MTELargeEssentiaSmeltery.java | 55 +++---------------- 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java index 161108d74b6..8c30e1ef677 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.Map; +import java.util.Objects; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -37,7 +38,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.MTEHatchEnergy; import gregtech.api.metatileentity.implementations.MTEHatchMuffler; import gregtech.api.objects.XSTR; import gregtech.api.recipe.check.CheckRecipeResult; @@ -46,7 +46,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; -import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti; +import gregtech.api.util.shutdown.ShutDownReason; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -161,7 +161,8 @@ public IStructureDefinition getStructure_EM() { .addElement('D', ofBlock(ConfigBlocks.blockCosmeticOpaque, 2)) .addElement( 'F', - ThaumicBases.isModLoaded() ? ofBlock(Block.getBlockFromName("thaumicbases:advAlchFurnace"), 0) + ThaumicBases.isModLoaded() + ? ofBlock(Objects.requireNonNull(Block.getBlockFromName("thaumicbases:advAlchFurnace")), 0) : ofBlock(ConfigBlocks.blockStoneDevice, 0)) .addElement( 'E', @@ -272,28 +273,8 @@ protected void onEssentiaCellFound(int tier) { this.pTier = tier; } - private boolean addEnergyHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof MTEHatchEnergy) { - if (((MTEHatchEnergy) aMetaTileEntity).mTier < 3) return false; - ((MTEHatchEnergy) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((MTEHatchEnergy) aMetaTileEntity); - } else if (aMetaTileEntity instanceof MTEHatchEnergyMulti) { - ((MTEHatchEnergyMulti) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.eEnergyMulti.add(((MTEHatchEnergyMulti) aMetaTileEntity)); - } else { - return false; - } - } - } - private boolean addEssentiaOutputHatchToMachineList(MTEEssentiaOutputHatch aTileEntity) { - if (aTileEntity instanceof MTEEssentiaOutputHatch) { + if (aTileEntity != null) { return this.mEssentiaOutputHatches.add(aTileEntity); } return false; @@ -416,7 +397,7 @@ private AspectList getEssentia(ItemStack itemStack, int amount) { } AspectList aspects = ThaumcraftCraftingManager.getObjectTags(itemStack); aspects = ThaumcraftCraftingManager.getBonusTags(itemStack, aspects); - if (aspects != null && aspects.size() != 0 && aspects.getAspects()[0] != null) { + if (aspects.size() != 0 && aspects.getAspects()[0] != null) { for (int i = 0; i < amount; i++) aspectList.add(aspects); } else aspectList.add(Aspect.ENTROPY, amount); return aspectList; @@ -498,8 +479,8 @@ protected void addClassicOutputs_EM() { } @Override - public void stopMachine() { - super.stopMachine(); + public void stopMachine(@NotNull ShutDownReason reason) { + super.stopMachine(reason); this.mOutputAspects.aspects.clear(); } @@ -577,31 +558,11 @@ public boolean onRunningTick(ItemStack aStack) { return super.onRunningTick(aStack); } - @Override - public boolean isCorrectMachinePart(ItemStack itemStack) { - return true; - } - @Override public int getPollutionPerSecond(ItemStack aStack) { return 22 * (100 - this.nodePurificationEfficiency); } - @Override - public int getMaxEfficiency(ItemStack itemStack) { - return 10000; - } - - @Override - public int getDamageToComponent(ItemStack itemStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack itemStack) { - return false; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new MTELargeEssentiaSmeltery(this.mName);