diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-11-24 19:05:01 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-11-24 19:05:01 +0000 |
commit | 7fbe8a8aae1cc923ec4a0a9f5b7075d30568d94c (patch) | |
tree | ce63946389a6879fed9638707995af45bcaccdd1 /src/Java/gtPlusPlus/xmod/gregtech | |
parent | f3a698a3af1826ef6f5ac719d31334b930e0005e (diff) | |
download | GT5-Unofficial-7fbe8a8aae1cc923ec4a0a9f5b7075d30568d94c.tar.gz GT5-Unofficial-7fbe8a8aae1cc923ec4a0a9f5b7075d30568d94c.tar.bz2 GT5-Unofficial-7fbe8a8aae1cc923ec4a0a9f5b7075d30568d94c.zip |
+ Added recipe for Supreme Pizza Gloves.
+ Added Turbine Housing.
+ Added recipe for Turbine Housing.
+ Added auto-output behaviour to Super Bus (O), borrowed from GTNH. Closes #576.
% Adjusted Multiblock base checkRecipe function to hopefully now use 2A per energy hatch. (This was done last commit, but was never mentioned)
$ Fixed missing Recipe for Cloaking Device.
$ Fixed Selenium Exploit. Closes #570.
$ Potentially fixed weird cape crash.
$ Added additional logging for TT recipe adding.
$ Did some work on ToggleSneak stuff in Sneak Manager. Fixes #566.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
9 files changed, 267 insertions, 7 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 588c04d7e5..3ea2851a85 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -343,6 +343,9 @@ public enum GregtechItemList implements GregtechItemContainer { //XL Turbine Rotor Hatch Hatch_Turbine_Rotor, + //Standard Turbine Rotor Hatch + Hatch_Input_TurbineHousing, + //Control Core Hatch_Control_Core, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java index d4d2fcacd7..e6203823b6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java @@ -36,11 +36,11 @@ public class CONTAINER_1by1_Turbine extends GT_Container_1by1 { } @Override public boolean isItemValid(final ItemStack itemstack) { - /*if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) { + if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) { if (itemstack.getItemDamage() >= 170 && itemstack.getItemDamage() <= 176) { return true; } - }*/ + } return false; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java new file mode 100644 index 0000000000..d9e2692b09 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java @@ -0,0 +1,212 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.sys.KeyboardUtils; +import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_1by1_Turbine; +import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_1by1_Turbine; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_Hatch_InputBus { + + public GT_MetaTileEntity_Hatch_TurbineProvider(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Housing"); + } + + @Override + public String[] getDescription() { + return new String[]{ + "An automation port for Large Turbines", "Will attempt once per 1200 ticks to fill the turbine slot of it's parent turbine", "You may adjust this with a screwdriver", "Hold shift to adjust in finer amounts", "Hold control to adjust direction", "Left Click with Screwdriver to reset", "This module assumes the entire turbine is in the same Chunk"}; + } + + + private GT_MetaTileEntity_LargeTurbine mParent = null; + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + super.onPostTick(aBaseMetaTileEntity, aTimer); + if (aTimer % mRefreshTime == 0 && this.getBaseMetaTileEntity().isServerSide()) { + tryRefillTurbine(); + } + } + + private final void tryFindParentTurbine() { + Logger.INFO("This turbine housing has no parent, searching world."); + IGregTechTileEntity T = this.getBaseMetaTileEntity(); + World W = T.getWorld(); + Chunk C = W.getChunkFromBlockCoords(T.getXCoord(), T.getZCoord()); + for (Object o : C.chunkTileEntityMap.values()) { + if (o instanceof IGregTechTileEntity) { + IGregTechTileEntity G = (IGregTechTileEntity) o; + final IMetaTileEntity aMetaTileEntity = G.getMetaTileEntity(); + if (aMetaTileEntity == null) { + continue; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine) { + GT_MetaTileEntity_LargeTurbine aTurb = (GT_MetaTileEntity_LargeTurbine) aMetaTileEntity; + for (GT_MetaTileEntity_Hatch_InputBus ee : aTurb.mInputBusses) { + if (ee.equals(this)) { + mParent = aTurb; + Logger.INFO("Found a Parent to attach to this housing."); + return; + } + } + } + } + } + } + + private final void tryRefillTurbine() { + if (mParent == null) { + tryFindParentTurbine(); + } + if (mParent != null && mParent.mInventory[1] == null) { + for (ItemStack aStack : this.mInventory) { + if (isItemStackTurbine(aStack)) { + setGUIItemStack(aStack); + } + } + } + } + + protected boolean setGUIItemStack(ItemStack aNewGuiSlotContents) { + boolean result = false; + if (mParent.mInventory[1] == null) { + mParent.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null; + mParent.depleteInput(aNewGuiSlotContents); + mParent.updateSlots(); + this.updateSlots(); + result = true; + } + return result; + } + + public boolean isItemStackTurbine(ItemStack aStack) { + if (aStack.getItem() instanceof GT_MetaGenerated_Tool) { + if (aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176) { + return true; + } + } + return false; + } + + public boolean isItemStackScrewdriver(ItemStack aStack) { + if (aStack.getItem() instanceof GT_MetaGenerated_Tool) { + if (aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150) { + return true; + } + } + return false; + } + + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return isItemStackTurbine(aStack); + } + + private int mRefreshTime = 1200; + private boolean mDescending = true; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mRefreshTime", mRefreshTime); + aNBT.setBoolean("mDescending", mDescending); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mRefreshTime = aNBT.getInteger("mRefreshTime"); + mDescending = aNBT.getBoolean("mDescending"); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer != null) { + if (KeyboardUtils.isCtrlKeyDown()) { + mDescending = Utils.invertBoolean(mDescending); + PlayerUtils.messagePlayer(aPlayer, "Direction: "+(mDescending ? "DOWN" : "UP")); + } + else { + int aAmount = 0; + if (KeyboardUtils.isShiftKeyDown()) { + aAmount = 10; + } + else { + aAmount = 100; + } + if (mDescending) { + mRefreshTime -= aAmount; + if (mRefreshTime < 0) { + mRefreshTime = 1200; + } + } + else { + mRefreshTime += aAmount; + if (mRefreshTime > 1200) { + mRefreshTime = 0; + } + } + PlayerUtils.messagePlayer(aPlayer, "Set check time to be every "+mRefreshTime+" ticks."); + } + } + } + + @Override + public void onLeftclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + boolean aDidScrewdriver = false; + if (aPlayer != null) { + if (aPlayer.getHeldItem() != null) { + if (isItemStackScrewdriver(aPlayer.getHeldItem())) { + aDidScrewdriver = true; + mRefreshTime = 1200; + PlayerUtils.messagePlayer(aPlayer, "Reset check time to "+mRefreshTime+" ticks."); + } + } + } + if (!aDidScrewdriver) { + super.onLeftclick(aBaseMetaTileEntity, aPlayer); + } + } + + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java index 3afa3312b1..cca5a39de3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java @@ -58,7 +58,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { this.fillStacksIntoFirstSlots(); } - + super.onPostTick(aBaseMetaTileEntity, aTimer); } public void updateSlots() { 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 2e50d12aca..e5d7f58dc6 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 @@ -1573,7 +1573,7 @@ GT_MetaTileEntity_MultiBlockBase { boolean result = false; if (this.mInventory[1] == null) { this.mInventory[1] = aNewGuiSlotContents != null ? aNewGuiSlotContents.copy() : null; - aNewGuiSlotContents = null; + this.depleteInput(aNewGuiSlotContents); this.updateSlots(); result = true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java index 763a4a129d..6201a782de 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java @@ -63,7 +63,6 @@ public class GTPP_CapeRenderer extends RenderPlayer { private final ArrayList<String> mData; public GTPP_CapeRenderer() { - setRenderManager(RenderManager.instance); downloadCapeList(); ArrayList<String> aTemp = new ArrayList<String>(); try { @@ -76,10 +75,19 @@ public class GTPP_CapeRenderer extends RenderPlayer { } private static boolean hasResourceChecked = false; + private static boolean hasSetRenderer = false; private boolean hasCape = false; private ResourceLocation tResource = null; public synchronized void receiveRenderSpecialsEvent(RenderPlayerEvent.Specials.Pre aEvent) { + if (this.renderManager == null) { + hasSetRenderer = false; + } + if (!hasSetRenderer) { + if (RenderManager.instance != null) { + setRenderManager(RenderManager.instance); + } + } AbstractClientPlayer aPlayer = (AbstractClientPlayer) aEvent.entityPlayer; if (!ConfigSwitches.enableCustomCapes) { aEvent.setCanceled(true); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index c55fe10829..6e7039f8ca 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -292,7 +292,19 @@ extends GregtechMeta_MultiBlockBase @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()){ - //Utils.LOG_INFO("tick: "+aTick); + // Reload Lava Filter + if (this.getGUIItemStack() == null) { + if (this.mInputBusses.size() > 0) { + for (GT_MetaTileEntity_Hatch_InputBus aBus : this.mInputBusses) { + for (ItemStack aStack : aBus.mInventory) { + if (aStack.getItem() instanceof ItemLavaFilter) { + this.setGUIItemStack(aStack); + } + } + } + } + } + if (this.mEUt > 0){ if (aTick % 600L == 0L){ damageFilter(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index d43adb2be3..cd853dfb0d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -706,6 +706,17 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (ttTest != null) { T = ttTest; } + else { + Method[] aDump = TTRecipeAdder.getDeclaredMethods(); + for (Method m : aDump) { + if (m != null) { + Logger.INFO("Found "+m.getName()+" | "+m.getModifiers()+" | "+ArrayUtils.toString(m.getParameters(), "EMPTY")+""); + if (m.getName().toLowerCase().equals("addresearchableassemblylinerecipe")){ + Logger.INFO("Types: "+ArrayUtils.toString(m.getParameterTypes())); + } + } + } + } } } else { @@ -787,7 +798,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Logger.INFO("Failed to generate TecTech recipe for "+ItemUtils.getItemName(aResearchItem)+", please report this to Alkalus."); } catch (Throwable t) { - + t.printStackTrace(); } } return (boolean) mAssemblyLine.invoke(GT_Values.RA, aResearchItem, aResearchTime, aInputs, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index 45a23fb184..9f67363302 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -11,6 +11,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_TurbineProvider; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_SuperBus_Input; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_SuperBus_Output; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase; @@ -62,6 +63,19 @@ public class GregtechCustomHatches { "Naquadah Reactor Input hatch" // Local name ).getStackForm(1L)); + + GregtechItemList.Hatch_Input_TurbineHousing.set(new GT_MetaTileEntity_Hatch_TurbineProvider(31025, // ID + "hatch.turbine.input.tier.00", // unlocal name + "Turbine Housing", // Local name + 8 + ).getStackForm(1L)); + + + + + + + } private static void run2() { |