From 2be64a7d8df7cd913643ebbedc01a7440c5abc86 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Tue, 24 Sep 2024 21:29:22 -0400 Subject: [PATCH 1/5] refactored machine tool actions --- .../common/tileentities/multis/MTEBioVat.java | 16 - .../multis/MTECircuitAssemblyLine.java | 27 +- .../multis/MTEDeepEarthHeatingPump.java | 14 +- .../MTEElectricImplosionCompressor.java | 15 - .../multis/MTEHighTempGasCooledReactor.java | 5 +- .../multis/MTEThoriumHighTempReactor.java | 5 +- .../multis/mega/MTEMegaBlastFurnace.java | 19 - .../multis/mega/MTEMegaChemicalReactor.java | 23 - .../multis/mega/MTEMegaDistillTower.java | 15 - .../multis/mega/MTEMegaOilCracker.java | 15 - .../multis/mega/MTEMegaVacuumFreezer.java | 15 - .../common/tileentities/tiered/MTEDiode.java | 24 +- .../galacticgreg/MTEVoidMinerBase.java | 3 +- src/main/java/ggfab/mte/MTEAdvAssLine.java | 14 - .../java/ggfab/mte/MTELinkedInputBus.java | 12 +- .../tileEntity/AntimatterGenerator.java | 3 +- .../tileEntity/AntimatterOutputHatch.java | 6 +- .../GTMetaTileEntity/MTEYOTTAHatch.java | 13 +- .../tileEntity/MTEComponentAssemblyLine.java | 23 - .../tileEntity/MTENeutronActivator.java | 12 - .../tileEntity/MTEPreciseAssembler.java | 6 +- .../MTESupercriticalFluidTurbine.java | 5 +- .../blocks/tileEntity/MTEYottaFluidTank.java | 8 +- .../tileEntity/base/MTELargeTurbineBase.java | 3 +- .../metatileentity/IMetaTileEntity.java | 22 +- .../metatileentity/BaseMetaPipeEntity.java | 324 ++++++------- .../metatileentity/BaseMetaTileEntity.java | 424 +++++++----------- .../metatileentity/CommonMetaTileEntity.java | 5 + .../api/metatileentity/MetaPipeEntity.java | 41 +- .../api/metatileentity/MetaTileEntity.java | 66 ++- .../implementations/MTEBasicMachine.java | 53 ++- .../implementations/MTEBuffer.java | 30 +- .../implementations/MTECable.java | 6 +- .../MTEEnhancedMultiBlockBase.java | 8 +- .../implementations/MTEHatchInputBus.java | 14 +- .../implementations/MTEHatchMaintenance.java | 11 +- .../implementations/MTEHatchOutput.java | 5 +- .../implementations/MTEItem.java | 15 +- .../implementations/MTEMultiBlockBase.java | 85 +++- .../gregtech/api/util/GTLanguageManager.java | 4 +- .../java/gregtech/api/util/GTUtility.java | 85 ++++ src/main/java/gregtech/common/GTClient.java | 15 +- .../automation/MTEItemDistributor.java | 3 +- .../tileentities/automation/MTERegulator.java | 5 - .../debug/MTEAdvDebugStructureWriter.java | 3 +- .../generators/MTEMagicalEnergyAbsorber.java | 10 +- .../machines/MTEHatchCraftingInputME.java | 5 +- .../machines/MTEHatchInputBusME.java | 14 +- .../machines/MTEHatchInputME.java | 18 +- .../machines/MTEHatchOutputBusME.java | 11 +- .../machines/MTEHatchOutputME.java | 10 +- .../tileentities/machines/basic/MTEMiner.java | 15 +- .../tileentities/machines/basic/MTEPump.java | 48 +- .../machines/basic/MTEWorldAccelerator.java | 6 +- .../machines/multi/MTEDrillerBase.java | 5 +- .../multi/MTEElectricBlastFurnace.java | 8 - ...MTEIndustrialElectromagneticSeparator.java | 13 +- .../multi/MTEIndustrialLaserEngraver.java | 26 +- .../multi/MTEIntegratedOreFactory.java | 9 +- .../machines/multi/MTELargeTurbine.java | 5 +- .../machines/multi/MTEMultiCanner.java | 13 +- .../machines/multi/MTENanoForge.java | 8 - .../machines/multi/MTEOilDrillBase.java | 12 +- .../multi/MTEOreDrillingPlantBase.java | 19 +- .../machines/multi/MTEPCBFactory.java | 8 - .../machines/multi/MTEProcessingArray.java | 28 +- .../compressor/MTEBlackHoleCompressor.java | 4 +- .../machines/multi/drone/MTEDroneCentre.java | 4 +- .../storage/MTEDigitalChestBase.java | 27 +- .../storage/MTEDigitalTankBase.java | 13 +- .../tileentities/storage/MTELocker.java | 3 +- .../MTEHatchElementalDataOrbHolder.java | 3 - .../implementations/MTEHatchTurbine.java | 63 +-- .../MTEHatchTurbineProvider.java | 3 +- .../MteHatchSteamBusInput.java | 9 +- .../base/GTPPMultiBlockBase.java | 36 +- .../base/MTETransformerHiAmp.java | 4 +- .../automation/MTETesseractGenerator.java | 13 +- .../automation/MTETesseractTerminal.java | 28 +- .../basic/MTEAtmosphericReconditioner.java | 5 - .../machines/basic/MTEPollutionCreator.java | 6 +- .../machines/basic/MTEPollutionDetector.java | 11 +- .../machines/basic/MTEWirelessCharger.java | 6 +- .../multi/misc/MTEAmazonPackager.java | 13 +- .../processing/MTEIndustrialArcFurnace.java | 3 +- .../processing/MTEIndustrialCentrifuge.java | 3 +- .../MTEIndustrialCuttingMachine.java | 13 +- .../processing/MTEIndustrialDehydrator.java | 3 +- .../multi/processing/MTEIndustrialMixer.java | 8 - .../processing/MTEIndustrialMultiMachine.java | 8 - .../processing/MTEIndustrialPlatePress.java | 13 +- .../processing/MTEIndustrialWashPlant.java | 8 - .../processing/MTEIndustrialWireMill.java | 8 - .../advanced/MTEAdvDistillationTower.java | 6 +- .../multi/processing/advanced/MTEAdvEBF.java | 8 - .../production/MTEAlloyBlastSmelter.java | 8 - .../multi/production/MTEMassFabricator.java | 3 +- .../MTEQuantumForceTransformer.java | 3 +- .../multi/production/MTESolarTower.java | 3 - .../mega/MTEMegaAlloyBlastSmelter.java | 28 -- .../turbines/MTELargerTurbineBase.java | 13 +- ...aTileEntity_PowerSubStationController.java | 3 +- .../redstone/MTERedstoneButtonPanel.java | 4 +- .../redstone/MTERedstoneStrengthDisplay.java | 4 +- .../redstone/MTERedstoneStrengthScale.java | 4 +- .../tileentities/storage/MTEEnergyBuffer.java | 3 +- .../MTELapotronicSuperCapacitor.java | 4 +- .../common/tileentities/MTETankTFFT.java | 4 +- .../multiblock/MTEExtremeEntityCrusher.java | 16 +- .../MTEExtremeIndustrialGreenhouse.java | 3 +- .../multiblock/MTEMegaIndustrialApiary.java | 7 +- .../hatch/MTEHatchDynamoTunnel.java | 4 +- .../hatch/MTEHatchEnergyTunnel.java | 5 +- .../metaTileEntity/multi/MTEDataBank.java | 3 +- .../metaTileEntity/multi/MTEEyeOfHarmony.java | 3 +- .../metaTileEntity/multi/MTEForgeOfGods.java | 5 +- .../multi/MTEQuantumComputer.java | 3 +- .../multi/MTEResearchStation.java | 4 +- .../single/MTEDebugPowerGenerator.java | 7 +- .../single/MTEDebugStructureWriter.java | 3 +- .../single/MTEOwnerDetector.java | 3 +- .../metaTileEntity/single/MTETeslaCoil.java | 10 +- .../assets/bartworks/lang/en_US.lang | 3 - .../resources/assets/gregtech/lang/en_US.lang | 28 +- .../assets/miscutils/lang/en_US.lang | 4 - 125 files changed, 972 insertions(+), 1371 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java b/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java index 7859cc587d8..48448d39666 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java @@ -815,20 +815,4 @@ public boolean supportsVoidProtection() { public boolean supportsBatchMode() { return true; } - - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - } diff --git a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java index 46f5e666491..a26a3b5a97f 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java @@ -302,12 +302,12 @@ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aP } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { this.mode = (this.mode + 1) % 2; - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("chat.cal.mode." + this.mode)); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "chat.cal.mode." + this.mode); } - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + return true; } @Override @@ -604,27 +604,6 @@ protected boolean supportsSlotAutomation(int aSlot) { return aSlot == getControllerSlotIndex(); } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - 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) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - } - @Override public boolean supportsInputSeparation() { return mode != 0; diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java index b9ab023dae0..67754aa7e58 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java @@ -197,13 +197,13 @@ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zD } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (this.getBaseMetaTileEntity() - .getWorld().isRemote) return; - ++this.mMode; - if (this.mMode >= 4) this.mMode = 0; - GTUtility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (getBaseMetaTileEntity().isServerSide()) { + this.mMode++; + if (this.mMode >= 4) this.mMode = 0; + GTUtility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); + } + return true; } @Override diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java b/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java index 1339c11095c..1a570ac92fe 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java @@ -543,21 +543,6 @@ public boolean supportsBatchMode() { return true; } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - @Override public boolean supportsVoidProtection() { return true; diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java b/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java index 3250c7ce0d4..ac10da9ce8c 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java @@ -450,15 +450,16 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "HTGR mode cannot be changed while the machine is running."); - return; + return false; } this.empty = !this.empty; GTUtility.sendChatToPlayer( aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + return true; } @Override diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java b/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java index ee9b8a5baf6..31410a20148 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java @@ -379,15 +379,16 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "THTR mode cannot be changed while the machine is running."); - return; + return false; } this.empty = !this.empty; GTUtility.sendChatToPlayer( aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + return true; } @Override 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 12d36dd9448..3c3e3e4493e 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java @@ -222,25 +222,6 @@ public void loadNBTData(NBTTagCompound aNBT) { } } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (!aPlayer.isSneaking()) { - this.inputSeparation = !this.inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + this.inputSeparation); - return true; - } - this.batchMode = !this.batchMode; - if (this.batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, int aColorIndex, boolean aActive, boolean aRedstone) { 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 3c15af0faee..ff280d574be 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java @@ -152,29 +152,6 @@ public void loadNBTData(NBTTagCompound aNBT) { } } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - this.batchMode = !this.batchMode; - if (this.batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - @Override protected ProcessingLogic createProcessingLogic() { return new ProcessingLogic().enablePerfectOverclock() 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 ac6a0ae6b4b..325fd4ac286 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java @@ -374,21 +374,6 @@ public void loadNBTData(NBTTagCompound aNBT) { } } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - this.batchMode = !this.batchMode; - if (this.batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - @Override protected ProcessingLogic createProcessingLogic() { return new ProcessingLogic().setMaxParallel(Configuration.Multiblocks.megaMachinesMax); 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 4424bc62cc1..7ea56d2b46e 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java @@ -423,21 +423,6 @@ public boolean supportsBatchMode() { return true; } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - @Override public boolean supportsVoidProtection() { return true; diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java index fdc0a465cfe..d528f57b66c 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java @@ -383,21 +383,6 @@ public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - this.batchMode = !this.batchMode; - if (this.batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - public SubspaceCoolingFluid findSubspaceCoolingFluid() { // Loop over all hatches and find the first match with a valid fluid for (MTEHatchInput hatch : mInputHatches) { diff --git a/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java b/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java index ad3a39320f7..7c0cf1a99a0 100644 --- a/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java +++ b/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java @@ -25,6 +25,7 @@ import static gregtech.api.enums.MetaTileEntityIDs.Diode8A_ULV; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; @@ -65,19 +66,18 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - - if (this.getBaseMetaTileEntity() - .getWorld().isRemote) return; - if (!aPlayer.isSneaking()) { - --this.aAmps; - if (this.aAmps < 0) this.aAmps = this.maxAmps; - } else { - ++this.aAmps; - if (this.aAmps > this.maxAmps) this.aAmps = 0; + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (getBaseMetaTileEntity().isServerSide()) { + if (!aPlayer.isSneaking()) { + --this.aAmps; + if (this.aAmps < 0) this.aAmps = this.maxAmps; + } else { + ++this.aAmps; + if (this.aAmps > this.maxAmps) this.aAmps = 0; + } + GTUtility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } - GTUtility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); + return true; } @Override diff --git a/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java b/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java index 3744d26aa46..e1c1dd25e05 100644 --- a/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java +++ b/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java @@ -302,8 +302,9 @@ private void handleOutputs() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { this.mBlacklist = !this.mBlacklist; GTUtility.sendChatToPlayer(aPlayer, "Mode: " + (this.mBlacklist ? "Blacklist" : "Whitelist")); + return true; } } diff --git a/src/main/java/ggfab/mte/MTEAdvAssLine.java b/src/main/java/ggfab/mte/MTEAdvAssLine.java index 04d9a9118fb..ff30d8b5ed1 100644 --- a/src/main/java/ggfab/mte/MTEAdvAssLine.java +++ b/src/main/java/ggfab/mte/MTEAdvAssLine.java @@ -992,20 +992,6 @@ public boolean supportsBatchMode() { return true; } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, "Batch mode enabled"); - } else { - GTUtility.sendChatToPlayer(aPlayer, "Batch mode disabled"); - } - } - return true; - } - private class SliceStatusWidget extends TextWidget implements ISyncedWidget { private final Slice slice; diff --git a/src/main/java/ggfab/mte/MTELinkedInputBus.java b/src/main/java/ggfab/mte/MTELinkedInputBus.java index 0e84c4967d2..762824db5d8 100644 --- a/src/main/java/ggfab/mte/MTELinkedInputBus.java +++ b/src/main/java/ggfab/mte/MTELinkedInputBus.java @@ -336,18 +336,11 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!getBaseMetaTileEntity().getCoverBehaviorAtSideNew(side) - .isGUIClickable( - side, - getBaseMetaTileEntity().getCoverIDAtSide(side), - getBaseMetaTileEntity().getComplexCoverDataAtSide(side), - getBaseMetaTileEntity())) - return; + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { if (this.mRealInventory == null) { aPlayer.addChatMessage(new ChatComponentTranslation("ggfab.info.linked_input_bus.no_channel")); - return; + return false; } if (mRealInventory.disableSort) { mRealInventory.disableSort = false; @@ -369,6 +362,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f aPlayer, StatCollector.translateToLocal("GT5U.hatch.disableFilter." + this.disableFilter)); } + return true; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java index 8cb3fed65b3..69de9093d73 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java @@ -282,12 +282,13 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { wirelessEnabled = !wirelessEnabled; GTUtility.sendChatToPlayer(aPlayer, "Wireless network mode " + (wirelessEnabled ? "enabled." : "disabled.")); if (wirelessEnabled) { GTUtility.sendChatToPlayer(aPlayer, "Wireless only works with UMV Superconductor Base or better."); } + return true; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java index f575e2f315f..44334b93af4 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java @@ -1,6 +1,7 @@ package goodgenerator.blocks.tileEntity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -51,14 +52,13 @@ protected void onEmptyingContainerWhenEmpty() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!getBaseMetaTileEntity().getCoverInfoAtSide(side) - .isGUIClickable()) return; + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { mMode = (byte) ((mMode + 9) % 10); } else { mMode = (byte) ((mMode + 1) % 10); } + return true; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java index 51dbc7f1999..21bc5da7c0e 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java @@ -105,12 +105,15 @@ public boolean isAccessAllowed(EntityPlayer aPlayer) { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack toolStack) { - if (aPlayer.isSneaking()) this.priority -= 10; - else this.priority += 10; - GTUtility - .sendChatToPlayer(aPlayer, String.format(StatCollector.translateToLocal("yothatch.chat.0"), this.priority)); + if (aPlayer.isSneaking()) { + this.priority -= 10; + } else { + this.priority += 10; + } + GTUtility.sendLocalizedChatToPlayer(aPlayer, "yothatch.chat.0", this.priority); + return true; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java index 6485f0769a0..9084b72ae33 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java @@ -346,29 +346,6 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a return checkPiece(STRUCTURE_PIECE_MAIN, 4, 2, 0); } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack aTool) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, "Batch recipes."); - } else { - GTUtility.sendChatToPlayer(aPlayer, "Don't batch recipes."); - } - } - - return true; - } - @Override public boolean supportsInputSeparation() { return true; diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java b/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java index 97efc45ba7d..3cf330625df 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java @@ -134,18 +134,6 @@ protected void setProcessingLogicPower(ProcessingLogic logic) { logic.setAvailableAmperage(1); } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java index 7eef5abfe56..d2f8930bd46 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java @@ -234,12 +234,12 @@ public void saveNBTData(NBTTagCompound aNBT) { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { this.mode = (this.mode + 1) % 2; - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("preciseassembler.chat." + this.mode)); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "preciseassembler.chat." + this.mode); } - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + return true; } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java index 3c44da9ca3f..0d2d5d643e5 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java @@ -89,13 +89,16 @@ public int fluidIntoPower(ArrayList aFluids, TurbineStatCalculator t } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GTUtility.sendChatToPlayer( aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); + return true; + } else { + return false; } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java index ccac1e3fb6b..38345497a7b 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java @@ -564,20 +564,20 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack toolStack) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { + if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { voidExcessEnabled ^= true; aPlayer.addChatMessage( new ChatComponentTranslation( voidExcessEnabled ? "yottank.chat.voidExcessEnabled" : "yottank.chat.voidExcessDisabled")); return true; } - return false; + return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, toolStack); } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack toolStack) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { + if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { if (mLockedFluid == null) { if (mFluid != null) { mLockedFluid = mFluid; @@ -593,7 +593,7 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench } return true; } - return false; + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, toolStack); } @Override diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java index 7b06dbb96d7..5e36c12542c 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java @@ -323,7 +323,7 @@ public boolean hasTurbine() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GTUtility.sendChatToPlayer( @@ -331,6 +331,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f looseFit ? GTUtility.trans("500", "Fitting: Loose - More Flow") : GTUtility.trans("501", "Fitting: Tight - More Efficiency")); } + return true; } @Override diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 824925f928f..3e3e3880003 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -132,26 +132,32 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand /** * When a Player right-clicks the Facing with a Screwdriver. */ - void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, - ItemStack aTool); + boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool); /** * When a Player right-clicks the Facing with a Wrench. */ - boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, - float aY, float aZ, ItemStack aTool); + boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool); /** * When a Player right-clicks the Facing with a wire cutter. */ - boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, - float aX, float aY, float aZ, ItemStack aTool); + boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool); /** * When a Player right-clicks the Facing with a soldering iron. */ - boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, - float aX, float aY, float aZ, ItemStack aTool); + boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool); + + /** + * When a player right-clicks a side with a hard hammer. + */ + boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool); + + /** + * When a player right-clicks a side with a jack hammer. + */ + boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool); /** * Called right before this Machine explodes diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 30a1561f203..ae214f8fc96 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -2,6 +2,8 @@ import static gregtech.GTMod.GT_FML_LOGGER; import static gregtech.api.enums.GTValues.NW; +import static gregtech.api.util.GTUtility.getDisabledText; +import static gregtech.api.util.GTUtility.getEnabledText; import java.util.ArrayList; import java.util.Arrays; @@ -45,6 +47,7 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtility.ToolType; import gregtech.common.covers.CoverInfo; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; @@ -794,222 +797,177 @@ public boolean shouldDropItemAt(int index) { } @Override - public boolean onRightclick(EntityPlayer aPlayer, ForgeDirection side, float aX, float aY, float aZ) { + public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, float aX, float aY, float aZ) { + final ForgeDirection wrenchSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); + final ForgeDirection coverSide = getCoverIDAtSide(side) == 0 ? wrenchSide : side; + if (isClientSide()) { // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { - final ForgeDirection tSide = (getCoverIDAtSide(side) == 0) - ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) - : side; - return (getCoverInfoAtSide(tSide).hasCoverGUI()); - } else if (getCoverBehaviorAtSideNew(side).onCoverRightclickClient(side, this, aPlayer, aX, aY, aZ)) { + return getCoverBehaviorAtSideNew(coverSide).hasCoverGUI(); + } else if (getCoverBehaviorAtSideNew(coverSide).onCoverRightclickClient(side, this, aPlayer, aX, aY, aZ)) { return true; } } + + if (!getCoverInfoAtSide(coverSide).isGUIClickable()) return false; + if (isServerSide()) { final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (getColorization() >= 0 - && GTUtility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { - mMetaTileEntity.markDirty(); - tCurrentItem.func_150996_a(Items.bucket); - setColorization((byte) -1); - return true; - } - final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList)) { - - if (mMetaTileEntity.onWrenchRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { - mMetaTileEntity.markDirty(); - GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + + ToolType tool = ToolType.getToolType(tCurrentItem); + + // don't use the water if there's no colour + if (tool == ToolType.DyeEraser && getColorization() < 0) tool = null; + + if (tool != null) { + boolean usedTool = false; + + switch (tool) { + case Crowbar: { + if (getCoverIDAtSide(coverSide) != 0) { + dropCover(coverSide, side, false); + usedTool = true; + } + break; } - return true; - } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sScrewdriverList)) { - if (getCoverIDAtSide(side) == 0 && getCoverIDAtSide(tSide) != 0) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { - setCoverDataAtSide( - tSide, - getCoverInfoAtSide(tSide).onCoverScrewdriverClick(aPlayer, 0.5F, 0.5F, 0.5F)); - mMetaTileEntity.onScrewdriverRightClick(tSide, aPlayer, aX, aY, aZ, tCurrentItem); - mMetaTileEntity.markDirty(); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + case DyeEraser: { + setColorization((byte) (getColorization() >= 16 ? -2 : -1)); + usedTool = true; + break; + } + case HardHammer: { + usedTool = mMetaTileEntity.onHardHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); + break; + } + case Jackhammer: { + if (getCoverIDAtSide(coverSide) != 0) { + // Configuration of delicate electronics calls for a tool with precision and subtlety. + final CoverInfo info = getCoverInfoAtSide(coverSide); + info.updateCoverBehavior(); + if (info.getCoverBehavior().allowsTickRateAddition()) { + info.onCoverJackhammer(aPlayer); + usedTool = true; + } else { + GTUtility.sendLocalizedChatToPlayer( + aPlayer, + "gt.cover.info.chat.tick_rate_not_allowed"); + return true; + } + } else { + usedTool = mMetaTileEntity.onJackHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); } - } else { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - setCoverDataAtSide( - side, - getCoverInfoAtSide(side).onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); - mMetaTileEntity.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tCurrentItem); - mMetaTileEntity.markDirty(); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + + break; + } + case Screwdriver: { + if (getCoverIDAtSide(coverSide) != 0) { + final CoverInfo info = getCoverInfoAtSide(coverSide); + info.updateCoverBehavior(); + setCoverDataAtSide(side, info.onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); + usedTool = true; + } else { + usedTool = mMetaTileEntity.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tCurrentItem); } + break; } - return true; - } + case SoftHammer: { + if (mWorks) { + disableWorking(); + } else { + enableWorking(); + } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sHardHammerList)) { - return true; - } + if (mMetaTileEntity.hasAlternativeModeText()) { + GTUtility.sendChatToPlayer(aPlayer, mMetaTileEntity.getAlternativeModeText()); + } else { + GTUtility.sendChatToPlayer( + aPlayer, + GTUtility.trans("090", "Machine Processing: "), + isAllowedToWork() ? getEnabledText() : getDisabledText()); + } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSoftHammerList)) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - if (mWorks) disableWorking(); - else enableWorking(); - mMetaTileEntity.markDirty(); - GTUtility.sendChatToPlayer( - aPlayer, - GTUtility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GTUtility.trans("088", "Enabled") - : GTUtility.trans("087", "Disabled"))); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + usedTool = true; + break; } - return true; - } + case SolderingIron: { + if (mMetaTileEntity.onSolderingToolRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + usedTool = true; + } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { + mStrongRedstone ^= wrenchSide.flag; + usedTool = true; + + issueBlockUpdate(); + doEnetUpdate(); + + GTUtility.sendChatToPlayer( + aPlayer, + GTUtility.trans("091", "Redstone Output at Side "), + wrenchSide, + GTUtility.trans("092", " set to: "), + (mStrongRedstone & wrenchSide.flag) != 0 ? GTUtility.trans("093", "Strong") + : GTUtility.trans("094", "Weak")); + } + break; + } + case WireCutter: { + if (mMetaTileEntity.onWireCutterRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + usedTool = true; - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWireCutterList)) { - if (mMetaTileEntity.onWireCutterRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { - mMetaTileEntity.markDirty(); - // logic handled internally - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + doEnetUpdate(); + } + break; + } + case Wrench: { + if (mMetaTileEntity.onWrenchRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + usedTool = true; + } + break; } - doEnetUpdate(); - return true; } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) { - if (mMetaTileEntity.onSolderingToolRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { - mMetaTileEntity.markDirty(); - // logic handled internally - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { - mMetaTileEntity.markDirty(); - mStrongRedstone ^= tSide.flag; - GTUtility.sendChatToPlayer( - aPlayer, - GTUtility.trans("091", "Redstone Output at Side ") + tSide - + GTUtility.trans("092", " set to: ") - + ((mStrongRedstone & tSide.flag) != 0 ? GTUtility.trans("093", "Strong") - : GTUtility.trans("094", "Weak"))); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 3.0F, - -1, - xCoord, - yCoord, - zCoord); - issueBlockUpdate(); + if (usedTool) { + if (tool.useSound != null) { + sendSoundToPlayers(tool.useSound); } - doEnetUpdate(); + tool.onUse(aPlayer); return true; } - - ForgeDirection coverSide = side; - if (getCoverIDAtSide(side) == 0) coverSide = tSide; - - final CoverInfo coverInfo = getCoverInfoAtSide(coverSide); - - if (coverInfo.getCoverID() == 0) { - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCovers.keySet())) { - final CoverBehaviorBase coverBehavior = GregTechAPI.getCoverBehaviorNew(tCurrentItem); - if (coverBehavior.isCoverPlaceable(coverSide, tCurrentItem, this) - && mMetaTileEntity.allowCoverOnSide(coverSide, new GTItemStack(tCurrentItem))) { - - setCoverItemAtSide(coverSide, tCurrentItem); - coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, side); - - mMetaTileEntity.markDirty(); - if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - sendClientData(); - } - return true; - } + } else { + if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. + return getCoverInfoAtSide(coverSide).onCoverShiftRightClick(aPlayer); } else { - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCrowbarList)) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_BREAK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - dropCover(coverSide, side, false); - mMetaTileEntity.markDirty(); + if (getCoverIDAtSide(coverSide) == 0) { + if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCovers.keySet())) { + final CoverBehaviorBase coverBehavior = GregTechAPI.getCoverBehaviorNew(tCurrentItem); + if (coverBehavior.isCoverPlaceable(coverSide, tCurrentItem, this) + && mMetaTileEntity.allowCoverOnSide(coverSide, new GTItemStack(tCurrentItem))) { + + setCoverItemAtSide(coverSide, tCurrentItem); + coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, coverSide); + + if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; + sendSoundToPlayers(SoundResource.IC2_TOOLS_WRENCH); + sendClientData(); + } + return true; } - return true; } } - } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config or turn back. - side = (getCoverIDAtSide(side) == 0) ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; - final CoverInfo coverInfo = getCoverInfoAtSide(side); - return coverInfo.isValid() && coverInfo.onCoverShiftRightClick(aPlayer); } - if (getCoverInfoAtSide(side).onCoverRightClick(aPlayer, aX, aY, aZ)) return true; + if (getCoverInfoAtSide(coverSide).onCoverRightClick(aPlayer, aX, aY, aZ)) return true; } - if (!getCoverInfoAtSide(side).isGUIClickable()) return false; + try { if (!aPlayer.isSneaking() && hasValidMetaTileEntity()) { - boolean value = mMetaTileEntity.onRightclick(this, aPlayer, side, aX, aY, aZ); - mMetaTileEntity.markDirty(); - return value; + return mMetaTileEntity.onRightclick(this, aPlayer, side, aX, aY, aZ); } } catch (Throwable e) { - GT_FML_LOGGER.error("Encountered Exception while right clicking TileEntity", e); + GTLog.err.println( + "Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); + e.printStackTrace(GTLog.err); + e.printStackTrace(); } return false; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 1229dfcc5b7..0b8487bfa5a 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -4,6 +4,8 @@ import static gregtech.api.enums.GTValues.NW; import static gregtech.api.enums.GTValues.V; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import static gregtech.api.util.GTUtility.getDisabledText; +import static gregtech.api.util.GTUtility.getEnabledText; import java.lang.reflect.Field; import java.util.ArrayList; @@ -21,7 +23,6 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; @@ -81,6 +82,7 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtility.ToolType; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.common.Pollution; @@ -113,8 +115,8 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity protected boolean mReleaseEnergy = false; protected final long[] mAverageEUInput = new long[] { 0, 0, 0, 0, 0 }; protected final long[] mAverageEUOutput = new long[] { 0, 0, 0, 0, 0 }; - private boolean mHasEnoughEnergy = true, mRunningThroughTick = false, mInputDisabled = false, - mOutputDisabled = false, mMuffler = false, mLockUpgrade = false; + private boolean mHasEnoughEnergy = true, mRunningThroughTick = false, mMuffler = false, mLockUpgrade = false; + public boolean mInputDisabled = false, mOutputDisabled = 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, @@ -1340,14 +1342,17 @@ public boolean decreaseStoredSteam(long aEnergy, boolean aIgnoreTooLessEnergy) { return false; } - public boolean playerOwnsThis(EntityPlayer aPlayer, boolean aCheckPrecicely) { + public boolean playerOwnsThis(EntityPlayer aPlayer, boolean aCheckPrecisely) { if (!canAccessData()) return false; - if (aCheckPrecicely || privateAccess() || (mOwnerName.length() == 0)) - if ((mOwnerName.length() == 0) && isServerSide()) { + if (aCheckPrecisely || privateAccess() || mOwnerName.length() == 0) { + if (mOwnerName.length() == 0 && isServerSide()) { setOwnerName(aPlayer.getDisplayName()); setOwnerUuid(aPlayer.getUniqueID()); - } else return !privateAccess() || aPlayer.getDisplayName() - .equals("Player") || mOwnerName.equals("Player") || mOwnerName.equals(aPlayer.getDisplayName()); + } else { + return !privateAccess() || aPlayer.getDisplayName() + .equals("Player") || mOwnerName.equals("Player") || mOwnerName.equals(aPlayer.getDisplayName()); + } + } return true; } @@ -1481,197 +1486,153 @@ public int getUpgradeCount() { } @Override - public boolean onRightclick(EntityPlayer aPlayer, ForgeDirection side, float aX, float aY, float aZ) { + public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, float aX, float aY, float aZ) { + final ForgeDirection wrenchSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); + final ForgeDirection coverSide = getCoverIDAtSide(side) == 0 ? wrenchSide : side; + if (isClientSide()) { // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { - final ForgeDirection tSide = (getCoverIDAtSide(side) == 0) - ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) - : side; - return (getCoverBehaviorAtSideNew(tSide).hasCoverGUI()); - } else if (getCoverBehaviorAtSideNew(side).onCoverRightclickClient(side, this, aPlayer, aX, aY, aZ)) { + return getCoverBehaviorAtSideNew(coverSide).hasCoverGUI(); + } else if (getCoverBehaviorAtSideNew(coverSide).onCoverRightclickClient(coverSide, this, aPlayer, aX, aY, aZ)) { return true; } - - if (!getCoverInfoAtSide(side).isGUIClickable()) return false; } - if (isServerSide()) { - if (!privateAccess() || aPlayer.getDisplayName() - .equalsIgnoreCase(getOwnerName())) { - final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (getColorization() >= 0 - && GTUtility.areStacksEqual(new ItemStack(Items.water_bucket, 1), tCurrentItem)) { - tCurrentItem.func_150996_a(Items.bucket); + if (!getCoverInfoAtSide(side).isGUIClickable()) return false; + + if (isServerSide() && playerOwnsThis(aPlayer, true)) { + final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + + ToolType tool = ToolType.getToolType(tCurrentItem); + + // don't use the water if there's no colour + if (tool == ToolType.DyeEraser && getColorization() < 0) tool = null; + + if (tool != null) { + boolean usedTool = false; + + switch (tool) { + case Crowbar: { + if (getCoverIDAtSide(coverSide) != 0) { + dropCover(coverSide, side, false); + usedTool = true; + } + break; + } + case DyeEraser: { setColorization((byte) (getColorization() >= 16 ? -2 : -1)); - return true; + usedTool = true; + break; } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList)) { - if (aPlayer.isSneaking() && mMetaTileEntity instanceof MTEBasicMachine - && ((MTEBasicMachine) mMetaTileEntity) - .setMainFacing(GTUtility.determineWrenchingSide(side, aX, aY, aZ))) { - GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - cableUpdateDelay = 10; - } else if (mMetaTileEntity.onWrenchRightClick( - side, - GTUtility.determineWrenchingSide(side, aX, aY, aZ), - aPlayer, - aX, - aY, - aZ, - tCurrentItem)) { - GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - cableUpdateDelay = 10; - } - return true; + case HardHammer: { + usedTool = mMetaTileEntity.onHardHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); + break; } - - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sScrewdriverList)) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 200, aPlayer)) { - setCoverDataAtSide( - side, - getCoverBehaviorAtSideNew(side).onCoverScrewdriverClick( - side, - getCoverIDAtSide(side), - getComplexCoverDataAtSide(side), - this, + case Jackhammer: { + if (getCoverIDAtSide(coverSide) != 0) { + // Configuration of delicate electronics calls for a tool with precision and subtlety. + final CoverInfo info = getCoverInfoAtSide(coverSide); + info.updateCoverBehavior(); + if (info.getCoverBehavior().allowsTickRateAddition()) { + info.onCoverJackhammer(aPlayer); + usedTool = true; + } else { + GTUtility.sendLocalizedChatToPlayer( aPlayer, - aX, - aY, - aZ)); - mMetaTileEntity.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tCurrentItem); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + "gt.cover.info.chat.tick_rate_not_allowed"); + return true; + } + } else { + usedTool = mMetaTileEntity.onJackHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); + } + + break; + } + case Screwdriver: { + if (getCoverIDAtSide(coverSide) != 0) { + final CoverInfo info = getCoverInfoAtSide(coverSide); + info.updateCoverBehavior(); + setCoverDataAtSide(side, info.onCoverScrewdriverClick(aPlayer, aX, aY, aZ)); + usedTool = true; + } else { + usedTool = mMetaTileEntity.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tCurrentItem); } - return true; + break; } + case SoftHammer: { + if (mWorks) { + disableWorking(); + } else { + enableWorking(); + } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sHardHammerList)) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - mInputDisabled = !mInputDisabled; - if (mInputDisabled) mOutputDisabled = !mOutputDisabled; + if (mMetaTileEntity.hasAlternativeModeText()) { + GTUtility.sendChatToPlayer(aPlayer, mMetaTileEntity.getAlternativeModeText()); + } else { GTUtility.sendChatToPlayer( aPlayer, - GTUtility.trans("086", "Auto-Input: ") - + (mInputDisabled ? GTUtility.trans("087", "Disabled") - : GTUtility.trans("088", "Enabled") + GTUtility.trans("089", " Auto-Output: ") - + (mOutputDisabled ? GTUtility.trans("087", "Disabled") - : GTUtility.trans("088", "Enabled")))); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_ANVIL_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + GTUtility.trans("090", "Machine Processing: "), + isAllowedToWork() ? getEnabledText() : getDisabledText()); } - return true; - } - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSoftHammerList)) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - if (mWorks) disableWorking(); - else enableWorking(); - { - String tChat = GTUtility.trans("090", "Machine Processing: ") - + (isAllowedToWork() ? GTUtility.trans("088", "Enabled") - : GTUtility.trans("087", "Disabled")); - if (getMetaTileEntity() != null && getMetaTileEntity().hasAlternativeModeText()) - tChat = getMetaTileEntity().getAlternativeModeText(); - GTUtility.sendChatToPlayer(aPlayer, tChat); - } - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - } - return true; + usedTool = true; + break; } - - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) { - final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); - if (mMetaTileEntity.onSolderingToolRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { - // logic handled internally - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + case SolderingIron: { + if (mMetaTileEntity.onSolderingToolRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + usedTool = true; } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { - mStrongRedstone ^= tSide.flag; + mStrongRedstone ^= wrenchSide.flag; + usedTool = true; + cableUpdateDelay = 10; + + issueBlockUpdate(); + doEnetUpdate(); + GTUtility.sendChatToPlayer( aPlayer, - GTUtility.trans("091", "Redstone Output at Side ") + tSide - + GTUtility.trans("092", " set to: ") - + ((mStrongRedstone & tSide.flag) != 0 ? GTUtility.trans("093", "Strong") - : GTUtility.trans("094", "Weak"))); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_BATTERY_USE, - 3.0F, - -1, - xCoord, - yCoord, - zCoord); - issueBlockUpdate(); + GTUtility.trans("091", "Redstone Output at Side "), + wrenchSide, + GTUtility.trans("092", " set to: "), + (mStrongRedstone & wrenchSide.flag) != 0 ? GTUtility.trans("093", "Strong") + : GTUtility.trans("094", "Weak")); } - doEnetUpdate(); - cableUpdateDelay = 10; - return true; + break; } + case WireCutter: { + if (mMetaTileEntity + .onWireCutterRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + cableUpdateDelay = 10; + usedTool = true; - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWireCutterList)) { - final ForgeDirection tSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); - if (mMetaTileEntity.onWireCutterRightClick(side, tSide, aPlayer, aX, aY, aZ, tCurrentItem)) { - // logic handled internally - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + doEnetUpdate(); } - doEnetUpdate(); - cableUpdateDelay = 10; - return true; + break; } + case Wrench: { + if (aPlayer.isSneaking() && mMetaTileEntity instanceof MTEBasicMachine basicMachine && basicMachine.setMainFacing(wrenchSide)) { + usedTool = true; + cableUpdateDelay = 10; + } else if (mMetaTileEntity.onWrenchRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + usedTool = true; + cableUpdateDelay = 10; + } + break; + } + } - ForgeDirection coverSide = side; - if (getCoverIDAtSide(side) == 0) coverSide = GTUtility.determineWrenchingSide(side, aX, aY, aZ); - + if (usedTool) { + if (tool.useSound != null) { + sendSoundToPlayers(tool.useSound); + } + tool.onUse(aPlayer); + return true; + } + } else { + if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. + return getCoverInfoAtSide(coverSide).onCoverShiftRightClick(aPlayer); + } else { if (getCoverIDAtSide(coverSide) == 0) { if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCovers.keySet())) { final CoverBehaviorBase coverBehavior = GregTechAPI.getCoverBehaviorNew(tCurrentItem); @@ -1682,121 +1643,42 @@ public boolean onRightclick(EntityPlayer aPlayer, ForgeDirection side, float aX, coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, coverSide); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_WRENCH, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); + sendSoundToPlayers(SoundResource.IC2_TOOLS_WRENCH); sendClientData(); } return true; } - } else { - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sCrowbarList)) { - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_BREAK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - dropCover(coverSide, side, false); - } - return true; - } else if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sJackhammerList)) { - // Configuration of delicate electronics calls for a tool with precision and subtlety. - if (GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - final CoverInfo info = getCoverInfoAtSide(coverSide); - if (info != CoverInfo.EMPTY_INFO) { - final CoverBehaviorBase behavior = info.getCoverBehavior(); - if (behavior.allowsTickRateAddition()) { - info.onCoverJackhammer(aPlayer); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.IC2_TOOLS_DRILL_DRILL_SOFT, - 1.0F, - 1, - xCoord, - yCoord, - zCoord); - - } else { - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("gt.cover.info.chat.tick_rate_not_allowed")); - } - return true; - } - } - } } - // End item != null - } else if (aPlayer.isSneaking()) { // Sneak click, no tool -> open cover config if possible. - side = (getCoverIDAtSide(side) == 0) ? GTUtility.determineWrenchingSide(side, aX, aY, aZ) : side; - return getCoverIDAtSide(side) > 0 && getCoverBehaviorAtSideNew(side).onCoverShiftRightClick( - side, - getCoverIDAtSide(side), - getComplexCoverDataAtSide(side), - this, - aPlayer); } + } - if (getCoverBehaviorAtSideNew(side).onCoverRightClick( - side, - getCoverIDAtSide(side), - getComplexCoverDataAtSide(side), - this, - aPlayer, - aX, - aY, - aZ)) return true; - - if (!getCoverInfoAtSide(side).isGUIClickable()) return false; - - if (isUpgradable() && tCurrentItem != null) { - if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) { - if (addMufflerUpgrade()) { - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_CLICK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; - } - return true; + if (getCoverInfoAtSide(coverSide).onCoverRightClick(aPlayer, aX, aY, aZ)) return true; + + if (isUpgradable() && tCurrentItem != null) { + if (ItemList.Upgrade_Muffler.isStackEqual(aPlayer.inventory.getCurrentItem())) { + if (addMufflerUpgrade()) { + sendSoundToPlayers(SoundResource.RANDOM_CLICK); + if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; } - if (ItemList.Upgrade_Lock.isStackEqual(aPlayer.inventory.getCurrentItem())) { - if (isUpgradable() && !mLockUpgrade) { - mLockUpgrade = true; - setOwnerName(aPlayer.getDisplayName()); - setOwnerUuid(aPlayer.getUniqueID()); - GTUtility.sendSoundToPlayers( - worldObj, - SoundResource.RANDOM_CLICK, - 1.0F, - -1, - xCoord, - yCoord, - zCoord); - if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; - } - return true; + return true; + } + if (ItemList.Upgrade_Lock.isStackEqual(aPlayer.inventory.getCurrentItem())) { + if (isUpgradable() && !mLockUpgrade) { + mLockUpgrade = true; + setOwnerName(aPlayer.getDisplayName()); + setOwnerUuid(aPlayer.getUniqueID()); + sendSoundToPlayers(SoundResource.RANDOM_CLICK); + if (!aPlayer.capabilities.isCreativeMode) aPlayer.inventory.getCurrentItem().stackSize--; } + return true; } } } try { - if (!aPlayer.isSneaking() && hasValidMetaTileEntity()) + if (!aPlayer.isSneaking() && hasValidMetaTileEntity()) { return mMetaTileEntity.onRightclick(this, aPlayer, side, aX, aY, aZ); + } } catch (Throwable e) { GTLog.err.println( "Encountered Exception while rightclicking TileEntity, the Game should've crashed now, but I prevented that. Please report immediately to GregTech Intergalactical!!!"); diff --git a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java index 3b0c9cc89f9..8a4acad7222 100644 --- a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java @@ -19,6 +19,7 @@ import gregtech.GTMod; import gregtech.api.GregTechAPI; import gregtech.api.enums.ItemList; +import gregtech.api.enums.SoundResource; import gregtech.api.gui.modularui.GUITextureSet; import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -369,4 +370,8 @@ public void onSoundP2POutputUpdate(PartP2PSound p2p, TunnelCollection 0) GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("214", "Connected")); + if (connect(wrenchingSide) > 0) { + GTUtility.sendChatToPlayer(entityPlayer, GTUtility.trans("214", "Connected")); + } } return true; + } else { + return false; } - return false; } @Override diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index b677f6ae246..f33858101e6 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -18,11 +18,11 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.function.LongConsumer; import javax.annotation.Nonnull; import javax.annotation.Nullable; - import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -195,17 +195,74 @@ public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (onModeChangeByScrewdriver(side, aPlayer, aX, aY, aZ)) { + return true; + } else { + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); + } + } + + @Override + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (supportsVoidProtection() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + Set allowed = getAllowedVoidingModes(); + setVoidingMode(getVoidingMode().nextInCollection(allowed)); + GTUtility.sendChatToPlayer( + aPlayer, + StatCollector.translateToLocal("GT5U.gui.button.voiding_mode"), + " ", + StatCollector.translateToLocal(getVoidingMode().getTransKey())); + return true; + } else { + return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); + } + } + + @Override + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (supportsBatchMode() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + batchMode = !batchMode; + if (batchMode) { + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.batchMode.on"); + } else { + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.batchMode.off"); + } + return true; + } else { + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); + } + } + + @Override + public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (supportsInputSeparation() && side == getBaseMetaTileEntity().getFrontFacing()) { + this.inputSeparation = !this.inputSeparation; + if (inputSeparation) { + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.separateInputs.on"); + } else { + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.separateInputs.off"); + } + return true; + } else { + // don't do any allow i/o because controllers can't interact with pipes + return false; + } + } + + @Override + public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (supportsSingleRecipeLocking()) { mLockedToSingleRecipe = !mLockedToSingleRecipe; if (mLockedToSingleRecipe) { - GTUtility.sendChatToPlayer( - aPlayer, - GTUtility.trans("223", "Single recipe locking enabled. Will lock to next recipe.")); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.recipeLock.on"); } else { - GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("220", "Single recipe locking disabled.")); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.recipeLock.off"); mSingleRecipeCheck = null; } + return true; + } else { + return super.onJackHammerRightClick(side, aPlayer, aX, aY, aZ, tool); } } @@ -2303,8 +2360,20 @@ public void setMachineMode(int index) { @Override public int nextMachineMode() { - if (machineMode == 0) return 1; - else return 0; + return machineMode; + } + + /** + * If you need to do anything fancy to change the machine mode, do it here. + */ + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (nextMachineMode() != machineMode) { + setMachineMode(nextMachineMode()); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.MULTI_MACHINE_CHANGE", getMachineModeName()); + return true; + } else { + return false; + } } @Override diff --git a/src/main/java/gregtech/api/util/GTLanguageManager.java b/src/main/java/gregtech/api/util/GTLanguageManager.java index 1a4c3bf0826..480cd5989b7 100644 --- a/src/main/java/gregtech/api/util/GTLanguageManager.java +++ b/src/main/java/gregtech/api/util/GTLanguageManager.java @@ -282,10 +282,10 @@ public static void writePlaceholderStrings() { addStringLocalization("Interaction_DESCRIPTION_Index_083", "Open if work disabled"); addStringLocalization("Interaction_DESCRIPTION_Index_084", "Only Output allowed"); addStringLocalization("Interaction_DESCRIPTION_Index_085", "Only Input allowed"); - addStringLocalization("Interaction_DESCRIPTION_Index_086", "Auto-Input: "); + addStringLocalization("Interaction_DESCRIPTION_Index_086", "Allow Input: "); addStringLocalization("Interaction_DESCRIPTION_Index_087", "Disabled"); addStringLocalization("Interaction_DESCRIPTION_Index_088", "Enabled"); - addStringLocalization("Interaction_DESCRIPTION_Index_089", " Auto-Output: "); + addStringLocalization("Interaction_DESCRIPTION_Index_089", " Allow Output: "); addStringLocalization("Interaction_DESCRIPTION_Index_090", "Machine Processing: "); addStringLocalization("Interaction_DESCRIPTION_Index_091", "Redstone Output at Side "); addStringLocalization("Interaction_DESCRIPTION_Index_092", " set to: "); diff --git a/src/main/java/gregtech/api/util/GTUtility.java b/src/main/java/gregtech/api/util/GTUtility.java index 3294b0523d8..911e74052c0 100644 --- a/src/main/java/gregtech/api/util/GTUtility.java +++ b/src/main/java/gregtech/api/util/GTUtility.java @@ -58,6 +58,7 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -92,6 +93,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.WorldServer; @@ -161,6 +163,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.net.GTPacketSound; import gregtech.api.objects.CollectorUtils; +import gregtech.api.objects.GTHashSet; import gregtech.api.objects.GTItemStack; import gregtech.api.objects.GTItemStack2; import gregtech.api.objects.ItemData; @@ -494,12 +497,40 @@ public static String getTierNameWithParentheses(long voltage) { return " (" + GTValues.VN[tier] + ")"; } + public static String getEnabledText() { + return EnumChatFormatting.GREEN + GTUtility.trans("088", "Enabled") + EnumChatFormatting.RESET; + } + + public static String getDisabledText() { + return EnumChatFormatting.RED + GTUtility.trans("087", "Disabled") + EnumChatFormatting.RESET; + } + public static void sendChatToPlayer(EntityPlayer aPlayer, String aChatMessage) { if (aPlayer instanceof EntityPlayerMP && aChatMessage != null) { aPlayer.addChatComponentMessage(new ChatComponentText(aChatMessage)); } } + public static void sendLocalizedChatToPlayer(EntityPlayer aPlayer, String translationKey) { + sendChatToPlayer(aPlayer, StatCollector.translateToLocal(translationKey)); + } + + public static void sendLocalizedChatToPlayer(EntityPlayer aPlayer, String aChatMessage, Object... format) { + sendChatToPlayer(aPlayer, I18n.format(aChatMessage, format)); + } + + public static void sendChatToPlayer(EntityPlayer player, Object... chunks) { + StringBuilder builder = new StringBuilder(); + + for (Object obj : chunks) { + if (obj != null) { + builder.append(obj); + } + } + + GTUtility.sendChatToPlayer(player, builder.toString()); + } + public static void checkAvailabilities() { if (CHECK_ALL) { try { @@ -1776,6 +1807,60 @@ public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, aIgnoreNBT); } + public static enum ToolType { + + DyeEraser(null, null), // water bucket + Wrench(SoundResource.IC2_TOOLS_WRENCH, GregTechAPI.sWrenchList), + Screwdriver(SoundResource.IC2_TOOLS_WRENCH, GregTechAPI.sScrewdriverList), + HardHammer(SoundResource.RANDOM_ANVIL_USE, GregTechAPI.sHardHammerList), + SoftHammer(SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, GregTechAPI.sSoftHammerList), + SolderingIron(SoundResource.IC2_TOOLS_BATTERY_USE, GregTechAPI.sSolderingToolList), + WireCutter(SoundResource.IC2_TOOLS_WRENCH, GregTechAPI.sWireCutterList), + Crowbar(SoundResource.RANDOM_BREAK, GregTechAPI.sCrowbarList), + Jackhammer(SoundResource.IC2_TOOLS_DRILL_DRILL_SOFT, GregTechAPI.sJackhammerList); + + public final SoundResource useSound; + public final GTHashSet toolList; + + public static final ToolType[] TOOL_TYPES = values(); + + private ToolType(SoundResource useSound, GTHashSet toolList) { + this.useSound = useSound; + this.toolList = toolList; + } + + /** + * This only handles tool damage. It is assumed that the player's held item is the tool. + * Consuming solder for soldering irons must be done separately. + * + * @return True if the tool had power or didn't need it. + */ + public boolean onUse(EntityPlayer player) { + final ItemStack tool = player.inventory.getCurrentItem(); + + if (this == DyeEraser) { + tool.func_150996_a(Items.bucket); + return true; + } + + return GTModHandler.damageOrDechargeItem(tool, 1, 1000, player); + } + + public static @Nullable ToolType getToolType(ItemStack heldItem) { + if (areStacksEqual(new ItemStack(Items.water_bucket, 1), heldItem)) { + return DyeEraser; + } + + for (ToolType tool : TOOL_TYPES) { + if (tool.toolList != null && isStackInList(heldItem, tool.toolList)) { + return tool; + } + } + + return null; + } + } + public static String getFluidName(Fluid aFluid, boolean aLocalized) { if (aFluid == null) return E; String rName = aLocalized ? aFluid.getLocalizedName(new FluidStack(aFluid, 0)) : aFluid.getUnlocalizedName(); diff --git a/src/main/java/gregtech/common/GTClient.java b/src/main/java/gregtech/common/GTClient.java index 844731e82fe..478155a46f2 100644 --- a/src/main/java/gregtech/common/GTClient.java +++ b/src/main/java/gregtech/common/GTClient.java @@ -824,25 +824,34 @@ public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) { } } + // always draw the grid for wire cutters and hard hammers because they ignore covers completely if (GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sWireCutterList) - || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sSolderingToolList) + || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sHardHammerList)) { + drawGrid(aEvent, false, false, aEvent.player.isSneaking()); + return; + } + + if (GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sSolderingToolList) || (GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sSoftHammerList) && aTileEntity instanceof MultiBlockPart) && aEvent.player.isSneaking()) { - if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) == 0) + if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) == 0) { drawGrid(aEvent, false, false, aEvent.player.isSneaking()); + } return; } if ((aEvent.currentItem == null && aEvent.player.isSneaking()) || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sCrowbarList) + || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sJackhammerList) || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sScrewdriverList)) { - if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) == 0) + if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) == 0) { for (final ForgeDirection tSide : ForgeDirection.VALID_DIRECTIONS) { if (((ICoverable) aTileEntity).getCoverIDAtSide(tSide) > 0) { drawGrid(aEvent, true, false, true); return; } } + } return; } diff --git a/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java index 36f1e1be58e..30ef13d2793 100644 --- a/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java +++ b/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java @@ -168,12 +168,13 @@ protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { final int ordinalSide = side.ordinal(); // Adjust items per side by 1 or -1, constrained to the cyclic interval [0, 127] itemsPerSide[ordinalSide] += aPlayer.isSneaking() ? -1 : 1; itemsPerSide[ordinalSide] = (byte) ((itemsPerSide[ordinalSide] + 128) % 128); GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("211", "Items per side: ") + itemsPerSide[ordinalSide]); + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java b/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java index 4205af7e089..940613f473c 100644 --- a/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java +++ b/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java @@ -98,11 +98,6 @@ public void loadNBTData(NBTTagCompound aNBT) { this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9"); } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - // Regulation per Screwdriver is overridden by GUI regulation. - } - @Override public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { for (int i = 0, tCosts; i < 9; i++) { diff --git a/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java b/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java index 82e4c21653c..7c279660d86 100644 --- a/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java +++ b/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java @@ -162,10 +162,11 @@ public void onRemoval() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); printStructure(aPlayer); aBaseMetaTileEntity.disableWorking(); + return true; } public void printStructure(EntityPlayer aPlayer) { diff --git a/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java index 01d2e1ee074..63270b73eac 100644 --- a/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java @@ -140,9 +140,12 @@ public void onConfigLoad() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) mMagicalEnergyBB.decreaseTier(); - else mMagicalEnergyBB.increaseTier(); + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (aPlayer.isSneaking()) { + mMagicalEnergyBB.decreaseTier(); + } else { + mMagicalEnergyBB.increaseTier(); + } GTUtility.sendChatToPlayer( aPlayer, String.format( @@ -152,6 +155,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f mMagicalEnergyBB.getRange(), true)); mMagicalEnergyBB.update(); + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java index b6adf654407..3565d7125a7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java @@ -424,11 +424,10 @@ public void securityBreak() {} @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { additionalConnection = !additionalConnection; updateValidGridProxySides(); - aPlayer.addChatComponentMessage( - new ChatComponentTranslation("GT5U.hatch.additionalConnection." + additionalConnection)); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.hatch.additionalConnection." + additionalConnection); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java index 63e1a264c33..04c8f4bdbcc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java @@ -171,11 +171,10 @@ public void onFacingChange() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { additionalConnection = !additionalConnection; updateValidGridProxySides(); - aPlayer.addChatComponentMessage( - new ChatComponentTranslation("GT5U.hatch.additionalConnection." + additionalConnection)); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.hatch.additionalConnection." + additionalConnection); return true; } @@ -294,15 +293,14 @@ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (!autoPullAvailable) { - return; + return false; } setAutoPullItemList(!autoPullItemList); - aPlayer.addChatMessage( - new ChatComponentTranslation( - "GT5U.machines.stocking_bus.auto_pull_toggle." + (autoPullItemList ? "enabled" : "disabled"))); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.stocking_bus.auto_pull_toggle." + (autoPullItemList ? "enabled" : "disabled")); + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java index 5fc0156c851..5bfdcbd841c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java @@ -325,7 +325,7 @@ public void onFacingChange() { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { additionalConnection = !additionalConnection; updateValidGridProxySides(); aPlayer.addChatComponentMessage( @@ -555,15 +555,15 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!autoPullAvailable) { - return; - } + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (autoPullAvailable) { + setAutoPullFluidList(!autoPullFluidList); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.stocking_hatch.auto_pull_toggle." + (autoPullFluidList ? "enabled" : "disabled")); - setAutoPullFluidList(!autoPullFluidList); - aPlayer.addChatMessage( - new ChatComponentTranslation( - "GT5U.machines.stocking_hatch.auto_pull_toggle." + (autoPullFluidList ? "enabled" : "disabled"))); + return true; + } else { + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java index 969d9c6c059..661e7a074ee 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java @@ -179,19 +179,12 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye return true; } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!getBaseMetaTileEntity().getCoverInfoAtSide(side) - .isGUIClickable()) return; - } - @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { additionalConnection = !additionalConnection; updateValidGridProxySides(); - aPlayer.addChatComponentMessage( - new ChatComponentTranslation("GT5U.hatch.additionalConnection." + additionalConnection)); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.hatch.additionalConnection." + additionalConnection); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java index 5983a2d32a9..9002ddd0d6b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java @@ -213,19 +213,17 @@ public boolean doesFillContainers() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { // Don't allow to lock fluid in me fluid hatch - if (!getBaseMetaTileEntity().getCoverInfoAtSide(side) - .isGUIClickable()) return; + return false; } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { additionalConnection = !additionalConnection; updateValidGridProxySides(); - aPlayer.addChatComponentMessage( - new ChatComponentTranslation("GT5U.hatch.additionalConnection." + additionalConnection)); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.hatch.additionalConnection." + additionalConnection); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java index 7707564b939..9194286aaa2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java @@ -151,8 +151,7 @@ public boolean hasFreeSpace() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side != getBaseMetaTileEntity().getFrontFacing() && side != mMainFacing) { if (aPlayer.isSneaking()) { if (radiusConfig >= 0) { @@ -170,16 +169,14 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f } } - GTUtility.sendChatToPlayer( - aPlayer, - String.format( - "%s %dx%d", - StatCollector.translateToLocal("GT5U.machines.workareaset"), - (radiusConfig * 2 + 1), - (radiusConfig * 2 + 1))); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.blocks", radiusConfig * 2 + 1); // Rebuild ore cache after change config fillOreList(getBaseMetaTileEntity()); + + return true; + } else { + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java index a6a99a58fa2..623e6f1dcfa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java @@ -258,40 +258,34 @@ public void setItemNBT(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (side != getBaseMetaTileEntity().getFrontFacing() && side != mMainFacing) { + int max = getMaxPumpableDistance(); + if (aPlayer.isSneaking()) { + if (radiusConfig >= 0) { + radiusConfig--; + } + if (radiusConfig < 0) radiusConfig = max; + } else { + if (radiusConfig <= max) { + radiusConfig++; + } + if (radiusConfig > max) radiusConfig = 0; + } - if (side == getBaseMetaTileEntity().getFrontFacing() || side == mMainFacing) { - // Configuring "input from output side allowed". - return; - } + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.blocks", radiusConfig * 2 + 1); - int max = getMaxPumpableDistance(); - if (aPlayer.isSneaking()) { - if (radiusConfig >= 0) { - radiusConfig--; - } - if (radiusConfig < 0) radiusConfig = max; + clearQueue(false); + + return true; } else { - if (radiusConfig <= max) { - radiusConfig++; - } - if (radiusConfig > max) radiusConfig = 0; + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); } - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.workareaset") + " " - + (radiusConfig * 2 + 1) - + "x" - + (radiusConfig * 2 + 1)); // TODO Add translation support - - clearQueue(false); } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, - EntityPlayer entityPlayer, float aX, float aY, float aZ) { - if (super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ)) return true; + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ, tool)) return true; mDisallowRetract = !mDisallowRetract; GTUtility.sendChatToPlayer( entityPlayer, diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java index bb086dc6547..cc7801ece85 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java @@ -276,8 +276,7 @@ public long maxAmperesIn() { // This uses the Wrench as second tool to cycle speeds @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer pPlayer, float aX, - float aY, float aZ) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer pPlayer, float aX, float aY, float aZ, ItemStack tool) { incSpeedTierOverride(); markDirty(); @@ -289,7 +288,7 @@ public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingS } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer pPlayer, float pX, float pY, float pZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer pPlayer, float pX, float pY, float pZ, ItemStack tool) { if (pPlayer.isSneaking()) { if (mMode == 0) { incRadiusTierOverride(); @@ -304,6 +303,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer pPlayer, f markDirty(); PlayerChatHelper.SendInfo(pPlayer, String.format("Switched mode to: %s", mModeStr[mMode])); } + return true; } @Override 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 81069c8841a..84d7af22018 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java @@ -256,8 +256,7 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, - EntityPlayer entityPlayer, float aX, float aY, float aZ) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { mChunkLoadingEnabled = !mChunkLoadingEnabled; GTUtility.sendChatToPlayer( @@ -266,7 +265,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 true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java index be11e400fec..98caad5ecb1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java @@ -368,14 +368,6 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 3, 0, elementBudget, env, false, true); } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - @Override public void loadNBTData(final NBTTagCompound aNBT) { super.loadNBTData(aNBT); 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 20b3ce4b321..354e7596152 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java @@ -334,14 +334,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public void setMachineModeIcons() { machineModeIcons.add(GTUITextures.OVERLAY_BUTTON_MACHINEMODE_SEPARATOR); @@ -353,6 +345,11 @@ public String getMachineModeName() { return StatCollector.translateToLocal("GT5U.INDUSTRIAL_ELECTROMAGNETIC_SEPARATOR.mode." + machineMode); } + @Override + public int nextMachineMode() { + return machineMode == 0 ? 1 : 0; + } + @Override public void clearHatches() { super.clearHatches(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java index 1516695a888..965a7b599de 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java @@ -196,31 +196,23 @@ public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirect private boolean stopAllRendering = false; @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { stopAllRendering = !stopAllRendering; if (stopAllRendering) { PlayerUtils.messagePlayer(aPlayer, "Rendering off"); if (renderer != null) renderer.setShouldRender(false); - } else PlayerUtils.messagePlayer(aPlayer, "Rendering on"); + } else { + PlayerUtils.messagePlayer(aPlayer, "Rendering on"); + } + return true; } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack aTool) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + if (renderer != null) { + renderer.realism = !renderer.realism; + PlayerUtils.messagePlayer(aPlayer, "Toggling realism!"); return true; - } else { - if (renderer != null) { - renderer.realism = !renderer.realism; - PlayerUtils.messagePlayer(aPlayer, "Toggling realism!"); - return true; - } } return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java index 187bf4ed694..6ca7495a8da 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java @@ -426,17 +426,16 @@ private boolean checkTypes(int aID, HashSet... aTables) { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { sVoidStone = !sVoidStone; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", sVoidStone)); - return; + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.oreprocessor.void", sVoidStone); + return true; } sMode = (sMode + 1) % 5; List des = getDisplayMode(sMode); GTUtility.sendChatToPlayer(aPlayer, String.join("", des)); + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java index d23731d7e14..c781a28ef7c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java @@ -451,13 +451,16 @@ public boolean hasTurbine() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GTUtility.sendChatToPlayer( aPlayer, looseFit ? GTUtility.trans("500", "Fitting: Loose - More Flow") : GTUtility.trans("501", "Fitting: Tight - More Efficiency")); + return true; + } else { + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java index 3af4b17e296..28bb795badd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java @@ -229,14 +229,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public void setMachineModeIcons() { machineModeIcons.add(GTUITextures.OVERLAY_BUTTON_MACHINEMODE_PACKAGER); @@ -248,6 +240,11 @@ public String getMachineModeName() { return StatCollector.translateToLocal("GT5U.MULTI_CANNER.mode." + machineMode); } + @Override + public int nextMachineMode() { + return machineMode == 0 ? 1 : 0; + } + @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java index b6dc31e943b..77d342b9631 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java @@ -441,14 +441,6 @@ protected MultiblockTooltipBuilder createTooltip() { return tt; } - @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - @Override public boolean supportsVoidProtection() { return true; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java index 35be525c51f..343bdde75a9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java @@ -145,8 +145,7 @@ protected MultiblockTooltipBuilder createTooltip(String tierSuffix) { protected abstract int getRangeInChunks(); @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { int oldChunkRange = chunkRangeConfig; if (aPlayer.isSneaking()) { if (chunkRangeConfig > 0) { @@ -160,13 +159,8 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f if (chunkRangeConfig > getRangeInChunks()) chunkRangeConfig = 1; } if (oldChunkRange != chunkRangeConfig) mOilFieldChunks.clear(); - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.workareaset") + " " - + chunkRangeConfig - + "x" - + chunkRangeConfig - + StatCollector.translateToLocal("GT5U.machines.chunks")); // TODO Add translation support + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.chunks", chunkRangeConfig); + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java index 6acc48c7723..59b4ce6da0d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java @@ -141,25 +141,24 @@ private void adjustChunkRadius(boolean increase) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isActive()) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workarea_fail")); } else { adjustChunkRadius(!aPlayer.isSneaking()); - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.workareaset") + " " - + GTUtility.formatNumbers((long) chunkRadiusConfig << 4) - + " " - + StatCollector.translateToLocal("GT5U.machines.radius")); + if (mChunkLoadingEnabled) { + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.chunks", chunkRadiusConfig); + } else { + GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.blocks", chunkRadiusConfig << 4); + } } + + return true; } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { replaceWithCobblestone = !replaceWithCobblestone; GTUtility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone); return true; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPCBFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPCBFactory.java index 5618232442a..a3a2a69c548 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPCBFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPCBFactory.java @@ -749,14 +749,6 @@ protected long getActualEnergyUsage() { return (-this.lEUt * 10000) / Math.min(Math.max(1000, mEfficiency), 10000); } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - @Override public String[] getInfoData() { int mPollutionReduction = 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java index a4ff3275ea9..9724c15a675 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java @@ -345,34 +345,16 @@ public void loadNBTData(final NBTTagCompound aNBT) { downtierUEV = aNBT.getBoolean("downtierUEV"); } - @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - // Lock to single recipe - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } else { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - } - @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, "Batch recipes"); - } else { - GTUtility.sendChatToPlayer(aPlayer, "Don't batch recipes"); - } - } else { + float aX, float aY, float aZ, ItemStack tool) { + if (!aPlayer.isSneaking()) { downtierUEV = !downtierUEV; GTUtility.sendChatToPlayer(aPlayer, "Treat UEV+ machines as multiple UHV " + downtierUEV); + return true; + } else { + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } - return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java index edfa676b538..b35d545ba32 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java @@ -205,7 +205,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { shouldRender = !shouldRender; if (!shouldRender) { PlayerUtils.messagePlayer(aPlayer, "Rendering off"); @@ -215,7 +215,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f if (blackHoleStatus != 1) createRenderBlock(); PlayerUtils.messagePlayer(aPlayer, "Rendering on"); } - + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java index cf52680d715..f7cc9a69088 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java @@ -242,8 +242,7 @@ public int getMaxEfficiency(ItemStack aStack) { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { useRender = !useRender; aPlayer.addChatComponentMessage( new ChatComponentTranslation( @@ -253,6 +252,7 @@ public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPla } else { destroyRenderBlock(); } + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java index 96ec6c06ae1..584daaf9694 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java @@ -269,26 +269,23 @@ public StorageChannel getChannel() { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { mVoidOverflow = !mVoidOverflow; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal( - mVoidOverflow ? "GT5U.machines.digitalchest.voidoverflow.enabled" - : "GT5U.machines.digitalchest.voidoverflow.disabled")); + GTUtility.sendLocalizedChatToPlayer(aPlayer, mVoidOverflow ? "GT5U.machines.digitalchest.voidoverflow.enabled" : "GT5U.machines.digitalchest.voidoverflow.disabled"); + return true; } @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ)) return true; - mDisableFilter = !mDisableFilter; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal( - mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled" - : "GT5U.machines.digitalchest.inputfilter.enabled")); - return true; + float aX, float aY, float aZ, ItemStack tool) { + if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + mDisableFilter = !mDisableFilter; + GTUtility.sendLocalizedChatToPlayer(aPlayer, mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled" : "GT5U.machines.digitalchest.inputfilter.enabled"); + + return true; + } else { + return false; + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java index d4b8da15da7..4ec71e36c2b 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java @@ -312,13 +312,12 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { - mAllowInputFromOutputSide = !mAllowInputFromOutputSide; - GTUtility.sendChatToPlayer( - aPlayer, - mAllowInputFromOutputSide ? GTUtility.getTrans("095") : GTUtility.getTrans("096")); - } + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + mAllowInputFromOutputSide = !mAllowInputFromOutputSide; + GTUtility.sendChatToPlayer( + aPlayer, + mAllowInputFromOutputSide ? GTUtility.getTrans("095") : GTUtility.getTrans("096")); + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/storage/MTELocker.java b/src/main/java/gregtech/common/tileentities/storage/MTELocker.java index 6398f56bec6..271b2b239fa 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTELocker.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTELocker.java @@ -177,10 +177,11 @@ public void doSound(byte aIndex, double aX, double aY, double aZ) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { this.mType = ((byte) (this.mType + 1)); } + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java index 0043819b237..5e07259bfd2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java @@ -118,9 +118,6 @@ public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {} - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java index 09c3dd6efb8..03fe021d8ec 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java @@ -316,7 +316,7 @@ public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (!aPlayer.isSneaking()) { PlayerUtils.messagePlayer(aPlayer, "Using Animations? " + usingAnimations()); PlayerUtils.messagePlayer(aPlayer, "Has Controller? " + this.mHasController); @@ -346,59 +346,34 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture."); } } + return true; } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, - float aY, float aZ) { - if (this.getBaseMetaTileEntity() - .isServerSide() && !aPlayer.isSneaking()) { - ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (tCurrentItem.getItem() instanceof MetaGeneratedTool) { - return onToolClick(tCurrentItem, aPlayer, wrenchingSide); - } - } - } - return super.onWrenchRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ); - } - - @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (this.getBaseMetaTileEntity() - .isServerSide()) { - ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (tCurrentItem.getItem() instanceof MetaGeneratedTool) { - return onToolClick(tCurrentItem, aPlayer, wrenchingSide); - } - } - } - return false; - } - - public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, ForgeDirection side) { - if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList)) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem != null && tCurrentItem.getItem() instanceof MetaGeneratedTool) { boolean aHasTurbine = this.hasTurbine(); if (aPlayer.inventory.getFirstEmptyStack() >= 0 && aHasTurbine) { - if (PlayerUtils.isCreative(aPlayer) - || GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - aPlayer.inventory.addItemStackToInventory((this.getTurbine())); - this.mInventory[0] = null; - GTUtility.sendChatToPlayer(aPlayer, "Removed turbine with wrench."); - return true; - } + aPlayer.inventory.addItemStackToInventory(this.getTurbine()); + this.mInventory[0] = null; + GTUtility.sendChatToPlayer(aPlayer, "Removed turbine with wrench."); } else { GTUtility.sendChatToPlayer( aPlayer, aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove."); } - } else if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) { - if (mControllerLocation != null && mControllerLocation.length() > 0) { - if (setController(BlockPos.generateBlockPos(mControllerLocation))) { - if (PlayerUtils.isCreative(aPlayer) - || GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + } + return true; + } + + @Override + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (this.getBaseMetaTileEntity().isServerSide()) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem != null && tCurrentItem.getItem() instanceof MetaGeneratedTool) { + if (mControllerLocation != null && mControllerLocation.length() > 0) { + if (setController(BlockPos.generateBlockPos(mControllerLocation))) { String tChat = "Trying to Reset linked Controller"; IGregTechTileEntity g = this.getBaseMetaTileEntity(); GTUtility.sendChatToPlayer(aPlayer, tChat); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java index 6a501a25316..a4905a76fb4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java @@ -156,7 +156,7 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer != null) { if (KeyboardUtils.isCtrlKeyDown()) { mDescending = !mDescending; @@ -182,6 +182,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f PlayerUtils.messagePlayer(aPlayer, "Set check time to be every " + mRefreshTime + " ticks."); } } + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java index 5de87c4a500..d452ab63f68 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java @@ -140,13 +140,16 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { disableSort = !disableSort; GTUtility.sendChatToPlayer( aPlayer, - GTUtility.trans("200.1", "Automatic Item Shuffling: ") - + (disableSort ? GTUtility.trans("087", "Disabled") : GTUtility.trans("088", "Enabled"))); + GTUtility.trans("200.1", "Automatic Item Shuffling: "), + disableSort ? GTUtility.trans("087", "Disabled") : GTUtility.trans("088", "Enabled")); + return true; + } else { + return false; } } 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 b9692279777..c72ce43506c 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 @@ -817,16 +817,13 @@ public boolean resetRecipeMapForHatch(MTEHatch aTileEntity, RecipeMap aMap) { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { clearRecipeMapForAllInputHatches(); - onModeChangeByScrewdriver(side, aPlayer, aX, aY, aZ); mLastRecipe = null; resetRecipeMapForAllInputHatches(); + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); } - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {} - /** * Enable Texture Casing Support if found in GT 5.09 */ @@ -1021,35 +1018,6 @@ public boolean onPlungerRightClick(EntityPlayer aPlayer, ForgeDirection side, fl return aHatchIndex > 0; } - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn")); - } else { - GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff")); - } - return true; - } - return false; - } - - @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { - if (supportsVoidProtection() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { - Set allowed = getAllowedVoidingModes(); - setVoidingMode(getVoidingMode().nextInCollection(allowed)); - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.gui.button.voiding_mode") + " " - + StatCollector.translateToLocal(getVoidingMode().getTransKey())); - return true; - } else return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ); - } - // Only support to use meta to tier /** diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java index d2a6468f28a..2b609114f56 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java @@ -1,6 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; @@ -107,12 +108,13 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { this.mHalfMode = !mHalfMode; if (this.mHalfMode) { PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 2A:8A in/out Ratio."); } else { PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 4A:16A in/out Ratio."); } + return true; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java index 08db4e19be5..4725c1135d8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java @@ -253,10 +253,8 @@ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final } @Override - public void onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, - final float aY, final float aZ) { - if (aPlayer.getUniqueID() - .compareTo(this.mOwner) == 0) { + public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ, ItemStack tool) { + if (aPlayer.getUniqueID().equals(this.mOwner)) { if (side == this.getBaseMetaTileEntity() .getFrontFacing()) { final float[] tCoords = GTUtility.getClickedFacingCoords(side, aX, aY, aZ); @@ -293,13 +291,18 @@ public void onScrewdriverRightClick(final ForgeDirection side, final EntityPlaye if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) { GTUtility.sendChatToPlayer( aPlayer, - "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); + "Frequency: ", + this.mFrequency, + EnumChatFormatting.RED, + " (Occupied)"); } else { GTUtility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency); } } + return true; } else { GTUtility.sendChatToPlayer(aPlayer, "This is not your Tesseract Generator to configure."); + return false; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java index c34a2ca41bb..f59976f2141 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java @@ -209,12 +209,9 @@ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final } @Override - public void onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, - final float aY, final float aZ) { - if (aPlayer.getUniqueID() - .compareTo(this.mOwner) == 0) { - if (side == this.getBaseMetaTileEntity() - .getFrontFacing()) { + public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ, ItemStack tool) { + if (aPlayer.getUniqueID().equals(this.mOwner)) { + if (side == this.getBaseMetaTileEntity().getFrontFacing()) { final float[] tCoords = GTUtility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> { @@ -248,16 +245,17 @@ public void onScrewdriverRightClick(final ForgeDirection side, final EntityPlaye } GTUtility.sendChatToPlayer( aPlayer, - "Frequency: " + this.mFrequency - + (this.getTesseract(this.mFrequency, false) == null ? "" - : new StringBuilder().append(EnumChatFormatting.GREEN) - .append(" (Connected)") - .toString())); - } - } else if (aPlayer.getUniqueID() - .compareTo(this.mOwner) != 0) { - GTUtility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure."); + "Frequency: ", + this.mFrequency, + this.getTesseract(this.mFrequency, false) == null + ? "" + : EnumChatFormatting.GREEN + " (Connected)"); } + return true; + } else { + GTUtility.sendChatToPlayer(aPlayer, "This is not your Tesseract Terminal to configure."); + return false; + } } public boolean allowCoverOnSide(final ForgeDirection side, final int aCoverID) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java index 6988d2f43bf..01895999fce 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java @@ -749,11 +749,6 @@ public boolean canInsertItem(int aIndex, ItemStack aStack, int ordinalSide) { return false; } - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } - @Override public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == -120) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java index 2521fb703f5..de638d6c184 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java @@ -120,14 +120,14 @@ public ITexture[] getSidesActive(final byte aColor) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (pollutionMultiplier > 99) { pollutionMultiplier = 1; } else { pollutionMultiplier++; } - PlayerUtils.messagePlayer(aPlayer, "Pollution Mutliplier is now " + pollutionMultiplier + "."); - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + PlayerUtils.messagePlayer(aPlayer, "Pollution Multiplier is now " + pollutionMultiplier + "."); + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java index 747663f4cb2..f62010e5f6a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java @@ -455,10 +455,8 @@ public int getAveragePollutionOverLastTen() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - - if (side == this.getBaseMetaTileEntity() - .getFrontFacing()) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (side == this.getBaseMetaTileEntity().getFrontFacing()) { final float[] tCoords = GTUtility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> this.mRedstoneLevel -= 5000; @@ -468,9 +466,10 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f } this.markDirty(); GTUtility.sendChatToPlayer(aPlayer, "Emit Redstone at Pollution Level: " + this.mRedstoneLevel); + return true; + } else { + return false; } - - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java index 15351401153..abf3dc01942 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java @@ -150,12 +150,12 @@ public ITexture[] getSidesActive(final byte aColor) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { mLocked = !mLocked; PlayerUtils.messagePlayer(aPlayer, mLocked ? "Locked to owner." : "Unlocked."); - return; + return true; } mWirelessChargingMap.clear(); @@ -183,7 +183,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f } else { PlayerUtils.messagePlayer(aPlayer, "Now in Mixed Charge Mode."); } - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java index 387475d4f2c..d295508bf1f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java @@ -212,6 +212,11 @@ public String getMachineModeName() { return StatCollector.translateToLocal("GT5U.GTPP_MULTI_PACKAGER.mode." + machineMode); } + @Override + public int nextMachineMode() { + return machineMode == 0 ? 1 : 0; + } + @Override public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) { @@ -229,14 +234,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public void setMachineModeIcons() { machineModeIcons.clear(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java index 9c2c9153ea1..acd2d12c0bc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java @@ -285,7 +285,7 @@ public byte getCasingTextureIndex() { } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.mSize > 5) { this.mPlasmaMode = !mPlasmaMode; if (mPlasmaMode) { @@ -321,6 +321,7 @@ public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, + EnumChatFormatting.RESET); } mLastRecipe = null; + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java index b840cd9a088..459668a4f44 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java @@ -196,7 +196,7 @@ public boolean explodesOnComponentBreak(final ItemStack aStack) { } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { this.mIsAnimated = !mIsAnimated; Logger.INFO("Is Centrifuge animated " + this.mIsAnimated); if (this.mIsAnimated) { @@ -204,6 +204,7 @@ public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, } else { PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture. "); } + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java index 8f1a748f21e..d7f2d1a8fca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java @@ -224,14 +224,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public void setMachineModeIcons() { machineModeIcons.clear(); @@ -244,6 +236,11 @@ public String getMachineModeName() { return StatCollector.translateToLocal("GT5U.GTPP_MULTI_CUTTING_MACHINE.mode." + machineMode); } + @Override + public int nextMachineMode() { + return machineMode == 0 ? 1 : 0; + } + @Override public void loadNBTData(NBTTagCompound aNBT) { // Migrates old NBT tag to the new one diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java index eb7e6baa9c3..fb5a9f150ac 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java @@ -226,11 +226,12 @@ protected OverclockCalculator createOverclockCalculator(@NotNull GTRecipe recipe } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { mDehydratorMode = !mDehydratorMode; String aMode = mDehydratorMode ? "Dehydrator" : "Vacuum Furnace"; PlayerUtils.messagePlayer(aPlayer, "Mode: " + aMode); mLastRecipe = null; + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java index 3526146ab60..eaef1910b89 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java @@ -191,14 +191,6 @@ public int getPollutionPerSecond(final ItemStack aStack) { return Configuration.pollution.pollutionPerSecondMultiIndustrialMixer; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java index f4df2c3c1c7..2647cf7c018 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java @@ -528,14 +528,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public int nextMachineMode() { mLastRecipe = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java index 75d3e6df6fa..f0c4da7fe86 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java @@ -216,14 +216,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public void setMachineModeIcons() { machineModeIcons.clear(); @@ -235,6 +227,11 @@ public void setMachineModeIcons() { public String getMachineModeName() { return StatCollector.translateToLocal("GT5U.GTPP_MULTI_INDUSTRIAL_PLATE_PRESS.mode." + machineMode); } + + @Override + public int nextMachineMode() { + return machineMode == 0 ? 1 : 0; + } @Override public boolean isInputSeparationEnabled() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java index be3c6404020..d4687671185 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java @@ -405,14 +405,6 @@ public boolean supportsMachineModeSwitch() { return true; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - setMachineMode(nextMachineMode()); - PlayerUtils.messagePlayer( - aPlayer, - String.format(StatCollector.translateToLocal("GT5U.MULTI_MACHINE_CHANGE"), getMachineModeName())); - } - @Override public int nextMachineMode() { if (machineMode == MACHINEMODE_OREWASH) return MACHINEMODE_SIMPLEWASH; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java index 8ceb3e81623..6c9e5ac857c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java @@ -158,14 +158,6 @@ protected ProcessingLogic createProcessingLogic() { .setMaxParallelSupplier(this::getMaxParallelRecipes); } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - aPlayer.addChatMessage( - new ChatComponentTranslation( - inputSeparation ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled")); - } - @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java index c74eb89a070..54d88070097 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java @@ -324,14 +324,16 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (mHeight < 11) { PlayerUtils.messagePlayer(aPlayer, "Cannot switch mode if not in full height."); - return; + // return true so it doesn't open the ui + return true; } mMode = mMode.next(); PlayerUtils.messagePlayer(aPlayer, "Now running in " + mMode + " Mode."); mLastRecipe = null; + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java index 737cea642ab..2dec362f81f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java @@ -297,14 +297,6 @@ public int getMaxParallelRecipes() { return 8; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - aPlayer.addChatMessage( - new ChatComponentTranslation( - inputSeparation ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled")); - } - @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java index 970f975a70c..64679a64632 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java @@ -193,14 +193,6 @@ protected ProcessingLogic createProcessingLogic() { return new ProcessingLogic(); } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - @Override public int getMaxParallelRecipes() { return 1; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java index 913a54eea53..06654511438 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java @@ -313,7 +313,7 @@ public int getMaxParallelRecipes() { } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { int aMode = this.mMode + 1; if (aMode > 1) { this.mMode = MODE_UU; @@ -326,6 +326,7 @@ public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, PlayerUtils.messagePlayer(aPlayer, "Mode [" + this.mMode + "]: Recycler"); } mLastRecipe = null; + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java index ceeba543e89..81ac94f15b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java @@ -713,11 +713,12 @@ private int[] getOutputChances(GTRecipe tRecipe, int aChanceIncreased) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { mFluidMode = !mFluidMode; GTUtility.sendChatToPlayer( aPlayer, StatCollector.translateToLocal("miscutils.machines.QFTFluidMode") + " " + mFluidMode); + return true; } public boolean addNeptuniumHatch(IGregTechTileEntity aTileEntity, short aBaseCasingIndex) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java index 085cb1b7847..b916d107726 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java @@ -631,9 +631,6 @@ public byte getCasingTextureIndex() { return (byte) mCasingTextureID; } - @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {} - @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); 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 8e97ae11f3f..f4d62dc99d5 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 @@ -424,34 +424,6 @@ public void setCoilLevel(HeatingCoilLevel coilLevel) { this.coilLevel = coilLevel; } - @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (aPlayer.isSneaking()) { - // Lock to single recipe - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } else { - inputSeparation = !inputSeparation; - GTUtility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); - } - } - - @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ, ItemStack aTool) { - if (aPlayer.isSneaking()) { - batchMode = !batchMode; - if (batchMode) { - GTUtility.sendChatToPlayer(aPlayer, "Batch recipes."); - } else { - GTUtility.sendChatToPlayer(aPlayer, "Don't batch recipes."); - } - } - - return true; - } - @Override public int getPollutionPerSecond(ItemStack aStack) { return 102400; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java index 6e471c28291..bf0aa16052e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java @@ -698,13 +698,12 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { - looseFit ^= true; - GTUtility.sendChatToPlayer( - aPlayer, - looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); - } + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + looseFit ^= true; + GTUtility.sendChatToPlayer( + aPlayer, + looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); + return true; } public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index f392bff1716..d17c6fa0a80 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -804,13 +804,14 @@ public final long getAverageEuConsumed() { } @Override - public void onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { mIsOutputtingPower = !mIsOutputtingPower; if (mIsOutputtingPower) { PlayerUtils.messagePlayer(aPlayer, "Sub-Station is now outputting power from the controller."); } else { PlayerUtils.messagePlayer(aPlayer, "Sub-Station is now inputting power into the controller."); } + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java index a83d05f9287..4d1d790893a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java @@ -1,6 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; @@ -134,8 +135,9 @@ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 3); + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java index c2591c6a410..068fda72e73 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java @@ -1,6 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; @@ -68,8 +69,9 @@ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 6); + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java index e59500dcc0b..a0e06b68cc6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java @@ -1,6 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.Textures; @@ -35,8 +36,9 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 2); + return true; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java index ed4ff6b4cab..d9b4d79097f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java @@ -423,12 +423,13 @@ public void setItemNBT(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { byte aTest = (byte) (aCurrentOutputAmperage + 1); if (aTest > 16 || aTest <= 0) { aTest = 1; } aCurrentOutputAmperage = aTest; PlayerUtils.messagePlayer(aPlayer, "Now handling " + aCurrentOutputAmperage + " Amps."); + return true; } } diff --git a/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java b/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java index e6260bc7af2..b2b1b47371b 100644 --- a/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java +++ b/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java @@ -1102,10 +1102,11 @@ protected boolean canUseWireless() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (canUseWireless()) { wireless_mode = !wireless_mode; GTUtility.sendChatToPlayer(aPlayer, "Wireless network mode " + (wireless_mode ? "enabled." : "disabled.")); + return true; } else { GTUtility.sendChatToPlayer( aPlayer, @@ -1114,6 +1115,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f + EnumChatFormatting.RESET + "+ capacitor."); wireless_mode = false; + return false; } } diff --git a/src/main/java/kekztech/common/tileentities/MTETankTFFT.java b/src/main/java/kekztech/common/tileentities/MTETankTFFT.java index 49b195dea8c..7e60b325aa5 100644 --- a/src/main/java/kekztech/common/tileentities/MTETankTFFT.java +++ b/src/main/java/kekztech/common/tileentities/MTETankTFFT.java @@ -609,10 +609,10 @@ public boolean explodesOnComponentBreak(ItemStack stack) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { this.setDoVoidExcess(!doVoidExcess); GTUtility.sendChatToPlayer(aPlayer, "Auto-voiding " + (this.doVoidExcess ? "enabled" : "disabled")); + return true; } private boolean addMultiHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index 7d01c51ebab..6509dcfb1d1 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -392,19 +392,19 @@ public void HandleCustomPacket(CustomTileEntityPacket message) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "Can't change mode when running !"); - return; + return false; } if (aPlayer.isSneaking()) { - if (!InfernalMobs.isModLoaded()) return; + if (!InfernalMobs.isModLoaded()) return false; mIsProducingInfernalDrops = !mIsProducingInfernalDrops; if (!mIsProducingInfernalDrops) GTUtility.sendChatToPlayer(aPlayer, "Mobs will now be prevented from spawning infernal"); else GTUtility.sendChatToPlayer(aPlayer, "Mobs can spawn infernal now"); } else { - if (!BloodMagic.isModLoaded()) return; + if (!BloodMagic.isModLoaded()) return false; isInRitualMode = !isInRitualMode; if (!isInRitualMode) { GTUtility.sendChatToPlayer(aPlayer, "Ritual mode disabled"); @@ -414,16 +414,18 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f else GTUtility.sendChatToPlayer(aPlayer, "Can't connect to the ritual"); } } + return true; } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { 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, tool); + } } @SuppressWarnings("unused") diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java index d0831a17ee3..d9c466ae3fc 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java @@ -425,13 +425,14 @@ public void onRemoval() { * Shift+Right Click = change EIG Mode */ @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { if (aPlayer.isSneaking()) { tryChangeMode(aPlayer); } else { tryChangeSetupPhase(aPlayer); } + return true; } /** diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java index 33ca31d39b5..0030bf3e1ec 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java @@ -374,10 +374,10 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "Can't change mode when running !"); - return; + return false; } if (!aPlayer.isSneaking()) { mPrimaryMode++; @@ -396,7 +396,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f } else { if (!mStorage.isEmpty()) { GTUtility.sendChatToPlayer(aPlayer, "Can't change operating mode when the multi is not empty !"); - return; + return false; } mSecondaryMode++; if (mSecondaryMode == 2) mSecondaryMode = 0; @@ -409,6 +409,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f break; } } + return true; } private void updateMaxSlots() { diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDynamoTunnel.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDynamoTunnel.java index 703a269bf0d..a6a23b9c886 100644 --- a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDynamoTunnel.java +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDynamoTunnel.java @@ -253,10 +253,10 @@ private void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { GTUIInfos.openGTTileEntityUI(this.getBaseMetaTileEntity(), aPlayer); - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, aTool); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java index bfbca8077b6..8374e4e061c 100644 --- a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java @@ -155,10 +155,9 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, - ItemStack aTool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { GTUIInfos.openGTTileEntityUI(this.getBaseMetaTileEntity(), aPlayer); - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, aTool); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java index d3e52b97161..6e47f81df8e 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java @@ -248,7 +248,7 @@ public final boolean addDataBankHatchToMachineList(IGregTechTileEntity aTileEnti } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { wirelessModeEnabled = !wirelessModeEnabled; if (wirelessModeEnabled) { @@ -259,6 +259,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f WirelessComputationPacket.disableWirelessNetWork(getBaseMetaTileEntity()); } } + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index ef9d64a2167..bb2f2c943fd 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -934,10 +934,11 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac private boolean animationsEnabled = true; @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { animationsEnabled = !animationsEnabled; aPlayer.addChatMessage( new ChatComponentText("Animations are now " + (animationsEnabled ? "enabled" : "disabled") + ".")); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java index 714e06f1782..ffff95c07f8 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java @@ -702,8 +702,8 @@ private void buildThirdRing() { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!ConfigHandler.debug.DEBUG_MODE) return; + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + if (!ConfigHandler.debug.DEBUG_MODE) return false; if (isRenderActive) { destroyRenderer(); isRenderActive = false; @@ -712,6 +712,7 @@ public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPla createRenderer(); isRenderActive = true; } + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java index 4c57cbe3769..38f8487e6ef 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java @@ -399,7 +399,7 @@ public MultiblockTooltipBuilder createTooltip() { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { wirelessModeEnabled = !wirelessModeEnabled; if (wirelessModeEnabled) { @@ -410,6 +410,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f WirelessComputationPacket.disableWirelessNetWork(getBaseMetaTileEntity()); } } + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java index 153a5a52eee..4e7f60dfe06 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java @@ -551,8 +551,7 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { switch (machineType) { case scanner -> machineType = assembly; case assembly -> machineType = scanner; @@ -560,6 +559,7 @@ public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPla aPlayer.addChatComponentMessage( new ChatComponentTranslation( "gt.blockmachines.multimachine.em.research.mode." + machineType.replace(" ", "_"))); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java index 0251a919f0c..903b5cc5dc3 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java @@ -81,11 +81,10 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { LASER = !LASER; - GTUtility.sendChatToPlayer( - aPlayer, - String.format(StatCollector.translateToLocal("tt.chat.debug.generator"), LASER ? "ON" : "OFF")); + GTUtility.sendLocalizedChatToPlayer(aPlayer, "tt.chat.debug.generator", LASER ? "ON" : "OFF"); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java index a03266ac896..70e409acd00 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java @@ -151,7 +151,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); String pseudoJavaCode = StructureUtility.getPseudoJavaCode( @@ -172,6 +172,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f TecTech.LOGGER.info(pseudoJavaCode); result = pseudoJavaCode.split("\\n"); aBaseMetaTileEntity.disableWorking(); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java index 15cd63d6c92..794ee06116f 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java @@ -135,7 +135,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { String clientLocale; try { EntityPlayerMP player = (EntityPlayerMP) aPlayer; @@ -148,6 +148,7 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f aPlayer, interdimensional ? translateToLocalFormatted("tt.keyphrase.Running_interdimensional_scan", clientLocale) : translateToLocalFormatted("tt.keyphrase.Running_local_dimension_scan", clientLocale)); + return true; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java index c5db9320417..af124a6fb23 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java @@ -10,6 +10,7 @@ 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; import net.minecraftforge.common.util.ForgeDirection; @@ -90,7 +91,7 @@ public String[] getDescription() { @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { if (overdriveToggle) { overdriveToggle = false; PlayerChatHelper @@ -104,7 +105,7 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre } @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { if (histSettingHigh < histHighLimit) { histSettingHigh++; @@ -130,11 +131,12 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f + round(histLow * 100F) + "%"); } + return true; } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, - float aX, float aY, float aZ) { + float aX, float aY, float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { if (transferRadius > transferRadiusMin) { transferRadius--; @@ -147,7 +149,7 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench PlayerChatHelper.SendInfo( aPlayer, translateToLocalFormatted("tt.keyphrase.Tesla_radius_set_to", clientLocale) + " " + transferRadius + "m"); - return false; + return true; } // Cheeky skrub stuff to get machine to switch powerPass on soft mallet diff --git a/src/main/resources/assets/bartworks/lang/en_US.lang b/src/main/resources/assets/bartworks/lang/en_US.lang index e5c1a360274..ab7a17fa101 100644 --- a/src/main/resources/assets/bartworks/lang/en_US.lang +++ b/src/main/resources/assets/bartworks/lang/en_US.lang @@ -225,9 +225,6 @@ BW.NEI.display.radhatch.0=Sievert: %s Sv BW.NEI.display.radhatch.1=Mass: %s kg BW.NEI.display.radhatch.2=Time: %s s -misc.BatchModeTextOn=Batch recipes -misc.BatchModeTextOff=Don't batch recipes - tooltip.cal.imprintedWith=Imprinted with: chat.cal.mode.0=Circuit Assembly Line Mode chat.cal.mode.1=Circuit Assembler Mode diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index 049bb66bc49..a7a76eb86aa 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -253,7 +253,8 @@ gt.recipe.category.tic_bolt_molding=TiC Bolt Molding GT5U.machines.tier=Tier GT5U.machines.workarea=Work Area -GT5U.machines.workareaset=Work Area set to +GT5U.machines.workareaset.blocks=Work Area set to §6%1$d§rx§6%1$d§r blocks +GT5U.machines.workareaset.chunks=Work Area set to §6%1$d§rx§6%1$d§r chunks GT5U.machines.workarea_fail=Can't adjust work area while running GT5U.machines.autoretract.enabled=Auto retract enabled GT5U.machines.autoretract.disabled=Auto retract disabled @@ -264,14 +265,19 @@ GT5U.machines.miner=Miner GT5U.machines.powersource.power=power GT5U.machines.powersource.steam=steam GT5U.machines.pump=Pump -GT5U.machines.separatebus=Input buses are separated +GT5U.machines.separateInputs.on=Input Separation: §aOn§r +GT5U.machines.separateInputs.off=Input Separation: §cOff§r +GT5U.machines.batchMode.on=Batch Mode: §aOn§r +GT5U.machines.batchMode.off=Batch Mode: §cOff§r +GT5U.machines.recipeLock.on=Recipe Locking: §aOn§r +GT5U.machines.recipeLock.off=Recipe Locking: §cOff§r GT5U.machines.pumpareaset=Pumping area set to GT5U.machines.oilfluidpump=Oil/Fluid Pump GT5U.machines.minermulti=Multiblock Miner -GT5U.machines.digitalchest.voidoverflow.enabled=Overflow Voiding Mode §aOn§r -GT5U.machines.digitalchest.voidoverflow.disabled=Overflow Voiding Mode §cOff§r -GT5U.machines.digitalchest.inputfilter.enabled=Input Filter §aOn§r -GT5U.machines.digitalchest.inputfilter.disabled=Input Filter §cOff§r +GT5U.machines.digitalchest.voidoverflow.enabled=Overflow Voiding Mode: §aOn§r +GT5U.machines.digitalchest.voidoverflow.disabled=Overflow Voiding Mode: §cOff§r +GT5U.machines.digitalchest.inputfilter.enabled=Input Filter: §aOn§r +GT5U.machines.digitalchest.inputfilter.disabled=Input Filter: §cOff§r GT5U.machines.digitaltank.tooltip=Stores %sL of fluid GT5U.machines.digitaltank.tooltip1=Will keep its contents when harvested GT5U.machines.digitaltank.autooutput.tooltip=Fluid Auto-Output @@ -355,7 +361,7 @@ GT5U.GTPP_MULTI_PRECISE_ASSEMBLER.mode.0=Precise GT5U.GTPP_MULTI_PRECISE_ASSEMBLER.mode.1=Normal GT5U.GTPP_MULTI_PACKAGER.mode.0=Packager GT5U.GTPP_MULTI_PACKAGER.mode.1=Unpackager -GT5U.MULTI_MACHINE_CHANGE=Now running in %s mode +GT5U.MULTI_MACHINE_CHANGE=Now running in §6%s§r mode GT5U.MULTI_MACHINE_CONFIG.SAVE=Saved Multiblock Hatch Configuration GT5U.MULTI_MACHINE_CONFIG.LOAD=Loaded Multiblock Hatch Configuration GT5U.MULTI_MACHINE_CONFIG.LOAD.FAIL=Failed to load Multiblock Hatch Configuration @@ -632,10 +638,10 @@ gt.behaviour.paintspray.infinite.tooltip.pick=Middle Click block: Copy color to gt.behaviour.paintspray.infinite.tooltip.lock=Sneak Middle Click: Lock or unlock spray can gt.behaviour.paintspray.infinite.tooltip.gui=Middle Click: Open color choice GUI -GT5U.hatch.disableFilter.true=Input Filter §cOff§r -GT5U.hatch.disableFilter.false=Input Filter §aOn§r -GT5U.hatch.disableMultiStack.true=Multi Stack Input §cOff§r -GT5U.hatch.disableMultiStack.false=Multi Stack Input §aOn§r +GT5U.hatch.disableFilter.true=Input Filter: §cOff§r +GT5U.hatch.disableFilter.false=Input Filter: §aOn§r +GT5U.hatch.disableMultiStack.true=Multi Stack Input: §cOff§r +GT5U.hatch.disableMultiStack.false=Multi Stack Input: §aOn§r GT5U.hatch.disableSort.true=Sorting mode §cOff§r GT5U.hatch.disableSort.false=Sorting mode §aOn§r GT5U.hatch.disableLimited.true=Limiting mode §cOff§r diff --git a/src/main/resources/assets/miscutils/lang/en_US.lang b/src/main/resources/assets/miscutils/lang/en_US.lang index db483cc68a2..0563fb8e519 100644 --- a/src/main/resources/assets/miscutils/lang/en_US.lang +++ b/src/main/resources/assets/miscutils/lang/en_US.lang @@ -22,10 +22,6 @@ death.attack.plasmabolt=%s died by burning hot plasma. death.attack.plasmabolt.player=%1$s was killed by %2$s using plasma. death.attack.gtpp.grinder=%s was ground into nothingness by an IsaMill. -# Batch mode chat message -misc.BatchModeTextOn=Batch recipes (ME output bus recommended, will void excess outputs!) -misc.BatchModeTextOff=Don't batch recipes - # Alternative Materials item.itemPlateBatteryAlloy.name=Plate of Battery Alloy item.itemIngotBatteryAlloy.name=Ingot of Battery Alloy From 461d5ab06b6225ac036eb6bb60186386c9bff196 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Tue, 24 Sep 2024 21:30:46 -0400 Subject: [PATCH 2/5] applied spotless --- .../common/tileentities/multis/MTEBioVat.java | 2 -- .../multis/MTECircuitAssemblyLine.java | 3 +- .../multis/MTEDeepEarthHeatingPump.java | 3 +- .../MTEElectricImplosionCompressor.java | 2 -- .../multis/MTEHighTempGasCooledReactor.java | 3 +- .../multis/MTEThoriumHighTempReactor.java | 3 +- .../multis/mega/MTEMegaBlastFurnace.java | 1 - .../multis/mega/MTEMegaChemicalReactor.java | 3 -- .../multis/mega/MTEMegaDistillTower.java | 3 -- .../multis/mega/MTEMegaOilCracker.java | 3 -- .../multis/mega/MTEMegaVacuumFreezer.java | 3 -- .../common/tileentities/tiered/MTEDiode.java | 3 +- .../galacticgreg/MTEVoidMinerBase.java | 3 +- src/main/java/ggfab/mte/MTEAdvAssLine.java | 1 - .../java/ggfab/mte/MTELinkedInputBus.java | 3 +- .../tileEntity/AntimatterGenerator.java | 3 +- .../tileEntity/AntimatterOutputHatch.java | 3 +- .../GTMetaTileEntity/MTEYOTTAHatch.java | 4 +-- .../tileEntity/MTEComponentAssemblyLine.java | 2 -- .../tileEntity/MTENeutronActivator.java | 1 - .../tileEntity/MTEPreciseAssembler.java | 3 +- .../MTESupercriticalFluidTurbine.java | 3 +- .../tileEntity/base/MTELargeTurbineBase.java | 3 +- .../metatileentity/IMetaTileEntity.java | 18 ++++++---- .../metatileentity/BaseMetaPipeEntity.java | 18 +++++----- .../metatileentity/BaseMetaTileEntity.java | 34 +++++++++++-------- .../api/metatileentity/MetaPipeEntity.java | 18 ++++++---- .../api/metatileentity/MetaTileEntity.java | 20 ++++++----- .../implementations/MTEBasicMachine.java | 9 +++-- .../implementations/MTEBuffer.java | 9 +++-- .../implementations/MTECable.java | 6 ++-- .../MTEEnhancedMultiBlockBase.java | 3 +- .../implementations/MTEHatchInputBus.java | 6 ++-- .../implementations/MTEHatchOutput.java | 3 +- .../implementations/MTEItem.java | 3 +- .../implementations/MTEMultiBlockBase.java | 16 ++++++--- src/main/java/gregtech/common/GTClient.java | 6 ++-- .../automation/MTEItemDistributor.java | 3 +- .../tileentities/automation/MTERegulator.java | 1 - .../debug/MTEAdvDebugStructureWriter.java | 3 +- .../generators/MTEMagicalEnergyAbsorber.java | 3 +- .../machines/MTEHatchCraftingInputME.java | 1 - .../machines/MTEHatchInputBusME.java | 7 ++-- .../machines/MTEHatchInputME.java | 7 ++-- .../machines/MTEHatchOutputBusME.java | 1 - .../machines/MTEHatchOutputME.java | 4 +-- .../tileentities/machines/basic/MTEMiner.java | 3 +- .../tileentities/machines/basic/MTEPump.java | 6 ++-- .../machines/basic/MTEWorldAccelerator.java | 6 ++-- .../machines/multi/MTEDrillerBase.java | 3 +- .../multi/MTEElectricBlastFurnace.java | 1 - ...MTEIndustrialElectromagneticSeparator.java | 2 -- .../multi/MTEIndustrialLaserEngraver.java | 6 ++-- .../multi/MTEIntegratedOreFactory.java | 3 +- .../machines/multi/MTELargeTurbine.java | 3 +- .../machines/multi/MTEMultiCanner.java | 2 -- .../machines/multi/MTENanoForge.java | 1 - .../machines/multi/MTEOilDrillBase.java | 3 +- .../multi/MTEOreDrillingPlantBase.java | 6 ++-- .../compressor/MTEBlackHoleCompressor.java | 3 +- .../machines/multi/drone/MTEDroneCentre.java | 3 +- .../storage/MTEDigitalChestBase.java | 16 ++++++--- .../storage/MTEDigitalTankBase.java | 3 +- .../tileentities/storage/MTELocker.java | 3 +- .../implementations/MTEHatchTurbine.java | 14 ++++---- .../MTEHatchTurbineProvider.java | 3 +- .../MteHatchSteamBusInput.java | 5 +-- .../base/GTPPMultiBlockBase.java | 4 +-- .../base/MTETransformerHiAmp.java | 3 +- .../automation/MTETesseractGenerator.java | 6 ++-- .../automation/MTETesseractTerminal.java | 13 +++---- .../basic/MTEAtmosphericReconditioner.java | 1 - .../machines/basic/MTEPollutionCreator.java | 3 +- .../machines/basic/MTEPollutionDetector.java | 6 ++-- .../machines/basic/MTEWirelessCharger.java | 3 +- .../multi/misc/MTEAmazonPackager.java | 3 -- .../MTEIndustrialCuttingMachine.java | 3 -- .../multi/processing/MTEIndustrialMixer.java | 3 -- .../processing/MTEIndustrialMultiMachine.java | 3 -- .../processing/MTEIndustrialPlatePress.java | 5 +-- .../processing/MTEIndustrialWashPlant.java | 3 -- .../processing/MTEIndustrialWireMill.java | 3 -- .../multi/processing/advanced/MTEAdvEBF.java | 3 -- .../production/MTEAlloyBlastSmelter.java | 3 -- .../MTEQuantumForceTransformer.java | 3 +- .../multi/production/MTESolarTower.java | 1 - .../mega/MTEMegaAlloyBlastSmelter.java | 1 - .../turbines/MTELargerTurbineBase.java | 5 ++- .../redstone/MTERedstoneButtonPanel.java | 3 +- .../redstone/MTERedstoneStrengthDisplay.java | 3 +- .../redstone/MTERedstoneStrengthScale.java | 3 +- .../tileentities/storage/MTEEnergyBuffer.java | 3 +- .../MTELapotronicSuperCapacitor.java | 3 +- .../common/tileentities/MTETankTFFT.java | 3 +- .../multiblock/MTEExtremeEntityCrusher.java | 6 ++-- .../multiblock/MTEMegaIndustrialApiary.java | 3 +- .../hatch/MTEHatchEnergyTunnel.java | 3 +- .../metaTileEntity/multi/MTEDataBank.java | 3 +- .../metaTileEntity/multi/MTEEyeOfHarmony.java | 3 +- .../metaTileEntity/multi/MTEForgeOfGods.java | 3 +- .../multi/MTEQuantumComputer.java | 3 +- .../multi/MTEResearchStation.java | 3 +- .../single/MTEDebugPowerGenerator.java | 4 +-- .../single/MTEDebugStructureWriter.java | 3 +- .../single/MTEOwnerDetector.java | 3 +- .../metaTileEntity/single/MTETeslaCoil.java | 3 +- 106 files changed, 273 insertions(+), 218 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java b/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java index 48448d39666..f0ca9e6e48d 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEBioVat.java @@ -33,7 +33,6 @@ import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -80,7 +79,6 @@ import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; import gregtech.api.util.GTRecipe; -import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.ParallelHelper; diff --git a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java index a26a3b5a97f..4f950a3d509 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java @@ -302,7 +302,8 @@ public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aP } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { this.mode = (this.mode + 1) % 2; GTUtility.sendLocalizedChatToPlayer(aPlayer, "chat.cal.mode." + this.mode); diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java index 67754aa7e58..79e5ddcdb0b 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java @@ -197,7 +197,8 @@ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zD } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { this.mMode++; if (this.mMode >= 4) this.mMode = 0; diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java b/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java index 1a570ac92fe..efa979b34f5 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEElectricImplosionCompressor.java @@ -41,11 +41,9 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java b/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java index ac10da9ce8c..09f59dcc5c4 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEHighTempGasCooledReactor.java @@ -450,7 +450,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "HTGR mode cannot be changed while the machine is running."); return false; diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java b/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java index 31410a20148..a2592a806d6 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEThoriumHighTempReactor.java @@ -379,7 +379,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "THTR mode cannot be changed while the machine is running."); return false; 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 3c3e3e4493e..2995bccfc8c 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java @@ -31,7 +31,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; 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 ff280d574be..f13be3cf47f 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaChemicalReactor.java @@ -25,12 +25,10 @@ import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages; 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; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -50,7 +48,6 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; public class MTEMegaChemicalReactor extends MegaMultiBlockBase 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 325fd4ac286..e54250a7395 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaDistillTower.java @@ -27,12 +27,10 @@ import java.util.ArrayList; 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; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -55,7 +53,6 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.tileentities.machines.MTEHatchOutputME; 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 7ea56d2b46e..faa086cf209 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java @@ -34,11 +34,9 @@ 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; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -66,7 +64,6 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.maps.OilCrackerBackend; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; import gregtech.common.tileentities.machines.MTEHatchInputME; diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java index d528f57b66c..f1674e4778a 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java @@ -32,13 +32,11 @@ 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; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -63,7 +61,6 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GTRecipe; -import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; import gregtech.api.util.shutdown.ShutDownReasonRegistry; diff --git a/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java b/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java index 7c0cf1a99a0..3874fe91f84 100644 --- a/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java +++ b/src/main/java/bartworks/common/tileentities/tiered/MTEDiode.java @@ -66,7 +66,8 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { if (!aPlayer.isSneaking()) { --this.aAmps; diff --git a/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java b/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java index e1c1dd25e05..2af0dff0130 100644 --- a/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java +++ b/src/main/java/bwcrossmod/galacticgreg/MTEVoidMinerBase.java @@ -302,7 +302,8 @@ private void handleOutputs() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { this.mBlacklist = !this.mBlacklist; GTUtility.sendChatToPlayer(aPlayer, "Mode: " + (this.mBlacklist ? "Blacklist" : "Whitelist")); return true; diff --git a/src/main/java/ggfab/mte/MTEAdvAssLine.java b/src/main/java/ggfab/mte/MTEAdvAssLine.java index ff30d8b5ed1..9ea4eb0460a 100644 --- a/src/main/java/ggfab/mte/MTEAdvAssLine.java +++ b/src/main/java/ggfab/mte/MTEAdvAssLine.java @@ -33,7 +33,6 @@ import java.util.stream.IntStream; import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; diff --git a/src/main/java/ggfab/mte/MTELinkedInputBus.java b/src/main/java/ggfab/mte/MTELinkedInputBus.java index 762824db5d8..2219288ae74 100644 --- a/src/main/java/ggfab/mte/MTELinkedInputBus.java +++ b/src/main/java/ggfab/mte/MTELinkedInputBus.java @@ -336,7 +336,8 @@ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { if (this.mRealInventory == null) { aPlayer.addChatMessage(new ChatComponentTranslation("ggfab.info.linked_input_bus.no_channel")); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java index 69de9093d73..dd56005932d 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterGenerator.java @@ -282,7 +282,8 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { wirelessEnabled = !wirelessEnabled; GTUtility.sendChatToPlayer(aPlayer, "Wireless network mode " + (wirelessEnabled ? "enabled." : "disabled.")); if (wirelessEnabled) { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java index 44334b93af4..b1886754e02 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/AntimatterOutputHatch.java @@ -52,7 +52,8 @@ protected void onEmptyingContainerWhenEmpty() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { mMode = (byte) ((mMode + 9) % 10); } else { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java index 21bc5da7c0e..a3d5408c111 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/GTMetaTileEntity/MTEYOTTAHatch.java @@ -105,8 +105,8 @@ public boolean isAccessAllowed(EntityPlayer aPlayer) { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, - ItemStack toolStack) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack toolStack) { if (aPlayer.isSneaking()) { this.priority -= 10; } else { diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java index 9084b72ae33..b0d852133a3 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEComponentAssemblyLine.java @@ -10,7 +10,6 @@ import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -42,7 +41,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTStructureUtility; -import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java b/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java index 3cf330625df..4c845c63f4f 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTENeutronActivator.java @@ -10,7 +10,6 @@ import java.util.Collections; import java.util.List; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java index d2f8930bd46..310978a36d4 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java @@ -234,7 +234,8 @@ public void saveNBTData(NBTTagCompound aNBT) { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { this.mode = (this.mode + 1) % 2; GTUtility.sendLocalizedChatToPlayer(aPlayer, "preciseassembler.chat." + this.mode); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java b/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java index 0d2d5d643e5..3dd4b6b0b90 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTESupercriticalFluidTurbine.java @@ -89,7 +89,8 @@ public int fluidIntoPower(ArrayList aFluids, TurbineStatCalculator t } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GTUtility.sendChatToPlayer( diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java index 5e36c12542c..0ac2b719d81 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeTurbineBase.java @@ -323,7 +323,8 @@ public boolean hasTurbine() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GTUtility.sendChatToPlayer( diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java index 3e3e3880003..5815dc1bac0 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java @@ -132,32 +132,38 @@ public interface IMetaTileEntity extends ISidedInventory, IFluidTank, IFluidHand /** * When a Player right-clicks the Facing with a Screwdriver. */ - boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool); + boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool); /** * When a Player right-clicks the Facing with a Wrench. */ - boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool); + boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, + float aY, float aZ, ItemStack aTool); /** * When a Player right-clicks the Facing with a wire cutter. */ - boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool); + boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack aTool); /** * When a Player right-clicks the Facing with a soldering iron. */ - boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool); + boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack aTool); /** * When a player right-clicks a side with a hard hammer. */ - boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool); + boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool); /** * When a player right-clicks a side with a jack hammer. */ - boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool); + boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool); /** * Called right before this Machine explodes diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index ae214f8fc96..5a820804128 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -14,7 +14,6 @@ import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -845,17 +844,18 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo // Configuration of delicate electronics calls for a tool with precision and subtlety. final CoverInfo info = getCoverInfoAtSide(coverSide); info.updateCoverBehavior(); - if (info.getCoverBehavior().allowsTickRateAddition()) { + if (info.getCoverBehavior() + .allowsTickRateAddition()) { info.onCoverJackhammer(aPlayer); usedTool = true; } else { - GTUtility.sendLocalizedChatToPlayer( - aPlayer, - "gt.cover.info.chat.tick_rate_not_allowed"); + GTUtility + .sendLocalizedChatToPlayer(aPlayer, "gt.cover.info.chat.tick_rate_not_allowed"); return true; } } else { - usedTool = mMetaTileEntity.onJackHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); + usedTool = mMetaTileEntity + .onJackHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); } break; @@ -891,7 +891,8 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo break; } case SolderingIron: { - if (mMetaTileEntity.onSolderingToolRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + if (mMetaTileEntity + .onSolderingToolRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { usedTool = true; } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= wrenchSide.flag; @@ -911,7 +912,8 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo break; } case WireCutter: { - if (mMetaTileEntity.onWireCutterRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + if (mMetaTileEntity + .onWireCutterRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { usedTool = true; doEnetUpdate(); diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 0b8487bfa5a..0733e647780 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -29,7 +29,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -1494,9 +1493,10 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo // Configure Cover, sneak can also be: screwdriver, wrench, side cutter, soldering iron if (aPlayer.isSneaking()) { return getCoverBehaviorAtSideNew(coverSide).hasCoverGUI(); - } else if (getCoverBehaviorAtSideNew(coverSide).onCoverRightclickClient(coverSide, this, aPlayer, aX, aY, aZ)) { - return true; - } + } else if (getCoverBehaviorAtSideNew(coverSide) + .onCoverRightclickClient(coverSide, this, aPlayer, aX, aY, aZ)) { + return true; + } } if (!getCoverInfoAtSide(side).isGUIClickable()) return false; @@ -1534,17 +1534,18 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo // Configuration of delicate electronics calls for a tool with precision and subtlety. final CoverInfo info = getCoverInfoAtSide(coverSide); info.updateCoverBehavior(); - if (info.getCoverBehavior().allowsTickRateAddition()) { + if (info.getCoverBehavior() + .allowsTickRateAddition()) { info.onCoverJackhammer(aPlayer); usedTool = true; } else { - GTUtility.sendLocalizedChatToPlayer( - aPlayer, - "gt.cover.info.chat.tick_rate_not_allowed"); + GTUtility + .sendLocalizedChatToPlayer(aPlayer, "gt.cover.info.chat.tick_rate_not_allowed"); return true; } } else { - usedTool = mMetaTileEntity.onJackHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); + usedTool = mMetaTileEntity + .onJackHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); } break; @@ -1580,7 +1581,8 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo break; } case SolderingIron: { - if (mMetaTileEntity.onSolderingToolRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + if (mMetaTileEntity + .onSolderingToolRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { usedTool = true; } else if (GTModHandler.useSolderingIron(tCurrentItem, aPlayer)) { mStrongRedstone ^= wrenchSide.flag; @@ -1611,13 +1613,15 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo break; } case Wrench: { - if (aPlayer.isSneaking() && mMetaTileEntity instanceof MTEBasicMachine basicMachine && basicMachine.setMainFacing(wrenchSide)) { + if (aPlayer.isSneaking() && mMetaTileEntity instanceof MTEBasicMachine basicMachine + && basicMachine.setMainFacing(wrenchSide)) { usedTool = true; cableUpdateDelay = 10; - } else if (mMetaTileEntity.onWrenchRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { - usedTool = true; - cableUpdateDelay = 10; - } + } else if (mMetaTileEntity + .onWrenchRightClick(side, wrenchSide, aPlayer, aX, aY, aZ, tCurrentItem)) { + usedTool = true; + cableUpdateDelay = 10; + } break; } } diff --git a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java index 713990ebd54..9b411df24b5 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java @@ -259,32 +259,38 @@ public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { return false; } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, + float aY, float aZ, ItemStack aTool) { return false; } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack aTool) { return false; } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack aTool) { return false; } @Override - public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { return false; } @Override - public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { return false; } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 42bb4b589b8..6a6e0f05f0e 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -7,7 +7,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import java.util.Set; import java.util.function.Supplier; import net.minecraft.block.Block; @@ -21,8 +20,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -230,12 +227,14 @@ public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { return false; } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack aTool) { if (getBaseMetaTileEntity().isValidFacing(wrenchingSide)) { getBaseMetaTileEntity().setFrontFacing(wrenchingSide); return true; @@ -244,7 +243,8 @@ public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingS } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack aTool) { if (!aPlayer.isSneaking()) return false; final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); final TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); @@ -274,11 +274,12 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre } @Override - public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { if (getBaseMetaTileEntity() instanceof BaseMetaTileEntity base) { base.mInputDisabled = !base.mInputDisabled; if (base.mInputDisabled) base.mOutputDisabled = !base.mOutputDisabled; - + GTUtility.sendChatToPlayer( aPlayer, GTUtility.trans("086", "Allow Input: "), @@ -293,7 +294,8 @@ public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, } @Override - public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { return false; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachine.java index f60c7a47798..0e724253058 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicMachine.java @@ -907,7 +907,8 @@ public boolean isGivingInformation() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing() || side == mMainFacing) { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; GTUtility.sendChatToPlayer( @@ -921,7 +922,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, + EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing() || side == mMainFacing) { mDisableMultiStack = !mDisableMultiStack; GTUtility.sendLocalizedChatToPlayer(entityPlayer, "GT5U.hatch.disableMultiStack." + mDisableMultiStack); @@ -932,7 +934,8 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack aTool) { if (side == getBaseMetaTileEntity().getFrontFacing() || side == mMainFacing) { mDisableFilter = !mDisableFilter; GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.hatch.disableFilter." + mDisableFilter); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBuffer.java index 50485840a1c..0bae84d7def 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEBuffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBuffer.java @@ -304,7 +304,8 @@ public void setItemNBT(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getBackFacing()) { mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking() ? -1 : 1)) % 65); @@ -325,7 +326,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack tool) { wrenchingSide = wrenchingSide.getOpposite(); if (getBaseMetaTileEntity().isValidFacing(wrenchingSide)) { getBaseMetaTileEntity().setFrontFacing(wrenchingSide); @@ -458,7 +460,8 @@ protected void fillStacksIntoFirstSlots() { } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack tool) { // I was so proud of all this but I literally just copied code from OutputBus bSortStacks = !bSortStacks; GTUtility.sendChatToPlayer( diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java b/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java index 8643a49e669..481798b7362 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java @@ -265,7 +265,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (GTMod.gregtechproxy.gt6Cable && GTModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { if (isConnectedAtSide(wrenchingSide)) { @@ -281,7 +282,8 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (GTMod.gregtechproxy.gt6Cable && GTModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { if (isConnectedAtSide(wrenchingSide)) { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java index 2653766b49b..985f062cf52 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEEnhancedMultiBlockBase.java @@ -82,7 +82,8 @@ public final boolean isFacingValid(ForgeDirection facing) { } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (wrenchingSide != getBaseMetaTileEntity().getFrontFacing()) { return super.onWrenchRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ, tool); } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInputBus.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInputBus.java index 2915b899e58..2e384155713 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInputBus.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchInputBus.java @@ -210,8 +210,10 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (!getBaseMetaTileEntity().getCoverInfoAtSide(side).isGUIClickable()) return false; + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { + if (!getBaseMetaTileEntity().getCoverInfoAtSide(side) + .isGUIClickable()) return false; if (aPlayer.isSneaking()) { if (disableSort) { disableSort = false; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutput.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutput.java index be6ae277b58..710c9ab27da 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutput.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchOutput.java @@ -216,7 +216,8 @@ public int getCapacity() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { mMode = (byte) ((mMode + 9) % 10); } else { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEItem.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEItem.java index fff8e9279ef..e234a1e1e7a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEItem.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEItem.java @@ -233,7 +233,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (GTMod.gregtechproxy.gt6Pipe) { if (isConnectedAtSide(wrenchingSide)) { disconnect(wrenchingSide); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index f33858101e6..8f4111fb331 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -23,6 +23,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; + import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -195,7 +196,8 @@ public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aCoverID) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (onModeChangeByScrewdriver(side, aPlayer, aX, aY, aZ)) { return true; } else { @@ -204,7 +206,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (supportsVoidProtection() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { Set allowed = getAllowedVoidingModes(); setVoidingMode(getVoidingMode().nextInCollection(allowed)); @@ -220,7 +223,8 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (supportsBatchMode() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { batchMode = !batchMode; if (batchMode) { @@ -235,7 +239,8 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench } @Override - public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (supportsInputSeparation() && side == getBaseMetaTileEntity().getFrontFacing()) { this.inputSeparation = !this.inputSeparation; if (inputSeparation) { @@ -251,7 +256,8 @@ public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, } @Override - public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (supportsSingleRecipeLocking()) { mLockedToSingleRecipe = !mLockedToSingleRecipe; if (mLockedToSingleRecipe) { diff --git a/src/main/java/gregtech/common/GTClient.java b/src/main/java/gregtech/common/GTClient.java index 478155a46f2..86982ddc15d 100644 --- a/src/main/java/gregtech/common/GTClient.java +++ b/src/main/java/gregtech/common/GTClient.java @@ -834,7 +834,8 @@ public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) { if (GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sSolderingToolList) || (GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sSoftHammerList) && aTileEntity instanceof MultiBlockPart) && aEvent.player.isSneaking()) { - if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) == 0) { + if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) + == 0) { drawGrid(aEvent, false, false, aEvent.player.isSneaking()); } return; @@ -844,7 +845,8 @@ public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) { || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sCrowbarList) || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sJackhammerList) || GTUtility.isStackInList(aEvent.currentItem, GregTechAPI.sScrewdriverList)) { - if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) == 0) { + if (((ICoverable) aTileEntity).getCoverIDAtSide(ForgeDirection.getOrientation(aEvent.target.sideHit)) + == 0) { for (final ForgeDirection tSide : ForgeDirection.VALID_DIRECTIONS) { if (((ICoverable) aTileEntity).getCoverIDAtSide(tSide) > 0) { drawGrid(aEvent, true, false, true); diff --git a/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java index 30ef13d2793..bb3c4ec8b45 100644 --- a/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java +++ b/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java @@ -168,7 +168,8 @@ protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { final int ordinalSide = side.ordinal(); // Adjust items per side by 1 or -1, constrained to the cyclic interval [0, 127] itemsPerSide[ordinalSide] += aPlayer.isSneaking() ? -1 : 1; diff --git a/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java b/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java index 940613f473c..26c2b5a2c41 100644 --- a/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java +++ b/src/main/java/gregtech/common/tileentities/automation/MTERegulator.java @@ -5,7 +5,6 @@ import java.util.Collections; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java b/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java index 7c279660d86..f21457857cb 100644 --- a/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java +++ b/src/main/java/gregtech/common/tileentities/debug/MTEAdvDebugStructureWriter.java @@ -162,7 +162,8 @@ public void onRemoval() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); printStructure(aPlayer); aBaseMetaTileEntity.disableWorking(); diff --git a/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java index 63270b73eac..ee0ab0a18e6 100644 --- a/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/MTEMagicalEnergyAbsorber.java @@ -140,7 +140,8 @@ public void onConfigLoad() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { mMagicalEnergyBB.decreaseTier(); } else { diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java index 3565d7125a7..3d0be3db502 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchCraftingInputME.java @@ -28,7 +28,6 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java index 04c8f4bdbcc..fabc67c902c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputBusME.java @@ -293,13 +293,16 @@ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (!autoPullAvailable) { return false; } setAutoPullItemList(!autoPullItemList); - GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.stocking_bus.auto_pull_toggle." + (autoPullItemList ? "enabled" : "disabled")); + GTUtility.sendLocalizedChatToPlayer( + aPlayer, + "GT5U.machines.stocking_bus.auto_pull_toggle." + (autoPullItemList ? "enabled" : "disabled")); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java index 5bfdcbd841c..fc825ceaf64 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchInputME.java @@ -555,10 +555,13 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (autoPullAvailable) { setAutoPullFluidList(!autoPullFluidList); - GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.stocking_hatch.auto_pull_toggle." + (autoPullFluidList ? "enabled" : "disabled")); + GTUtility.sendLocalizedChatToPlayer( + aPlayer, + "GT5U.machines.stocking_hatch.auto_pull_toggle." + (autoPullFluidList ? "enabled" : "disabled")); return true; } else { diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java index 661e7a074ee..5d033863377 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java @@ -14,7 +14,6 @@ import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java index 9002ddd0d6b..d962540dd3f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java @@ -14,7 +14,6 @@ import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -213,7 +212,8 @@ public boolean doesFillContainers() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { // Don't allow to lock fluid in me fluid hatch return false; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java index 9194286aaa2..16437e771b6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java @@ -151,7 +151,8 @@ public boolean hasFreeSpace() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side != getBaseMetaTileEntity().getFrontFacing() && side != mMainFacing) { if (aPlayer.isSneaking()) { if (radiusConfig >= 0) { diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java index 623e6f1dcfa..4303e835556 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java @@ -258,7 +258,8 @@ public void setItemNBT(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side != getBaseMetaTileEntity().getFrontFacing() && side != mMainFacing) { int max = getMaxPumpableDistance(); if (aPlayer.isSneaking()) { @@ -284,7 +285,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, + EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { if (super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ, tool)) return true; mDisallowRetract = !mDisallowRetract; GTUtility.sendChatToPlayer( diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java index cc7801ece85..5d0287d3e39 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEWorldAccelerator.java @@ -276,7 +276,8 @@ public long maxAmperesIn() { // This uses the Wrench as second tool to cycle speeds @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer pPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer pPlayer, float aX, + float aY, float aZ, ItemStack tool) { incSpeedTierOverride(); markDirty(); @@ -288,7 +289,8 @@ public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingS } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer pPlayer, float pX, float pY, float pZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer pPlayer, float pX, float pY, float pZ, + ItemStack tool) { if (pPlayer.isSneaking()) { if (mMode == 0) { incRadiusTierOverride(); 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 84d7af22018..1290f2cd151 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java @@ -256,7 +256,8 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, + EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { mChunkLoadingEnabled = !mChunkLoadingEnabled; GTUtility.sendChatToPlayer( diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java index 98caad5ecb1..35a0fe32dd0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java @@ -26,7 +26,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; 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 354e7596152..437af02d5cd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialElectromagneticSeparator.java @@ -16,7 +16,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; @@ -55,7 +54,6 @@ import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.blocks.BlockCasings10; import gregtech.common.items.MetaGeneratedItem01; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java index 965a7b599de..e4be90ecbb2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java @@ -196,7 +196,8 @@ public ITexture[] getTexture(IGregTechTileEntity baseMetaTileEntity, ForgeDirect private boolean stopAllRendering = false; @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { stopAllRendering = !stopAllRendering; if (stopAllRendering) { PlayerUtils.messagePlayer(aPlayer, "Rendering off"); @@ -208,7 +209,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack aTool) { if (renderer != null) { renderer.realism = !renderer.realism; PlayerUtils.messagePlayer(aPlayer, "Toggling realism!"); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java index 6ca7495a8da..95f53797853 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java @@ -426,7 +426,8 @@ private boolean checkTypes(int aID, HashSet... aTables) { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { if (aPlayer.isSneaking()) { sVoidStone = !sVoidStone; GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.oreprocessor.void", sVoidStone); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java index c781a28ef7c..db287605ab1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java @@ -451,7 +451,8 @@ public boolean hasTurbine() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GTUtility.sendChatToPlayer( diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java index 28bb795badd..39d2ee62d7e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiCanner.java @@ -15,7 +15,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; @@ -44,7 +43,6 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.blocks.BlockCasings2; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java index 77d342b9631..fdb530ca123 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTENanoForge.java @@ -18,7 +18,6 @@ import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java index 343bdde75a9..e1a5ffae81d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java @@ -145,7 +145,8 @@ protected MultiblockTooltipBuilder createTooltip(String tierSuffix) { protected abstract int getRangeInChunks(); @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { int oldChunkRange = chunkRangeConfig; if (aPlayer.isSneaking()) { if (chunkRangeConfig > 0) { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java index 59b4ce6da0d..8ae0efa32c6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java @@ -141,7 +141,8 @@ private void adjustChunkRadius(boolean increase) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (getBaseMetaTileEntity().isActive()) { GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.workarea_fail")); } else { @@ -149,7 +150,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer if (mChunkLoadingEnabled) { GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.chunks", chunkRadiusConfig); } else { - GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.blocks", chunkRadiusConfig << 4); + GTUtility + .sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.workareaset.blocks", chunkRadiusConfig << 4); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java index b35d545ba32..933f90c7fc5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java @@ -205,7 +205,8 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { shouldRender = !shouldRender; if (!shouldRender) { PlayerUtils.messagePlayer(aPlayer, "Rendering off"); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java index f7cc9a69088..343f0928afa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/drone/MTEDroneCentre.java @@ -242,7 +242,8 @@ public int getMaxEfficiency(ItemStack aStack) { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { useRender = !useRender; aPlayer.addChatComponentMessage( new ChatComponentTranslation( diff --git a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java index 584daaf9694..316ca102df6 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalChestBase.java @@ -14,7 +14,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; @@ -269,9 +268,13 @@ public StorageChannel getChannel() { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { mVoidOverflow = !mVoidOverflow; - GTUtility.sendLocalizedChatToPlayer(aPlayer, mVoidOverflow ? "GT5U.machines.digitalchest.voidoverflow.enabled" : "GT5U.machines.digitalchest.voidoverflow.disabled"); + GTUtility.sendLocalizedChatToPlayer( + aPlayer, + mVoidOverflow ? "GT5U.machines.digitalchest.voidoverflow.enabled" + : "GT5U.machines.digitalchest.voidoverflow.disabled"); return true; } @@ -280,8 +283,11 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre float aX, float aY, float aZ, ItemStack tool) { if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { mDisableFilter = !mDisableFilter; - GTUtility.sendLocalizedChatToPlayer(aPlayer, mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled" : "GT5U.machines.digitalchest.inputfilter.enabled"); - + GTUtility.sendLocalizedChatToPlayer( + aPlayer, + mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled" + : "GT5U.machines.digitalchest.inputfilter.enabled"); + return true; } else { return false; diff --git a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java index 4ec71e36c2b..f14925660df 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTEDigitalTankBase.java @@ -312,7 +312,8 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; GTUtility.sendChatToPlayer( aPlayer, diff --git a/src/main/java/gregtech/common/tileentities/storage/MTELocker.java b/src/main/java/gregtech/common/tileentities/storage/MTELocker.java index 271b2b239fa..6237c4352b8 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTELocker.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTELocker.java @@ -177,7 +177,8 @@ public void doSound(byte aIndex, double aX, double aY, double aZ) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) { this.mType = ((byte) (this.mType + 1)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java index 03fe021d8ec..62b9526ef78 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java @@ -14,7 +14,6 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.GregTechAPI; import gregtech.api.enums.Materials; import gregtech.api.enums.SoundResource; import gregtech.api.gui.modularui.GTUIInfos; @@ -25,7 +24,6 @@ import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.objects.GTItemStack; import gregtech.api.objects.GTRenderedTexture; -import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; @@ -316,7 +314,8 @@ public boolean allowCoverOnSide(ForgeDirection side, GTItemStack aStack) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (!aPlayer.isSneaking()) { PlayerUtils.messagePlayer(aPlayer, "Using Animations? " + usingAnimations()); PlayerUtils.messagePlayer(aPlayer, "Has Controller? " + this.mHasController); @@ -350,7 +349,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, + float aY, float aZ, ItemStack tool) { ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null && tCurrentItem.getItem() instanceof MetaGeneratedTool) { boolean aHasTurbine = this.hasTurbine(); @@ -368,8 +368,10 @@ public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingS } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (this.getBaseMetaTileEntity().isServerSide()) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack tool) { + if (this.getBaseMetaTileEntity() + .isServerSide()) { ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null && tCurrentItem.getItem() instanceof MetaGeneratedTool) { if (mControllerLocation != null && mControllerLocation.length() > 0) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java index a4905a76fb4..1c359e1e2e3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java @@ -156,7 +156,8 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer != null) { if (KeyboardUtils.isCtrlKeyDown()) { mDescending = !mDescending; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java index d452ab63f68..b097ade8222 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MteHatchSteamBusInput.java @@ -140,12 +140,13 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { disableSort = !disableSort; GTUtility.sendChatToPlayer( aPlayer, - GTUtility.trans("200.1", "Automatic Item Shuffling: "), + GTUtility.trans("200.1", "Automatic Item Shuffling: "), disableSort ? GTUtility.trans("087", "Disabled") : GTUtility.trans("088", "Enabled")); return true; } else { 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 c72ce43506c..8fbb0dc5b5b 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 @@ -9,7 +9,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map.Entry; -import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.function.BiConsumer; @@ -817,7 +816,8 @@ public boolean resetRecipeMapForHatch(MTEHatch aTileEntity, RecipeMap aMap) { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { clearRecipeMapForAllInputHatches(); mLastRecipe = null; resetRecipeMapForAllInputHatches(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java index 2b609114f56..08fbae67215 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/MTETransformerHiAmp.java @@ -108,7 +108,8 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { this.mHalfMode = !mHalfMode; if (this.mHalfMode) { PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 2A:8A in/out Ratio."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java index 4725c1135d8..a04b2d68240 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java @@ -253,8 +253,10 @@ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final } @Override - public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ, ItemStack tool) { - if (aPlayer.getUniqueID().equals(this.mOwner)) { + public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, + final float aY, final float aZ, ItemStack tool) { + if (aPlayer.getUniqueID() + .equals(this.mOwner)) { if (side == this.getBaseMetaTileEntity() .getFrontFacing()) { final float[] tCoords = GTUtility.getClickedFacingCoords(side, aX, aY, aZ); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java index f59976f2141..f4318be1017 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java @@ -209,9 +209,12 @@ public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final } @Override - public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ, ItemStack tool) { - if (aPlayer.getUniqueID().equals(this.mOwner)) { - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { + public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPlayer aPlayer, final float aX, + final float aY, final float aZ, ItemStack tool) { + if (aPlayer.getUniqueID() + .equals(this.mOwner)) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { final float[] tCoords = GTUtility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> { @@ -247,9 +250,7 @@ public boolean onScrewdriverRightClick(final ForgeDirection side, final EntityPl aPlayer, "Frequency: ", this.mFrequency, - this.getTesseract(this.mFrequency, false) == null - ? "" - : EnumChatFormatting.GREEN + " (Connected)"); + this.getTesseract(this.mFrequency, false) == null ? "" : EnumChatFormatting.GREEN + " (Connected)"); } return true; } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java index 01895999fce..257f7b65ea6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java @@ -6,7 +6,6 @@ import java.util.Arrays; import java.util.Collections; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java index de638d6c184..b4ae366cffa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java @@ -120,7 +120,8 @@ public ITexture[] getSidesActive(final byte aColor) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (pollutionMultiplier > 99) { pollutionMultiplier = 1; } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java index f62010e5f6a..40cbb1897ec 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java @@ -455,8 +455,10 @@ public int getAveragePollutionOverLastTen() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (side == this.getBaseMetaTileEntity().getFrontFacing()) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { + if (side == this.getBaseMetaTileEntity() + .getFrontFacing()) { final float[] tCoords = GTUtility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0 -> this.mRedstoneLevel -= 5000; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java index abf3dc01942..6e8baf1d78f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEWirelessCharger.java @@ -150,7 +150,8 @@ public ITexture[] getSidesActive(final byte aColor) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { mLocked = !mLocked; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java index d295508bf1f..398d57ba2cd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java @@ -16,7 +16,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; @@ -24,7 +23,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -43,7 +41,6 @@ import gregtech.api.util.MultiblockTooltipBuilder; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.config.Configuration; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import mcp.mobius.waila.api.IWailaConfigHandler; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java index d7f2d1a8fca..536491ee708 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java @@ -18,7 +18,6 @@ import javax.annotation.Nonnull; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -27,7 +26,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -50,7 +48,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.lib.GTPPCore; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import mcp.mobius.waila.api.IWailaConfigHandler; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java index eaef1910b89..a0a231117b4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java @@ -12,11 +12,8 @@ import static gregtech.api.enums.HatchElement.OutputHatch; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java index 2647cf7c018..b7a28768ee4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java @@ -22,7 +22,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -30,7 +29,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -65,7 +63,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.lib.GTPPCore; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSolidifier; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java index f0c4da7fe86..92b185fc65d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java @@ -16,7 +16,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; @@ -24,7 +23,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -44,7 +42,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.lib.GTPPCore; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import mcp.mobius.waila.api.IWailaConfigHandler; @@ -227,7 +224,7 @@ public void setMachineModeIcons() { public String getMachineModeName() { return StatCollector.translateToLocal("GT5U.GTPP_MULTI_INDUSTRIAL_PLATE_PRESS.mode." + machineMode); } - + @Override public int nextMachineMode() { return machineMode == 0 ? 1 : 0; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java index d4687671185..3fcdae7335b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java @@ -22,7 +22,6 @@ import javax.annotation.Nonnull; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -32,7 +31,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -66,7 +64,6 @@ import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import ic2.core.init.BlocksItems; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java index 6c9e5ac857c..1f88fa2a21c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java @@ -11,11 +11,8 @@ import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java index 2dec362f81f..3fa5f7c0521 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java @@ -18,14 +18,11 @@ import java.util.ArrayList; import java.util.Objects; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java index 64679a64632..eae3bb8b844 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java @@ -12,12 +12,9 @@ import static gregtech.api.enums.HatchElement.OutputHatch; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java index 81ac94f15b3..f8755c181a1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java @@ -713,7 +713,8 @@ private int[] getOutputChances(GTRecipe tRecipe, int aChanceIncreased) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { mFluidMode = !mFluidMode; GTUtility.sendChatToPlayer( aPlayer, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java index b916d107726..f67205677e9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTESolarTower.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; 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 f4d62dc99d5..c1988508e0a 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 @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java index bf0aa16052e..abe5640555c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java @@ -700,9 +700,8 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public boolean onModeChangeByScrewdriver(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { looseFit ^= true; - GTUtility.sendChatToPlayer( - aPlayer, - looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); + GTUtility + .sendChatToPlayer(aPlayer, looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java index 4d1d790893a..56990e91a40 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneButtonPanel.java @@ -135,7 +135,8 @@ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 3); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java index 068fda72e73..928a629645d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthDisplay.java @@ -69,7 +69,8 @@ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 6); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java index a0e06b68cc6..1fc2722c1e9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/MTERedstoneStrengthScale.java @@ -36,7 +36,8 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (side == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 2); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java index d9b4d79097f..9fa7cab7a30 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java @@ -423,7 +423,8 @@ public void setItemNBT(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { byte aTest = (byte) (aCurrentOutputAmperage + 1); if (aTest > 16 || aTest <= 0) { aTest = 1; diff --git a/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java b/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java index b2b1b47371b..b7566c2d323 100644 --- a/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java +++ b/src/main/java/kekztech/common/tileentities/MTELapotronicSuperCapacitor.java @@ -1102,7 +1102,8 @@ protected boolean canUseWireless() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (canUseWireless()) { wireless_mode = !wireless_mode; GTUtility.sendChatToPlayer(aPlayer, "Wireless network mode " + (wireless_mode ? "enabled." : "disabled.")); diff --git a/src/main/java/kekztech/common/tileentities/MTETankTFFT.java b/src/main/java/kekztech/common/tileentities/MTETankTFFT.java index 7e60b325aa5..c77e551213a 100644 --- a/src/main/java/kekztech/common/tileentities/MTETankTFFT.java +++ b/src/main/java/kekztech/common/tileentities/MTETankTFFT.java @@ -609,7 +609,8 @@ public boolean explodesOnComponentBreak(ItemStack stack) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { this.setDoVoidExcess(!doVoidExcess); GTUtility.sendChatToPlayer(aPlayer, "Auto-voiding " + (this.doVoidExcess ? "enabled" : "disabled")); return true; diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index 6509dcfb1d1..12848fce722 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -392,7 +392,8 @@ public void HandleCustomPacket(CustomTileEntityPacket message) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "Can't change mode when running !"); return false; @@ -418,7 +419,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer } @Override - public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, + float aX, float aY, float aZ, ItemStack tool) { if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { mAnimationEnabled = !mAnimationEnabled; GTUtility.sendChatToPlayer(aPlayer, "Animations are " + (mAnimationEnabled ? "enabled" : "disabled")); diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java index 0030bf3e1ec..05dfce9193b 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java @@ -374,7 +374,8 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (this.mMaxProgresstime > 0) { GTUtility.sendChatToPlayer(aPlayer, "Can't change mode when running !"); return false; diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java index 8374e4e061c..dfd3119655a 100644 --- a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java @@ -155,7 +155,8 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack aTool) { GTUIInfos.openGTTileEntityUI(this.getBaseMetaTileEntity(), aPlayer); return true; } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java index 6e47f81df8e..e479e07f7e9 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java @@ -248,7 +248,8 @@ public final boolean addDataBankHatchToMachineList(IGregTechTileEntity aTileEnti } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { wirelessModeEnabled = !wirelessModeEnabled; if (wirelessModeEnabled) { diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index bb2f2c943fd..2b16fee63be 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -934,7 +934,8 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac private boolean animationsEnabled = true; @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { animationsEnabled = !animationsEnabled; aPlayer.addChatMessage( new ChatComponentText("Animations are now " + (animationsEnabled ? "enabled" : "disabled") + ".")); diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java index ffff95c07f8..f3d05d4e323 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java @@ -702,7 +702,8 @@ private void buildThirdRing() { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { if (!ConfigHandler.debug.DEBUG_MODE) return false; if (isRenderActive) { destroyRenderer(); diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java index 38f8487e6ef..9f9b743f785 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java @@ -399,7 +399,8 @@ public MultiblockTooltipBuilder createTooltip() { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (getBaseMetaTileEntity().isServerSide()) { wirelessModeEnabled = !wirelessModeEnabled; if (wirelessModeEnabled) { diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java index 4e7f60dfe06..db1ffcbf270 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java @@ -551,7 +551,8 @@ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlaye } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { switch (machineType) { case scanner -> machineType = assembly; case assembly -> machineType = scanner; diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java index 903b5cc5dc3..1486e0393be 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java @@ -12,7 +12,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizons.modularui.api.NumberFormatMUI; @@ -81,7 +80,8 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { } @Override - public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, + float aZ, ItemStack tool) { LASER = !LASER; GTUtility.sendLocalizedChatToPlayer(aPlayer, "tt.chat.debug.generator", LASER ? "ON" : "OFF"); return true; diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java index 70e409acd00..666b08baa37 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java @@ -151,7 +151,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); String pseudoJavaCode = StructureUtility.getPseudoJavaCode( diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java index 794ee06116f..878b9153cd9 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java @@ -135,7 +135,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { String clientLocale; try { EntityPlayerMP player = (EntityPlayerMP) aPlayer; diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java index af124a6fb23..662dc1cd039 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java @@ -105,7 +105,8 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre } @Override - public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { + public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, + ItemStack tool) { if (aPlayer.isSneaking()) { if (histSettingHigh < histHighLimit) { histSettingHigh++; From 752b6a0c5fb0703871371ef92cd71629f681c8b4 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Tue, 24 Sep 2024 23:02:27 -0400 Subject: [PATCH 3/5] fix industrial laser engraver batch mode --- .../multi/MTEIndustrialLaserEngraver.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java index e4be90ecbb2..ea683af5740 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java @@ -211,12 +211,17 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { - if (renderer != null) { - renderer.realism = !renderer.realism; - PlayerUtils.messagePlayer(aPlayer, "Toggling realism!"); - return true; + if (aPlayer.isSneaking()) { + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); + } else { + if (renderer != null) { + renderer.realism = !renderer.realism; + PlayerUtils.messagePlayer(aPlayer, "Toggling realism!"); + return true; + } else { + return false; + } } - return false; } @Override From 1878bf268cfef4141b353d402179f2fbf20ebe4c Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Tue, 24 Sep 2024 23:24:31 -0400 Subject: [PATCH 4/5] fixed batch mode for the PA --- .../implementations/MTEMultiBlockBase.java | 2 +- .../machines/multi/MTEProcessingArray.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index 8f4111fb331..91f86d3b50a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -250,7 +250,7 @@ public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, } return true; } else { - // don't do any allow i/o because controllers can't interact with pipes + // don't do any "allow input"/"allow output" changes because controllers can't interact with pipes return false; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java index 9724c15a675..d51330b74da 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java @@ -348,13 +348,13 @@ public void loadNBTData(final NBTTagCompound aNBT) { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (!aPlayer.isSneaking()) { - downtierUEV = !downtierUEV; - GTUtility.sendChatToPlayer(aPlayer, "Treat UEV+ machines as multiple UHV " + downtierUEV); + if (aPlayer.isSneaking() && super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool)) { return true; - } else { - return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } + + downtierUEV = !downtierUEV; + GTUtility.sendChatToPlayer(aPlayer, "Treat UEV+ machines as multiple UHV " + downtierUEV); + return true; } @Override From 397b81b1cf12e335deeab41156b7da5552a23878 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Wed, 25 Sep 2024 15:44:32 -0400 Subject: [PATCH 5/5] change multi actions to require sneaking --- .../blocks/tileEntity/MTEYottaFluidTank.java | 4 +- .../metatileentity/BaseMetaPipeEntity.java | 8 ---- .../metatileentity/BaseMetaTileEntity.java | 8 ---- .../api/metatileentity/MetaTileEntity.java | 35 +++++++++-------- .../implementations/MTECable.java | 6 +-- .../implementations/MTEMultiBlockBase.java | 12 +++--- .../java/gregtech/api/util/GTUtility.java | 12 +----- .../gregtech/common/blocks/BlockMachines.java | 8 +--- .../machines/multi/MTEDrillerBase.java | 4 +- .../multi/MTEIndustrialLaserEngraver.java | 5 +-- .../multi/MTEOreDrillingPlantBase.java | 9 +++-- .../machines/multi/MTEProcessingArray.java | 9 ++--- .../multiblock/MTEExtremeEntityCrusher.java | 5 +-- .../MTEExtremeIndustrialGreenhouse.java | 8 +++- .../metaTileEntity/multi/MTEEyeOfHarmony.java | 39 ++++++++++++------- .../metaTileEntity/single/MTETeslaCoil.java | 22 ++++++----- 16 files changed, 91 insertions(+), 103 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java index 38345497a7b..c342be5f37b 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEYottaFluidTank.java @@ -564,7 +564,7 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack toolStack) { - if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + if (!aPlayer.isSneaking() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { voidExcessEnabled ^= true; aPlayer.addChatMessage( new ChatComponentTranslation( @@ -577,7 +577,7 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack toolStack) { - if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + if (!aPlayer.isSneaking() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { if (mLockedFluid == null) { if (mFluid != null) { mLockedFluid = mFluid; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 5a820804128..88c5082585e 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -816,9 +816,6 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo ToolType tool = ToolType.getToolType(tCurrentItem); - // don't use the water if there's no colour - if (tool == ToolType.DyeEraser && getColorization() < 0) tool = null; - if (tool != null) { boolean usedTool = false; @@ -830,11 +827,6 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo } break; } - case DyeEraser: { - setColorization((byte) (getColorization() >= 16 ? -2 : -1)); - usedTool = true; - break; - } case HardHammer: { usedTool = mMetaTileEntity.onHardHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); break; diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 0733e647780..f288ab5fe27 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -1506,9 +1506,6 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo ToolType tool = ToolType.getToolType(tCurrentItem); - // don't use the water if there's no colour - if (tool == ToolType.DyeEraser && getColorization() < 0) tool = null; - if (tool != null) { boolean usedTool = false; @@ -1520,11 +1517,6 @@ public boolean onRightclick(EntityPlayer aPlayer, final ForgeDirection side, flo } break; } - case DyeEraser: { - setColorization((byte) (getColorization() >= 16 ? -2 : -1)); - usedTool = true; - break; - } case HardHammer: { usedTool = mMetaTileEntity.onHardHammerRightClick(coverSide, aPlayer, aX, aY, aZ, tCurrentItem); break; diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 6a6e0f05f0e..4654e2725f5 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -245,14 +245,15 @@ public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingS @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { - if (!aPlayer.isSneaking()) return false; - final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); - final TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); - if ((tTileEntity instanceof IGregTechTileEntity gtTE) && (gtTE.getMetaTileEntity() instanceof MTECable)) { - - // The tile entity we're facing is a cable, let's try to connect to it - return gtTE.getMetaTileEntity() - .onWireCutterRightClick(wrenchingSide, oppositeSide, aPlayer, aX, aY, aZ, aTool); + if (aPlayer.isSneaking()) { + final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); + final TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); + if ((tTileEntity instanceof IGregTechTileEntity gtTE) && (gtTE.getMetaTileEntity() instanceof MTECable)) { + + // The tile entity we're facing is a cable, let's try to connect to it + return gtTE.getMetaTileEntity() + .onWireCutterRightClick(wrenchingSide, oppositeSide, aPlayer, aX, aY, aZ, aTool); + } } return false; } @@ -260,15 +261,15 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { - - if (!aPlayer.isSneaking()) return false; - final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); - TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); - if ((tTileEntity instanceof IGregTechTileEntity gtTE) && (gtTE.getMetaTileEntity() instanceof MTECable)) { - - // The tile entity we're facing is a cable, let's try to connect to it - return gtTE.getMetaTileEntity() - .onSolderingToolRightClick(wrenchingSide, oppositeSide, aPlayer, aX, aY, aZ, aTool); + if (aPlayer.isSneaking()) { + final ForgeDirection oppositeSide = wrenchingSide.getOpposite(); + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(wrenchingSide); + if ((tTileEntity instanceof IGregTechTileEntity gtTE) && (gtTE.getMetaTileEntity() instanceof MTECable)) { + + // The tile entity we're facing is a cable, let's try to connect to it + return gtTE.getMetaTileEntity() + .onSolderingToolRightClick(wrenchingSide, oppositeSide, aPlayer, aX, aY, aZ, aTool); + } } return false; } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java b/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java index 481798b7362..1e15974851b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTECable.java @@ -267,8 +267,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (GTMod.gregtechproxy.gt6Cable - && GTModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { + if (GTMod.gregtechproxy.gt6Cable) { if (isConnectedAtSide(wrenchingSide)) { disconnect(wrenchingSide); GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("215", "Disconnected")); @@ -284,8 +283,7 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (GTMod.gregtechproxy.gt6Cable - && GTModHandler.damageOrDechargeItem(aPlayer.inventory.getCurrentItem(), 1, 500, aPlayer)) { + if (GTMod.gregtechproxy.gt6Cable) { if (isConnectedAtSide(wrenchingSide)) { disconnect(wrenchingSide); GTUtility.sendChatToPlayer(aPlayer, GTUtility.trans("215", "Disconnected")); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index 91f86d3b50a..3ea28124dad 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -208,7 +208,8 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (supportsVoidProtection() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + if (aPlayer.isSneaking() && supportsVoidProtection() + && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { Set allowed = getAllowedVoidingModes(); setVoidingMode(getVoidingMode().nextInCollection(allowed)); GTUtility.sendChatToPlayer( @@ -217,15 +218,14 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre " ", StatCollector.translateToLocal(getVoidingMode().getTransKey())); return true; - } else { - return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } + return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (supportsBatchMode() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + if (aPlayer.isSneaking() && supportsBatchMode() && wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { batchMode = !batchMode; if (batchMode) { GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.batchMode.on"); @@ -241,7 +241,7 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench @Override public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (supportsInputSeparation() && side == getBaseMetaTileEntity().getFrontFacing()) { + if (aPlayer.isSneaking() && supportsInputSeparation() && side == getBaseMetaTileEntity().getFrontFacing()) { this.inputSeparation = !this.inputSeparation; if (inputSeparation) { GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.separateInputs.on"); @@ -258,7 +258,7 @@ public boolean onHardHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, @Override public boolean onJackHammerRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (supportsSingleRecipeLocking()) { + if (aPlayer.isSneaking() && supportsSingleRecipeLocking()) { mLockedToSingleRecipe = !mLockedToSingleRecipe; if (mLockedToSingleRecipe) { GTUtility.sendLocalizedChatToPlayer(aPlayer, "GT5U.machines.recipeLock.on"); diff --git a/src/main/java/gregtech/api/util/GTUtility.java b/src/main/java/gregtech/api/util/GTUtility.java index 911e74052c0..112fd8e391f 100644 --- a/src/main/java/gregtech/api/util/GTUtility.java +++ b/src/main/java/gregtech/api/util/GTUtility.java @@ -1809,7 +1809,6 @@ public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, public static enum ToolType { - DyeEraser(null, null), // water bucket Wrench(SoundResource.IC2_TOOLS_WRENCH, GregTechAPI.sWrenchList), Screwdriver(SoundResource.IC2_TOOLS_WRENCH, GregTechAPI.sScrewdriverList), HardHammer(SoundResource.RANDOM_ANVIL_USE, GregTechAPI.sHardHammerList), @@ -1836,21 +1835,14 @@ private ToolType(SoundResource useSound, GTHashSet toolList) { * @return True if the tool had power or didn't need it. */ public boolean onUse(EntityPlayer player) { - final ItemStack tool = player.inventory.getCurrentItem(); + if (player.capabilities.isCreativeMode) return true; - if (this == DyeEraser) { - tool.func_150996_a(Items.bucket); - return true; - } + final ItemStack tool = player.inventory.getCurrentItem(); return GTModHandler.damageOrDechargeItem(tool, 1, 1000, player); } public static @Nullable ToolType getToolType(ItemStack heldItem) { - if (areStacksEqual(new ItemStack(Items.water_bucket, 1), heldItem)) { - return DyeEraser; - } - for (ToolType tool : TOOL_TYPES) { if (tool.toolList != null && isStackInList(heldItem, tool.toolList)) { return tool; diff --git a/src/main/java/gregtech/common/blocks/BlockMachines.java b/src/main/java/gregtech/common/blocks/BlockMachines.java index 4c392f8cf54..754d163d874 100644 --- a/src/main/java/gregtech/common/blocks/BlockMachines.java +++ b/src/main/java/gregtech/common/blocks/BlockMachines.java @@ -49,7 +49,7 @@ import gregtech.api.metatileentity.CoverableTileEntity; import gregtech.api.util.GTBaseCrop; import gregtech.api.util.GTLog; -import gregtech.api.util.GTUtility; +import gregtech.api.util.GTUtility.ToolType; import gregtech.common.covers.CoverInfo; import gregtech.common.render.GTRendererBlock; import gregtech.common.tileentities.storage.MTEQuantumChest; @@ -363,11 +363,7 @@ public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlay final ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (aPlayer.isSneaking()) { - if (tCurrentItem != null && !GTUtility.isStackInList(tCurrentItem, GregTechAPI.sScrewdriverList) - && !GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWrenchList) - && !GTUtility.isStackInList(tCurrentItem, GregTechAPI.sWireCutterList) - && !GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList) - && !GTUtility.isStackInList(tCurrentItem, GregTechAPI.sJackhammerList)) return false; + if (ToolType.getToolType(tCurrentItem) == null) return false; } final ForgeDirection side = ForgeDirection.getOrientation(ordinalSide); 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 1290f2cd151..ac61be463b2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEDrillerBase.java @@ -258,7 +258,7 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer entityPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (side == getBaseMetaTileEntity().getFrontFacing()) { + if (!entityPlayer.isSneaking() && side == getBaseMetaTileEntity().getFrontFacing()) { mChunkLoadingEnabled = !mChunkLoadingEnabled; GTUtility.sendChatToPlayer( entityPlayer, @@ -266,7 +266,7 @@ public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wre : GTUtility.trans("503", "Mining chunk loading disabled")); return true; } - return true; + return super.onSolderingToolRightClick(side, wrenchingSide, entityPlayer, aX, aY, aZ, tool); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java index ea683af5740..a9e42f34bef 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialLaserEngraver.java @@ -211,9 +211,7 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { - if (aPlayer.isSneaking()) { - return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); - } else { + if (!aPlayer.isSneaking()) { if (renderer != null) { renderer.realism = !renderer.realism; PlayerUtils.messagePlayer(aPlayer, "Toggling realism!"); @@ -222,6 +220,7 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench return false; } } + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java index 8ae0efa32c6..0ef4172c028 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOreDrillingPlantBase.java @@ -161,9 +161,12 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - replaceWithCobblestone = !replaceWithCobblestone; - GTUtility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone); - return true; + if (!aPlayer.isSneaking()) { + replaceWithCobblestone = !replaceWithCobblestone; + GTUtility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone); + return true; + } + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java index d51330b74da..40f96b4e2f9 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEProcessingArray.java @@ -348,13 +348,12 @@ public void loadNBTData(final NBTTagCompound aNBT) { @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (aPlayer.isSneaking() && super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool)) { + if (!aPlayer.isSneaking()) { + downtierUEV = !downtierUEV; + GTUtility.sendChatToPlayer(aPlayer, "Treat UEV+ machines as multiple UHV " + downtierUEV); return true; } - - downtierUEV = !downtierUEV; - GTUtility.sendChatToPlayer(aPlayer, "Treat UEV+ machines as multiple UHV " + downtierUEV); - return true; + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } @Override diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index 12848fce722..0508f47ed0d 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -421,13 +421,12 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (wrenchingSide == getBaseMetaTileEntity().getFrontFacing()) { + if (!aPlayer.isSneaking() && 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, tool); } + return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } @SuppressWarnings("unused") diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java index d9c466ae3fc..15dd51288cd 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeIndustrialGreenhouse.java @@ -441,8 +441,12 @@ public boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { - this.tryChangeHumidityMode(aPlayer); - return true; + if (!aPlayer.isSneaking()) { + this.tryChangeHumidityMode(aPlayer); + return true; + } + + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); } // endregion tool interactions diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index 2b16fee63be..22dbb2c2154 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -936,30 +936,39 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac @Override public final boolean onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - animationsEnabled = !animationsEnabled; - aPlayer.addChatMessage( - new ChatComponentText("Animations are now " + (animationsEnabled ? "enabled" : "disabled") + ".")); - return true; + if (!aPlayer.isSneaking()) { + animationsEnabled = !animationsEnabled; + aPlayer.addChatMessage( + new ChatComponentText("Animations are now " + (animationsEnabled ? "enabled" : "disabled") + ".")); + return true; + } + + return super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ, tool); } @Override public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack aTool) { - if (astralArrayAmount != 0) { - while (astralArrayAmount >= 64) { + if (!aPlayer.isSneaking()) { + if (astralArrayAmount != 0) { + while (astralArrayAmount >= 64) { + if (aPlayer.inventory.getFirstEmptyStack() != -1) { + aPlayer.inventory.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(64)); + astralArrayAmount -= 64; + } else { + break; + } + } if (aPlayer.inventory.getFirstEmptyStack() != -1) { - aPlayer.inventory.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(64)); - astralArrayAmount -= 64; - } else { - break; + aPlayer.inventory + .addItemStackToInventory(CustomItemList.astralArrayFabricator.get(astralArrayAmount)); + astralArrayAmount = 0; } } - if (aPlayer.inventory.getFirstEmptyStack() != -1) { - aPlayer.inventory.addItemStackToInventory(CustomItemList.astralArrayFabricator.get(astralArrayAmount)); - astralArrayAmount = 0; - } + return true; } - return true; + + return super.onWireCutterRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, aTool); } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java index 662dc1cd039..3895e882c9d 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java @@ -92,16 +92,20 @@ public String[] getDescription() { @Override public boolean onSolderingToolRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ, ItemStack tool) { - if (overdriveToggle) { - overdriveToggle = false; - PlayerChatHelper - .SendInfo(aPlayer, translateToLocalFormatted("tt.keyphrase.Overdrive_disengaged", clientLocale)); - } else { - overdriveToggle = true; - PlayerChatHelper - .SendInfo(aPlayer, translateToLocalFormatted("tt.keyphrase.Overdrive_engaged", clientLocale)); + if (!aPlayer.isSneaking()) { + if (overdriveToggle) { + overdriveToggle = false; + PlayerChatHelper + .SendInfo(aPlayer, translateToLocalFormatted("tt.keyphrase.Overdrive_disengaged", clientLocale)); + } else { + overdriveToggle = true; + PlayerChatHelper + .SendInfo(aPlayer, translateToLocalFormatted("tt.keyphrase.Overdrive_engaged", clientLocale)); + } + return true; } - return true; + + return super.onSolderingToolRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ, tool); } @Override