diff options
author | xSkewer <43712386+xSkewer@users.noreply.github.com> | 2022-11-05 14:11:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 19:11:06 +0100 |
commit | 70c04f045086fb7c91ed7087681d4f3223201094 (patch) | |
tree | 19c1d016035b7c6faa757b98a298e9711cf25b72 | |
parent | ea3c57b36173c9c92d3096cdae1dcc8f1b564a4c (diff) | |
download | GT5-Unofficial-70c04f045086fb7c91ed7087681d4f3223201094.tar.gz GT5-Unofficial-70c04f045086fb7c91ed7087681d4f3223201094.tar.bz2 GT5-Unofficial-70c04f045086fb7c91ed7087681d4f3223201094.zip |
No Humidity Mode for the EIG (#233)
* Add 0 humidity mode to the EIG
* Readd imports that got removed for some reason
* Remove static and add scanner info
* Fix NBT saving
* Add import that got lost for some reason
* Add tooltip and change scanner display to only IC2 mode
* Import got lost again
Former-commit-id: 3eb612279d4575dde0ff348c4c4a62e88b929247
-rw-r--r-- | src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index 7ab04ae24b..77260c4dad 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -84,6 +84,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse private boolean isIC2Mode = false; private byte glasTier = 0; private int waterusage = 0; + private boolean isNoHumidity = false; private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); @@ -183,6 +184,14 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } @Override + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + isNoHumidity = !isNoHumidity; + GT_Utility.sendChatToPlayer(aPlayer, "Give incoming crops no humidity " + isNoHumidity); + return true; + } + + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_TileEntity_ExtremeIndustrialGreenhouse(this.mName); } @@ -210,6 +219,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .addInfo("Grow your crops like a chad !") .addInfo("Use screwdriver to enable/change/disable setup mode") .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") + .addInfo("Use wire cutters to give incoming IC2 crops 0 humidity") .addInfo("Uses 1000L of water per crop per operation") .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") .addInfo("-------------------- SETUP MODE --------------------") @@ -269,6 +279,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse aNBT.setByte("glasTier", glasTier); aNBT.setInteger("setupphase", setupphase); aNBT.setBoolean("isIC2Mode", isIC2Mode); + aNBT.setBoolean("isNoHumidity", isNoHumidity); aNBT.setInteger("mStorageSize", mStorage.size()); for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); @@ -280,6 +291,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse glasTier = aNBT.getByte("glasTier"); setupphase = aNBT.getInteger("setupphase"); isIC2Mode = aNBT.getBoolean("isIC2Mode"); + isNoHumidity = aNBT.getBoolean("isNoHumidity"); for (int i = 0; i < aNBT.getInteger("mStorageSize"); i++) mStorage.add(new GreenHouseSlot(aNBT.getCompoundTag("mStorage." + i))); } @@ -507,7 +519,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse "Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName()); if (this.isIC2Mode) { - a.append(" : "); + a.append(" | Humidity: " + (this.mStorage.get(i).noHumidity ? 0 : 12) + " : "); for (Map.Entry<String, Double> entry : mStorage.get(i).dropprogress.entrySet()) a.append((int) (entry.getValue() * 100d)).append("% "); @@ -569,7 +581,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse g.addAll(this.getBaseMetaTileEntity().getWorld(), input); if (input.stackSize == 0) return true; } - GreenHouseSlot h = new GreenHouseSlot(this, input, true, isIC2Mode); + GreenHouseSlot h = new GreenHouseSlot(this, input, true, isIC2Mode, isNoHumidity); if (h.isValid) { mStorage.add(h); return true; @@ -585,6 +597,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse List<ItemStack> drops; boolean isValid; boolean isIC2Crop; + boolean noHumidity; int growthticks; List<List<ItemStack>> generations; @@ -622,6 +635,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse generations.get(i).get(j).writeToNBT(new NBTTagCompound())); } aNBT.setInteger("growthticks", growthticks); + aNBT.setBoolean("noHumidity", noHumidity); } return aNBT; } @@ -651,6 +665,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); } growthticks = aNBT.getInteger("growthticks"); + noHumidity = aNBT.getBoolean("noHumidity"); rn = new Random(); } } @@ -706,13 +721,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } public GreenHouseSlot( - GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2) { + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, + ItemStack input, + boolean autocraft, + boolean IC2, + boolean noHumidity) { super(null, 3, 3); World world = tileEntity.getBaseMetaTileEntity().getWorld(); this.input = input.copy(); this.isValid = false; + this.noHumidity = noHumidity; if (IC2) { - GreenHouseSlotIC2(tileEntity, world, input); + GreenHouseSlotIC2(tileEntity, world, input, noHumidity); return; } Item i = input.getItem(); @@ -754,7 +774,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse } public void GreenHouseSlotIC2( - GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input) { + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, + World world, + ItemStack input, + boolean noHumidity) { if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; CropCard cc = Crops.instance.getCropCard(input); this.input.stackSize = 1; @@ -836,7 +859,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse rn = new Random(); // CHECK GROWTH SPEED - te.humidity = 12; // humidity with full water storage + te.humidity = (byte) (noHumidity ? 0 : 12); // humidity with full water storage or 0 humidity te.airQuality = 6; // air quality when sky is seen te.nutrients = 8; // netrients with full nutrient storage |