diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-10 09:51:39 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-10 09:51:39 +0000 |
commit | cf938c1ed77f873782e2c2c4869947562236b7b3 (patch) | |
tree | cc7aa78ef92b263b3d8a4ffaec6c10ee603f889f /src/Java/gtPlusPlus/xmod/gregtech/api | |
parent | 8f6560f3c2cfaa36f57d3220a72fbb931fb9324d (diff) | |
download | GT5-Unofficial-cf938c1ed77f873782e2c2c4869947562236b7b3.tar.gz GT5-Unofficial-cf938c1ed77f873782e2c2c4869947562236b7b3.tar.bz2 GT5-Unofficial-cf938c1ed77f873782e2c2c4869947562236b7b3.zip |
Added ability to clear all output hatches on GT++ multis with a plunger.
Changed fluid textures for many autogenerated fluids.
Renamed & remapped Cryolite to Cryolite (F).
Fixed toArray() in AutoMap.java.
Fixed Sparging.
Final touches to Nuclear Fuel reprocessing.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 3878583b60..9aff009ec5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -7,6 +7,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.IToolStats; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; @@ -30,6 +31,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.asm.AsmConfig; @@ -51,6 +53,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import org.apache.commons.lang3.ArrayUtils; import java.lang.reflect.InvocationTargetException; @@ -2392,20 +2396,43 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { - //Do Super - boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); // Do Things if (this.getBaseMetaTileEntity().isServerSide()) { + //Logger.INFO("Right Clicked Controller."); ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { - - } + if (tCurrentItem != null) { + //Logger.INFO("Holding Item."); + if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) { + //Logger.INFO("Is GT_MetaGenerated_Tool."); + int[] aOreID = OreDictionary.getOreIDs(tCurrentItem); + for (int id : aOreID) { + // Plunger + if (OreDictionary.getOreName(id).equals("craftingToolPlunger")) { + //Logger.INFO("Is Plunger."); + return onPlungerRightClick(aPlayer, aSide, aX, aY, aZ); + } + } + } } } + //Do Super + boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); return aSuper; } + public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + int aHatchIndex = 0; + PlayerUtils.messagePlayer(aPlayer, "Trying to clear "+mOutputHatches.size()+" output hatches."); + for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) { + if (hatch.mFluid != null) { + PlayerUtils.messagePlayer(aPlayer, "Clearing "+hatch.mFluid.amount+"L of "+hatch.mFluid.getLocalizedName()+" from hatch "+aHatchIndex+"."); + hatch.mFluid = null; + } + aHatchIndex++; + } + return aHatchIndex > 0; + } + @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { boolean tSuper = super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); |