From b3c3b9c5d7d0f40404f702b849d46f348cd78a9c Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Wed, 27 Jul 2022 04:39:06 +0200 Subject: Move Industrial Apiary to gregtech (#1107) * Industrial Apiary * Make Forestry not required. * Add support for gendustry upgrades and lower energy demand * Add item validation to input slots and fix battery + special slots * Automation upgrade support and bug fixes * Better canWork check and flower detection * GUI work * Better detection of modifier update * Add button to cancel process * Add textures * Tooltip changes * Add convert crafting * Make top and sides glow * Bug fix * New textures * Add bee effects * Make all tooltips translatable * Implement GT Apiary Upgrades * Prevent inserting too many upgrades * Just require gendustry instead of checking it everywhere * Add blacklist (bug fix) and use hashsets instead of arrays * Cache beemember to do effects * Make blacklist automatic * Add acceleration upgrades for all tiers (LV -> UV) * Lock the machine to maxspeed by default * Correct required energy in info tooltip * Use isUpgrade method instead of manually checking * Lower amperage to 4 * Save locked speed to nbt --- src/main/java/gregtech/GT_Mod.java | 3 +- src/main/java/gregtech/api/enums/ItemList.java | 10 + src/main/java/gregtech/api/enums/OrePrefixes.java | 4 +- src/main/java/gregtech/api/enums/Textures.java | 30 +- .../java/gregtech/api/util/GT_ApiaryUpgrade.java | 108 +++ .../gregtech/api/util/GT_TooltipDataCache.java | 16 +- .../common/gui/GT_Container_IndustrialApiary.java | 292 +++++++ .../gui/GT_GUIContainer_IndustrialApiary.java | 152 ++++ .../common/items/GT_MetaGenerated_Item_03.java | 21 +- .../basic/GT_MetaTileEntity_IndustrialApiary.java | 922 +++++++++++++++++++++ .../preload/GT_Loader_MetaTileEntities.java | 19 +- src/main/resources/assets/gregtech/lang/en_US.lang | 22 + .../iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY.png | Bin 0 -> 143 bytes .../OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE.png | Bin 0 -> 143 bytes ...VERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW.png | Bin 0 -> 143 bytes .../OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW.png | Bin 0 -> 143 bytes .../iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY.png | Bin 0 -> 5784 bytes .../OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png | Bin 0 -> 434 bytes ...ERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta | 6 + ...OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png | Bin 0 -> 338 bytes ..._FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta | 6 + .../OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW.png | Bin 0 -> 143 bytes .../iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY.png | Bin 0 -> 5628 bytes .../OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png | Bin 0 -> 8781 bytes ...VERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta | 6 + .../OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png | Bin 0 -> 184 bytes ...Y_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta | 6 + .../OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW.png | Bin 0 -> 143 bytes .../iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY.png | Bin 0 -> 373 bytes .../OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png | Bin 0 -> 515 bytes ...OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta | 13 + .../OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png | Bin 0 -> 164 bytes ...AY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta | 13 + .../OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW.png | Bin 0 -> 5619 bytes .../gui/basicmachines/IndustrialApiary.png | Bin 0 -> 20955 bytes .../gregtech/textures/items/gt.metaitem.03/200.png | Bin 0 -> 6875 bytes .../gregtech/textures/items/gt.metaitem.03/201.png | Bin 0 -> 7021 bytes .../gregtech/textures/items/gt.metaitem.03/202.png | Bin 0 -> 6918 bytes .../gregtech/textures/items/gt.metaitem.03/203.png | Bin 0 -> 7127 bytes .../gregtech/textures/items/gt.metaitem.03/204.png | Bin 0 -> 7133 bytes .../gregtech/textures/items/gt.metaitem.03/205.png | Bin 0 -> 7197 bytes .../gregtech/textures/items/gt.metaitem.03/206.png | Bin 0 -> 7142 bytes .../gregtech/textures/items/gt.metaitem.03/207.png | Bin 0 -> 7149 bytes 43 files changed, 1629 insertions(+), 20 deletions(-) create mode 100644 src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW.png create mode 100644 src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/200.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/201.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/202.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/203.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/204.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/205.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/206.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/207.png (limited to 'src') diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 13c3dfd390..08303e9f10 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -103,7 +103,8 @@ import static gregtech.api.enums.GT_Values.MOD_ID_FR; " after:RedPowerControl;" + " after:UndergroundBiomes;" + " after:TConstruct;" + - " after:Translocator;") + " after:Translocator;" + + " after:gendustry;") public class GT_Mod implements IGT_Mod { @Deprecated // Keep for use in BaseMetaTileEntity diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index b5898618f3..285d1fd542 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -1403,6 +1403,16 @@ public enum ItemList implements IItemContainer { Machine_MV_Miner, Machine_HV_Miner, + Machine_IndustrialApiary, + IndustrialApiary_Upgrade_Acceleration_1, + IndustrialApiary_Upgrade_Acceleration_2, + IndustrialApiary_Upgrade_Acceleration_3, + IndustrialApiary_Upgrade_Acceleration_4, + IndustrialApiary_Upgrade_Acceleration_5, + IndustrialApiary_Upgrade_Acceleration_6, + IndustrialApiary_Upgrade_Acceleration_7, + IndustrialApiary_Upgrade_Acceleration_8, + Neutron_Reflector, Reactor_Coolant_He_1, diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index fa8bb0b2cb..7b480ea995 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -331,7 +331,9 @@ public enum OrePrefixes { cellSteamCracked2("Cells", "Moderately Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30), cellSteamCracked3("Cells", "Severely Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30), - componentCircuit("Circuit Parts", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1); + componentCircuit("Circuit Parts", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), + + apiaryUpgrade("Industrial Apiary Upgrade", "", "", false, false, true, false, false, false, false, false, true, false, 0, -1, 64, -1); public static final ImmutableList CELL_TYPES = ImmutableList.of( diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index eee5425809..fb1ff424fc 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -593,6 +593,8 @@ public class Textures { OVERLAY_TOP_ROCK_BREAKER_GLOW, OVERLAY_TOP_SCANNER, OVERLAY_TOP_SCANNER_GLOW, + OVERLAY_TOP_INDUSTRIAL_APIARY, + OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW, OVERLAY_FRONT_POTIONBREWER, OVERLAY_FRONT_POTIONBREWER_GLOW, @@ -625,9 +627,11 @@ public class Textures { OVERLAY_FRONT_BOXINATOR_GLOW, OVERLAY_FRONT_ROCK_BREAKER, OVERLAY_FRONT_ROCK_BREAKER_GLOW, - OVERLAY_FRONT_SCANNER, OVERLAY_FRONT_SCANNER_GLOW, + OVERLAY_FRONT_INDUSTRIAL_APIARY, + OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW, + OVERLAY_BOTTOM_POTIONBREWER, OVERLAY_BOTTOM_POTIONBREWER_GLOW, OVERLAY_BOTTOM_REPLICATOR, @@ -649,13 +653,15 @@ public class Textures { OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW, OVERLAY_BOTTOM_DISASSEMBLER, OVERLAY_BOTTOM_DISASSEMBLER_GLOW, - OVERLAY_BOTTOM_BOXINATOR, OVERLAY_BOTTOM_BOXINATOR_GLOW, OVERLAY_BOTTOM_ROCK_BREAKER, OVERLAY_BOTTOM_ROCK_BREAKER_GLOW, OVERLAY_BOTTOM_SCANNER, OVERLAY_BOTTOM_SCANNER_GLOW, + OVERLAY_BOTTOM_INDUSTRIAL_APIARY, + OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW, + OVERLAY_SIDE_POTIONBREWER, OVERLAY_SIDE_POTIONBREWER_GLOW, OVERLAY_SIDE_REPLICATOR, @@ -664,7 +670,6 @@ public class Textures { OVERLAY_SIDE_MASSFAB_GLOW, OVERLAY_SIDE_STEAM_HAMMER, OVERLAY_SIDE_STEAM_HAMMER_GLOW, - OVERLAY_SIDE_STEAM_FURNACE, OVERLAY_SIDE_STEAM_FURNACE_GLOW, OVERLAY_SIDE_STEAM_ALLOY_SMELTER, @@ -677,13 +682,15 @@ public class Textures { OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW, OVERLAY_SIDE_DISASSEMBLER, OVERLAY_SIDE_DISASSEMBLER_GLOW, - OVERLAY_SIDE_BOXINATOR, OVERLAY_SIDE_BOXINATOR_GLOW, OVERLAY_SIDE_ROCK_BREAKER, OVERLAY_SIDE_ROCK_BREAKER_GLOW, OVERLAY_SIDE_SCANNER, OVERLAY_SIDE_SCANNER_GLOW, + OVERLAY_SIDE_INDUSTRIAL_APIARY, + OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW, + OVERLAY_TOP_POTIONBREWER_ACTIVE, OVERLAY_TOP_POTIONBREWER_ACTIVE_GLOW, OVERLAY_TOP_REPLICATOR_ACTIVE, @@ -712,9 +719,11 @@ public class Textures { OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW, OVERLAY_TOP_SCANNER_ACTIVE, OVERLAY_TOP_SCANNER_ACTIVE_GLOW, + OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE, + OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW, + OVERLAY_FRONT_POTIONBREWER_ACTIVE, OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW, - OVERLAY_FRONT_REPLICATOR_ACTIVE, OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW, OVERLAY_FRONT_MASSFAB_ACTIVE, @@ -730,18 +739,19 @@ public class Textures { OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW, OVERLAY_FRONT_BOXINATOR_ACTIVE, OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW, - OVERLAY_FRONT_ROCK_BREAKER_ACTIVE, OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW, OVERLAY_FRONT_SCANNER_ACTIVE, OVERLAY_FRONT_SCANNER_ACTIVE_GLOW, + OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE, + OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW, + OVERLAY_BOTTOM_POTIONBREWER_ACTIVE, OVERLAY_BOTTOM_POTIONBREWER_ACTIVE_GLOW, OVERLAY_BOTTOM_REPLICATOR_ACTIVE, OVERLAY_BOTTOM_REPLICATOR_ACTIVE_GLOW, OVERLAY_BOTTOM_MASSFAB_ACTIVE, OVERLAY_BOTTOM_MASSFAB_ACTIVE_GLOW, - OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE, OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW, OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE, @@ -763,6 +773,8 @@ public class Textures { OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW, OVERLAY_BOTTOM_SCANNER_ACTIVE, OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW, + OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE, + OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW, OVERLAY_SIDE_POTIONBREWER_ACTIVE, OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW, @@ -787,11 +799,13 @@ public class Textures { OVERLAY_SIDE_DISASSEMBLER_ACTIVE_GLOW, OVERLAY_SIDE_BOXINATOR_ACTIVE, OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW, - OVERLAY_SIDE_ROCK_BREAKER_ACTIVE, OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW, OVERLAY_SIDE_SCANNER_ACTIVE, OVERLAY_SIDE_SCANNER_ACTIVE_GLOW, + OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE, + OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW, + OVERLAY_ADV_PUMP, OVERLAY_TELEPORTER, OVERLAY_TELEPORTER_GLOW, diff --git a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java new file mode 100644 index 0000000000..4c60e6f8bc --- /dev/null +++ b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java @@ -0,0 +1,108 @@ +package gregtech.api.util; + +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.OrePrefixes; +import gregtech.common.items.GT_MetaGenerated_Item_03; +import net.bdew.gendustry.api.ApiaryModifiers; +import net.bdew.gendustry.api.items.IApiaryUpgrade; +import net.minecraft.item.ItemStack; + +import java.util.*; +import java.util.function.Consumer; + +public enum GT_ApiaryUpgrade { + speed1(UNIQUE_INDEX.SPEED_UPGRADE, 32200, 1, 1), + speed2(UNIQUE_INDEX.SPEED_UPGRADE, 32201, 1, 2), + speed3(UNIQUE_INDEX.SPEED_UPGRADE, 32202, 1, 3), + speed4(UNIQUE_INDEX.SPEED_UPGRADE, 32203, 1, 4), + speed5(UNIQUE_INDEX.SPEED_UPGRADE, 32204, 1, 5), + speed6(UNIQUE_INDEX.SPEED_UPGRADE, 32205, 1, 6), + speed7(UNIQUE_INDEX.SPEED_UPGRADE, 32206, 1, 7), + speed8(UNIQUE_INDEX.SPEED_UPGRADE, 32207, 1, 8), + ; + + private enum UNIQUE_INDEX{ + SPEED_UPGRADE, + ; + void apply(Consumer fn){ + UNIQUE_UPGRADE_LIST.get(this).forEach(fn); + } + } + + private static final EnumMap> UNIQUE_UPGRADE_LIST = new EnumMap<>(UNIQUE_INDEX.class); + + private int meta = 0; + private int maxnumber = 1; + private int maxspeedmodifier = 0; // formula: maxspeed = modifier + + private final GT_Utility.ItemId id; + private final UNIQUE_INDEX unique_index; + + private final HashMap additionalGendustryUpgrades = new HashMap<>(); + private final HashSet blacklistedUpgrades = new HashSet<>(); // additionalGendustryUpgrades are blacklisted by default + + GT_ApiaryUpgrade(UNIQUE_INDEX unique_index, int meta, int maxnumber, int maxspeedmodifier){ + this.unique_index = unique_index; + this.meta = meta; + this.maxnumber = maxnumber; + this.maxspeedmodifier = maxspeedmodifier; + this.id = GT_Utility.ItemId.createNoCopy(get(1)); + } + + private void setup_static_variables(){ + quickLookup.put(this.meta, this); + ArrayList un = UNIQUE_UPGRADE_LIST.get(this.unique_index); + if(un != null) + un.forEach((u) -> { u.blacklistedUpgrades.add(this.id); this.blacklistedUpgrades.add(u.id); }); + else { + un = new ArrayList<>(1); + UNIQUE_UPGRADE_LIST.put(this.unique_index, un); + } + un.add(this); + } + + public static GT_ApiaryUpgrade getUpgrade(ItemStack s){ + if(s == null) + return null; + if(!isUpgrade(s)) + return null; + return quickLookup.get(s.getItemDamage()); + } + + public boolean isAllowedToWorkWith(ItemStack s){ + GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(s); + return !additionalGendustryUpgrades.containsKey(id) && !blacklistedUpgrades.contains(id); + } + + public int getMaxNumber(){ + return maxnumber; + } + + public void applyModifiers(ApiaryModifiers mods, ItemStack s){ + additionalGendustryUpgrades.forEach((k, u) -> ((IApiaryUpgrade)u.getItem()).applyModifiers(mods, u)); + } + + public ItemStack get(int count){ + return new ItemStack(GT_MetaGenerated_Item_03.INSTANCE, count, meta); + } + + public static boolean isUpgrade(ItemStack s){ + return OrePrefixes.apiaryUpgrade.contains(s); + } + + public int applyMaxSpeedModifier(int maxspeed){ + return Math.max(maxspeed, maxspeedmodifier); + } + + private static final HashMap quickLookup = new HashMap<>(); + + static{ + EnumSet.allOf(GT_ApiaryUpgrade.class).forEach(GT_ApiaryUpgrade::setup_static_variables); + + if(Loader.isModLoaded("gendustry")) { + ItemStack s = GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 8L, 0); + GT_Utility.ItemId a = GT_Utility.ItemId.createNoCopy(s); + UNIQUE_INDEX.SPEED_UPGRADE.apply((u) -> u.additionalGendustryUpgrades.put(a, s)); + } + } +} diff --git a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java index 7844bb04fd..4309958b82 100644 --- a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java +++ b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java @@ -23,8 +23,8 @@ public class GT_TooltipDataCache { /** * Returns tooltip data respecting the user's configured verbosity levels, applying any formatting arguments. - * - * @param key the key to lookup + * + * @param key the key to lookup * @param args arguments for string formatting (prefer using positional arguments) * @return The tooltip data the user asked for */ @@ -39,12 +39,12 @@ public class GT_TooltipDataCache { /** * Builds tooltip data respecting the user's configured verbosity levels, applying any formatting arguments. - * - * @param key the key to lookup + * + * @param key the key to lookup * @param args arguments for string formatting (prefer using positional arguments) * @return The tooltip data the user asked for */ - private TooltipData getUncachedTooltipData(String key, Object... args) { + public TooltipData getUncachedTooltipData(String key, Object... args) { List lines = getAllLines(key, args); int normalLines = lines.size(); if (Math.max(GT_Mod.gregtechproxy.mTooltipVerbosity, GT_Mod.gregtechproxy.mTooltipShiftVerbosity) >= 3) { @@ -60,8 +60,8 @@ public class GT_TooltipDataCache { /** * Gets all the lines for the given key and every other subsequent consecutive key with a .n suffix, n in {1,2,3...} - * - * @param key the key to lookup + * + * @param key the key to lookup * @param args arguments for string formatting (prefer using positional arguments) * @return The lines for the key and all of it's subkeys */ @@ -78,7 +78,7 @@ public class GT_TooltipDataCache { /** * Determines how many lines from a tooltip to include from the full line list to respect a given verbosity level. - * + * * @param tooltipVerbosity the verbosity level we're applying * @param defaultIndex return if tooltipVerbosity is 2 * @param maxIndex return if tooltipVerbosity is greater than 2 diff --git a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java new file mode 100644 index 0000000000..45d455ff03 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java @@ -0,0 +1,292 @@ +package gregtech.common.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.ForestryAPI; +import forestry.api.core.IErrorState; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.gui.GT_Slot_Output; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_ApiaryUpgrade; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_IndustrialApiary; +import net.bdew.gendustry.api.items.IApiaryUpgrade; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import java.util.ArrayList; + +public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine { + + GT_Slot_Holo slotItemTransferToggle; + GT_Slot_Holo slotSpeedToggle; + GT_Slot_Holo slotPollenToggle; + GT_Slot_Holo slotCancelProcess; + Slot slotBattery; + Slot slotSpecial; + + boolean mItemTransfer; + boolean mStuttering; + + int mSpeed = 0; // scale 0 - 8 + boolean mLockedSpeed = true; + boolean retrievePollen; + + ArrayList mErrorStates = new ArrayList<>(50); + + public GT_Container_IndustrialApiary(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(slotItemTransferToggle = new GT_Slot_Holo(mTileEntity, 0, 8, 63, false, true, 1)); + addSlotToContainer(slotSpeedToggle = new GT_Slot_Holo(mTileEntity, 0, 26, 63, false, true, 1)); + addSlotToContainer(slotPollenToggle = new GT_Slot_Holo(mTileEntity, 0, 8, 45, false, true, 1)); + addSlotToContainer(slotCancelProcess = new GT_Slot_Holo(mTileEntity, 0, 8, 27, false, true, 1)); + int tStartIndex = 5; + + addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 37, 22)); + addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 37, 42)); + + addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 62, 24)); + addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 80, 24)); + addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 62, 42)); + addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 80, 42)); + + for(int i = 107; i <= 143; i += 18) + for(int j = 6; j <= 42; j += 18) + addSlotToContainer(new GT_Slot_Output(this.mTileEntity, tStartIndex++, i, j)); + + addSlotToContainer(slotBattery = new Slot(mTileEntity, 1, 80, 63)); + addSlotToContainer(slotSpecial = new Slot(mTileEntity, 3, 125, 63)); + + } + + @Override + public ItemStack slotClick(int aSlotNumber, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (mTileEntity.getMetaTileEntity() == null) return null; + GT_MetaTileEntity_IndustrialApiary machine = getMachine(); + if (machine == null) return null; + switch (aSlotNumber) { + case 0: + machine.mItemTransfer = !machine.mItemTransfer; + return null; + case 1: + if(aMouseclick == 0) { + if(machine.mLockedSpeed) + return null; + if(aShifthold == 0) { + machine.mSpeed++; + if (machine.mSpeed > machine.getMaxSpeed()) machine.mSpeed = 0; + } + else if(aShifthold == 1) + { + machine.mSpeed--; + if (machine.mSpeed < 0) machine.mSpeed = machine.getMaxSpeed(); + } + } + else if(aMouseclick == 1) + { + machine.mLockedSpeed = !machine.mLockedSpeed; + if(machine.mLockedSpeed) + machine.mSpeed = machine.getMaxSpeed(); + } + return null; + case 2: + machine.retreviePollen = !machine.retreviePollen; + return null; + case 3: + machine.cancelProcess(); + detectAndSendChanges(); + return null; + } + + if(!(aSlotNumber >= getSlotStartIndex()+2 && aSlotNumber < getSlotStartIndex()+2+4)) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if(aShifthold == 5) + return null; + if(aShifthold != 0) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if(aMouseclick > 1) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + ItemStack s = aPlayer.inventory.getItemStack(); + if(s == null) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + Slot slot = getSlot(aSlotNumber); + ItemStack slotstack = slot.getStack(); + if(slotstack != null && !GT_Utility.areStacksEqual(slotstack, s)) + return null; // super would replace item + if(slotstack == null && !slot.isItemValid(s)) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + if(!(s.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(s)) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + int max = 1; + if (s.getItem() instanceof IApiaryUpgrade) + max = ((IApiaryUpgrade) s.getItem()).getMaxNumber(s); + else + max = GT_ApiaryUpgrade.getUpgrade(s).getMaxNumber(); + if(slotstack != null) + max = Math.max(0, max - slotstack.stackSize); + max = Math.min(max, s.stackSize); + if(max == 0) + return null; + if(aMouseclick == 1) + max = 1; + if(max == s.stackSize) + return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + ItemStack newstack = s.splitStack(s.stackSize - max); + ItemStack result = super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); + aPlayer.inventory.setItemStack(newstack); + return result; + } + + @Override + public int getSlotStartIndex() { + return 4; + } + + @Override + public int getSlotCount() { + return 6+9+2; + } + + @Override + public int getShiftClickSlotCount() { + return 6; + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { + return; + } + + this.mSpeed = getMachine().mSpeed; + this.mItemTransfer = getMachine().mItemTransfer; + this.mStuttering = getMachine().mStuttering; + this.retrievePollen = getMachine().retreviePollen; + this.mLockedSpeed = getMachine().mLockedSpeed; + + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; + var1.sendProgressBarUpdate(this, 100, this.mSpeed); + var1.sendProgressBarUpdate(this, 101, this.mItemTransfer ? 1 : 0); + var1.sendProgressBarUpdate(this, 102, 0); + for(IErrorState s : getMachine().mErrorStates) + var1.sendProgressBarUpdate(this, 103, s.getID()); + var1.sendProgressBarUpdate(this, 104, this.mStuttering ? 1 : 0); + var1.sendProgressBarUpdate(this, 105, this.retrievePollen ? 1 : 0); + var1.sendProgressBarUpdate(this, 106, this.mLockedSpeed ? 1 : 0); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: + this.mSpeed = par2; + break; + case 101: + this.mItemTransfer = par2 == 1; + break; + case 102: + this.mErrorStates.clear(); + break; + case 103: + this.mErrorStates.add(EnumChatFormatting.RED + StatCollector.translateToLocal("for." + ForestryAPI.errorStateRegistry.getErrorState((short) par2).getDescription())); + break; + case 104: + this.mStuttering = par2 == 1; + break; + case 105: + this.retrievePollen = par2 == 1; + break; + case 106: + this.mLockedSpeed = par2 == 1; + break; + } + } + + public GT_MetaTileEntity_IndustrialApiary getMachine() { + return (GT_MetaTileEntity_IndustrialApiary) mTileEntity.getMetaTileEntity(); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { + Slot s = getSlot(aSlotIndex); + if(s == null) + return super.transferStackInSlot(aPlayer, aSlotIndex); + if(!(s.inventory instanceof InventoryPlayer)) + return super.transferStackInSlot(aPlayer, aSlotIndex); + ItemStack aStack = s.getStack(); + if(aStack == null) + return super.transferStackInSlot(aPlayer, aSlotIndex); + if(!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack)) + return super.transferStackInSlot(aPlayer, aSlotIndex); + for(int i = getSlotStartIndex()+2; i < getSlotStartIndex()+2+4; i++) { + Slot iSlot = getSlot(i); + ItemStack iStack = iSlot.getStack(); + if(iStack == null) + { + if(!iSlot.isItemValid(aStack)) + continue; + } + else + { + if(!GT_Utility.areStacksEqual(aStack, iStack)) + continue; + } + int max = 1; + if (aStack.getItem() instanceof IApiaryUpgrade) + max = ((IApiaryUpgrade) aStack.getItem()).getMaxNumber(aStack); + else + max = GT_ApiaryUpgrade.getUpgrade(aStack).getMaxNumber(); + if (iStack == null) { + max = Math.min(max, aStack.stackSize); + ItemStack newstack = aStack.splitStack(max); + iSlot.putStack(newstack); + } else { + max = Math.max(0, max - iStack.stackSize); + max = Math.min(max, aStack.stackSize); + iStack.stackSize += max; + aStack.stackSize -= max; + iSlot.onSlotChanged(); + } + if (aStack.stackSize == 0) + s.putStack(null); + else + s.onSlotChanged(); + break; + } + return null; + } + + private static class ApiarySlot extends Slot{ + + public ApiarySlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + } + + @Override + public boolean isItemValid(ItemStack p_75214_1_) { + return this.inventory.isItemValidForSlot(this.getSlotIndex(), p_75214_1_); + } + + @Override + public void onSlotChanged() { + super.onSlotChanged(); + ((GT_MetaTileEntity_IndustrialApiary)((IGregTechTileEntity)this.inventory).getMetaTileEntity()).onInventoryUpdate(this.getSlotIndex()); + } + } +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java new file mode 100644 index 0000000000..f901a78599 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java @@ -0,0 +1,152 @@ +package gregtech.common.gui; + +import forestry.api.apiculture.*; +import gregtech.api.enums.GT_Values; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.gui.widgets.GT_GuiSlotTooltip; +import gregtech.api.gui.widgets.GT_GuiTooltip; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_TooltipDataCache; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_IndustrialApiary; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.StatCollector; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; + +public class GT_GUIContainer_IndustrialApiary extends GT_GUIContainerMetaTile_Machine { + + + private static final String + BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", + UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", + STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", + ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", + POWER_SOURCE_POWER = "GT5U.machines.powersource.power", + RETRIEVE_POLLEN_TOOLTIP = "GT5U.machines.industrialapiary.pollen.tooltip", + CANCEL_PROCESS_TOOLTIP = "GT5U.machines.industrialapiary.cancel.tooltip", + SPEED_TOOLTIP = "GT5U.machines.industrialapiary.speed.tooltip", + SPEED_LOCKED_TOOLTIP = "GT5U.machines.industrialapiary.speedlocked.tooltip", + INFO_TOOLTIP = "GT5U.machines.industrialapiary.info.tooltip", + INFO_WITH_BEE_TOOLTIP = "GT5U.machines.industrialapiary.infoextended.tooltip" + ; + + + GT_GuiTooltip mErrorStatesTooltip; + GT_GuiTooltip mSpeedToggleTooltip; + GT_GuiTooltip mInfoTooltip; + + public GT_GUIContainer_IndustrialApiary(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_IndustrialApiary(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/basicmachines/IndustrialApiary.png"); + } + + @Override + protected void setupTooltips() { + Rectangle tBeeProblemArea = new Rectangle(this.guiLeft + 100, this.guiTop + 63, 18, 18); + addToolTip(mErrorStatesTooltip = new GT_GuiTooltip(tBeeProblemArea, "") { + @Override + protected void onTick() { + boolean e = this.enabled; + super.onTick(); + this.enabled = e; + } + }); + addToolTip(mSpeedToggleTooltip = new GT_GuiSlotTooltip(getContainer().slotSpeedToggle, new GT_TooltipDataCache.TooltipData(null, null))); + mErrorStatesTooltip.enabled = false; + addToolTip(mInfoTooltip = new GT_GuiTooltip(new Rectangle(this.guiLeft + 163, guiTop + 5, 6, 17))); + + addToolTip(new GT_GuiSlotTooltip(getContainer().slotPollenToggle, mTooltipCache.getData(RETRIEVE_POLLEN_TOOLTIP))); + addToolTip(new GT_GuiSlotTooltip(getContainer().slotCancelProcess, mTooltipCache.getData(CANCEL_PROCESS_TOOLTIP))); + + + addToolTip(new GT_GuiSlotTooltip(getContainer().slotItemTransferToggle, mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); + addToolTip(new GT_GuiSlotTooltip(getContainer().slotBattery, mTooltipCache.getData(BATTERY_SLOT_TOOLTIP, + powerTierName(getContainer().getMachine().mTier), + powerTierName((byte)(getContainer().getMachine().mTier + 1))))); + addToolTip(new GT_GuiSlotTooltip(getContainer().slotSpecial, mTooltipCache.getData(UNUSED_SLOT_TOOLTIP))); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float parTicks) { + mErrorStatesTooltip.enabled = !getContainer().mErrorStates.isEmpty(); + if(mErrorStatesTooltip.enabled){ mErrorStatesTooltip.setToolTipText(new GT_TooltipDataCache.TooltipData(getContainer().mErrorStates, getContainer().mErrorStates)); } + else if(getContainer().mStuttering) + { + mErrorStatesTooltip.enabled = true; + mErrorStatesTooltip.setToolTipText(mTooltipCache.getData(STALLED_STUTTERING_TOOLTIP, StatCollector.translateToLocal(POWER_SOURCE_POWER))); + } + int accelerated = (1 << getContainer().mSpeed); + int energyusage = 0; + if(accelerated == 2) + energyusage = 32; + else if(accelerated > 2) + energyusage = 32 * accelerated << (getContainer().mSpeed - 2); + mSpeedToggleTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData(getContainer().mLockedSpeed ? SPEED_LOCKED_TOOLTIP : SPEED_TOOLTIP, accelerated, GT_Utility.formatNumbers(energyusage))); + ArrayList s = new ArrayList<>(); + GT_MetaTileEntity_IndustrialApiary IA = getContainer().getMachine(); + + String energyreq = GT_Utility.formatNumbers((int)((float)GT_MetaTileEntity_IndustrialApiary.baseEUtUsage * IA.getEnergyModifier() * accelerated) + energyusage); + String Temp = StatCollector.translateToLocal(IA.getTemperature().getName()); + String Hum = StatCollector.translateToLocal(IA.getHumidity().getName()); + boolean moreinformationgiven = false; + if(IA.getUsedQueen() != null && BeeManager.beeRoot.isMember(IA.getUsedQueen(), EnumBeeType.QUEEN.ordinal())) { + IBee bee = BeeManager.beeRoot.getMember(IA.getUsedQueen()); + if (bee.isAnalyzed()) { + moreinformationgiven = true; + IBeeGenome genome = bee.getGenome(); + IBeeModifier mod = BeeManager.beeRoot.getBeekeepingMode(IA.getWorld()).getBeeModifier(); + float tmod = IA.getTerritoryModifier(null, 1f) * mod.getTerritoryModifier(null, 1f); + int[] t = Arrays.stream(genome.getTerritory()).map(i -> (int) ((float) i * tmod)).toArray(); + mInfoTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData(INFO_WITH_BEE_TOOLTIP, energyreq, Temp, Hum, + Math.round(100f * IA.getProductionModifier(null, 1f) * genome.getSpeed() * mod.getProductionModifier(null, 1f)), + Math.round(IA.getFloweringModifier(null, 1f) * genome.getFlowering() * mod.getFloweringModifier(null, 1f)), + Math.round(IA.getLifespanModifier(null, null, 1f) * genome.getLifespan() * mod.getLifespanModifier(null, null, 1f)), + t[0], t[1], t[2])); + } + } + if(!moreinformationgiven) + mInfoTooltip.setToolTipText(mTooltipCache.getUncachedTooltipData(INFO_TOOLTIP, energyreq, Temp, Hum)); + + + super.drawScreen(mouseX, mouseY, parTicks); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRendererObj.drawString("Ind. Apiary", 8, 4, 4210752); + this.fontRendererObj.drawString("x", 30, 63, 4210752); + this.fontRendererObj.drawString((1 << getContainer().mSpeed) + "", 26, 72, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + if (this.mContainer != null) { + if (getContainer().mItemTransfer) + drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18); + if(getContainer().retrievePollen) + drawTexturedModalRect(x + 7, y + 44, 194, 18, 18, 18); + if(getContainer().mMaxProgressTime > 0) { + double p = (double) getContainer().mProgressTime / getContainer().mMaxProgressTime; + drawTexturedModalRect(x+70, y+3, 176, 0, (int)(p*20), 18); + } + if(mErrorStatesTooltip.enabled) + drawTexturedModalRect(x+100, y+63, 176, 36, getContainer().mStuttering ? 18 : 9, 18); + } + } + + private GT_Container_IndustrialApiary getContainer(){ + return ((GT_Container_IndustrialApiary) this.mContainer); + } + + // taken from GT_GUIContainer_BasicMachine + private String powerTierName(byte machineTier) { + return GT_Values.TIER_COLORS[machineTier] + GT_Values.VN[machineTier]; + } + +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java index 1252fdb2f0..3e35ff6a21 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java @@ -330,7 +330,26 @@ public class GT_MetaGenerated_Item_03 ItemList.GalliumArsenideCrystalSmallPart.set(addItem(tLastID = 191, "Small Gallium Arsenide Crystal", "For making boules", o)); ItemList.KevlarFiber.set(addItem(tLastID = 192, "Kevlar Fiber", "For make Kevlar Plates", o)); ItemList.WovenKevlar.set(addItem(tLastID = 193, "Woven Kevlar", "For make Kevlar Plates", o)); - ItemList.Spinneret.set(addItem(tLastID = 194, "Spinneret", "For make Kevlar Fiber", o)); + ItemList.Spinneret.set(addItem(tLastID = 194, "Spinneret", "For make Kevlar Fiber", o)); + + ItemList.IndustrialApiary_Upgrade_Acceleration_1.set(addItem(tLastID = 200, "Acceleration Upgrade x2", "Acceleration upgrade for Industrial Apiary/n Unlocks 2x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_2.set(addItem(tLastID = 201, "Acceleration Upgrade x4", "Acceleration upgrade for Industrial Apiary/n Unlocks 4x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_3.set(addItem(tLastID = 202, "Acceleration Upgrade x8", "Acceleration upgrade for Industrial Apiary/n Unlocks 8x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_4.set(addItem(tLastID = 203, "Acceleration Upgrade x16", "Acceleration upgrade for Industrial Apiary/n Unlocks 16x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_5.set(addItem(tLastID = 204, "Acceleration Upgrade x32", "Acceleration upgrade for Industrial Apiary/n Unlocks 32x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_6.set(addItem(tLastID = 205, "Acceleration Upgrade x64", "Acceleration upgrade for Industrial Apiary/n Unlocks 64x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_7.set(addItem(tLastID = 206, "Acceleration Upgrade x128", "Acceleration upgrade for Industrial Apiary/n Unlocks 128x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + ItemList.IndustrialApiary_Upgrade_Acceleration_8.set(addItem(tLastID = 207, "Acceleration Upgrade x256", "Acceleration upgrade for Industrial Apiary/n Unlocks 256x acceleration level/n Will also grant 8x production upgrade", OrePrefixes.apiaryUpgrade.name())); + + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_1.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_2.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_3.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_4.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_5.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_6.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_7.get(1L)); + OrePrefixes.apiaryUpgrade.add(ItemList.IndustrialApiary_Upgrade_Acceleration_8.get(1L)); + } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java new file mode 100644 index 0000000000..f442b6812c --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java @@ -0,0 +1,922 @@ +package gregtech.common.tileentities.machines.basic; + +import com.google.common.collect.ImmutableSet; +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.apiculture.*; +import forestry.api.arboriculture.EnumGermlingType; +import forestry.api.core.*; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IEffectData; +import forestry.api.genetics.IIndividual; +import forestry.core.errors.EnumErrorCode; +import forestry.plugins.PluginApiculture; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GT_ApiaryUpgrade; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Client; +import gregtech.common.gui.GT_Container_IndustrialApiary; +import gregtech.common.gui.GT_GUIContainer_IndustrialApiary; +import net.bdew.gendustry.api.ApiaryModifiers; +import net.bdew.gendustry.api.items.IApiaryUpgrade; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.*; + +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_Utility.moveMultipleItemStacks; + +public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicMachine implements IBeeHousing, IBeeHousingInventory, IErrorLogic, IBeeModifier, IBeeListener { + + public static final int baseEUtUsage = 37; + static final int queen = 5; + static final int drone = 6; + + + IBeeRoot beeRoot = (IBeeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"); + + public int mSpeed = 0; + public boolean mLockedSpeed = true; + public boolean retreviePollen = false; + + private ItemStack usedQueen = null; + private IBee usedQueenBee = null; + private IEffectData[] effectData = new IEffectData[2]; + + public GT_MetaTileEntity_IndustrialApiary(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 4, new String[] { "BEES GOES BRRRR", EnumChatFormatting.GRAY + "Added by " + EnumChatFormatting.GOLD + "kuba6000" }, 6, 9, "IndustrialApiary.png", "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY), + TextureFactory.builder().addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY), + TextureFactory.builder().addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY), + TextureFactory.builder().addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW).glow().build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY), + TextureFactory.builder().addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW).glow().build())); + } + + public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 4, aDescription, aTextures, 6, 9, aGUIName, aNEIName); + } + + public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 4, aDescription, aTextures, 6, 9, aGUIName, aNEIName); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_IndustrialApiary(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + } + + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_IndustrialApiary(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_IndustrialApiary(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mSpeed", mSpeed); + aNBT.setBoolean("mLockedSpeed", mLockedSpeed); + aNBT.setBoolean("retrievePolen", retreviePollen); + if(usedQueen != null) + aNBT.setTag("usedQueen", usedQueen.writeToNBT(new NBTTagCompound())); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mSpeed = aNBT.getInteger("mSpeed"); + mLockedSpeed = aNBT.getBoolean("mLockedSpeed"); + retreviePollen = aNBT.getBoolean("retrievePolen"); + if(aNBT.hasKey("usedQueen")) + usedQueen = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("usedQueen")); + } + + @Override + public int checkRecipe() { + updateModifiers(); + if(canWork()) { + + ItemStack queen = getQueen(); + usedQueen = queen.copy(); + if(beeRoot.getType(queen) == EnumBeeType.QUEEN) + { + IBee bee = beeRoot.getMember(queen); + usedQueenBee = bee; + + // LIFE CYCLES + + float mod = this.getLifespanModifier(null, null, 1.f); + IBeekeepingMode mode = beeRoot.getBeekeepingMode(this.getWorld()); + IBeeModifier beemodifier = mode.getBeeModifier(); + mod *= beemodifier.getLifespanModifier(null, null, 1.f); + int h = bee.getHealth(); + mod = 1.f / mod; + float cycles = h/mod; + + + // PRODUCTS + + HashMap pollen = new HashMap<>(); + + if(retreviePollen) { + int icycles = (int)cycles + (getWorld().rand.nextFloat() < (cycles - (float)((int)cycles)) ? 1 : 0); + for(int z = 0; z < icycles; z++) { + IIndividual p = bee.retrievePollen(this); + if(p != null) + { + ItemStack s = p.getGenome().getSpeciesRoot().getMemberStack(p, EnumGermlingType.POLLEN.ordinal()); + if(s != null) { + GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(s); + pollen.computeIfAbsent(id, k -> { ItemStack ns = s.copy(); ns.stackSize = 0; return ns; }); + pollen.get(id).stackSize += s.stackSize; + } + } + } + } + + IBeeGenome genome = bee.getGenome(); + IAlleleBeeSpecies primary = genome.getPrimary(); + IAlleleBeeSpecies secondary = genome.getSecondary(); + + float speed = genome.getSpeed() * getProductionModifier(null, 1f) * beemodifier.getProductionModifier(null, 1.f); + + HashMap drops = new HashMap<>(); + HashMap dropstacks = new HashMap<>(); + + for(Map.Entry entry : primary.getProductChances().entrySet()) { + GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); + drops.merge(id, Math.min(1f, entry.getValue() * speed) * (float) entry.getKey().stackSize * cycles, Float::sum); + dropstacks.computeIfAbsent(id, k -> entry.getKey()); + } + for(Map.Entry entry : secondary.getProductChances().entrySet()) { + GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); + drops.merge(id, Math.min(1f, (float) Math.round(entry.getValue() / 2.0F) * speed) * (float) entry.getKey().stackSize * cycles, Float::sum); + dropstacks.computeIfAbsent(id, k -> entry.getKey()); + } + if(primary.isJubilant(genome, this) && secondary.isJubilant(genome, this)) + for(Map.Entry entry : primary.getSpecialtyChances().entrySet()) { + GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); + drops.merge(id, Math.min(1f, entry.getValue() * speed) * (float) entry.getKey().stackSize * cycles, Float::sum); + dropstacks.computeIfAbsent(id, k -> entry.getKey()); + } + + int i = 0; + for(Map.Entry entry : drops.entrySet()) + { + ItemStack s = dropstacks.get(entry.getKey()).copy(); + s.stackSize = entry.getValue().intValue() + (getWorld().rand.nextFloat() < (entry.getValue() - (float) entry.getValue().intValue()) ? 1 : 0); + if(s.stackSize > 0) + this.mOutputItems[i++] = s; + } + + IApiaristTracker breedingTracker = beeRoot.getBreedingTracker(getWorld(), getOwner()); + + if(!bee.canSpawn()) { + ItemStack convert = new ItemStack(PluginApiculture.items.beePrincessGE); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + queen.writeToNBT(nbttagcompound); + convert.setTagCompound(nbttagcompound); + this.mOutputItems[7] = convert; + } + else { + IBee b = bee.spawnPrincess(this); + if(b != null){ + ItemStack princess = beeRoot.getMemberStack(b, EnumBeeType.PRINCESS.ordinal()); + breedingTracker.registerPrincess(b); + this.mOutputItems[7] = princess; + } + IBee[] d = bee.spawnDrones(this); + if(d != null && d.length > 0) { + ItemStack drone = beeRoot.getMemberStack(d[0], EnumBeeType.DRONE.ordinal()); + drone.stackSize = d.length; + breedingTracker.registerDrone(d[0]); + this.mOutputItems[8] = drone; + } + } + + setQueen(null); + + for(ItemStack s : pollen.values()) + if(i < 7) + this.mOutputItems[i++] = s; + else + break; + + + + + + // Overclock + + + this.mMaxProgresstime = (int)(cycles * 550.f); + int timemaxdivider = this.mMaxProgresstime / 100; + int useddivider = 1 << this.mSpeed; + int actualdivider = useddivider; + this.mMaxProgresstime /= Math.min(actualdivider, timemaxdivider); + actualdivider /= Math.min(actualdivider, timemaxdivider); + for(i--; i >= 0; i--) + this.mOutputItems[i].stackSize *= actualdivider; + + this.mProgresstime = 0; + this.mEUt = (int)((float)baseEUtUsage * this.energyMod * useddivider); + if(useddivider == 2) + this.mEUt += 32; + else if(useddivider > 2) + this.mEUt += (32 * (useddivider << (this.mSpeed - 2))); + } + else { + // Breeding time + this.mMaxProgresstime = 100; + this.mProgresstime = 0; + int useddivider = Math.min(100, 1 << this.mSpeed); + this.mMaxProgresstime /= useddivider; + this.mEUt = (int)((float)baseEUtUsage * this.energyMod * useddivider); + if(useddivider == 2) + this.mEUt += 32; + else if(useddivider > 2) + this.mEUt += (32 * (useddivider << (this.mSpeed - 2))); + + IBee princess = beeRoot.getMember(getQueen()); + usedQueenBee = princess; + IBee drone = beeRoot.getMember(getDrone()); + princess.mate(drone); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + princess.writeToNBT(nbttagcompound); + this.mOutputItems[0] = new ItemStack(PluginApiculture.items.beeQueenGE); + this.mOutputItems[0].setTagCompound(nbttagcompound); + beeRoot.getBreedingTracker(getWorld(), getOwner()).registerQueen(princess); + + setQueen(null); + getDrone().stackSize -= 1; + if(getDrone().stackSize == 0) + setDrone(null); + + } + + + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + + return DID_NOT_FIND_RECIPE; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + updateModifiers(); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isClientSide()) { + if(GT_Client.changeDetected == 4) { + /* Client tick counter that is set to 5 on hiding pipes and covers. + * It triggers a texture update next client tick when reaching 4, with provision for 3 more update tasks, + * spreading client change detection related work and network traffic on different ticks, until it reaches 0. + */ + aBaseMetaTileEntity.issueTextureUpdate(); + } + if(aBaseMetaTileEntity.isActive()){ + if(usedQueen != null) { + if (aTick % 2 == 0) { + // FX on client, effect on server + IBee bee = beeRoot.getMember(usedQueen); + effectData = bee.doFX(effectData, this); + } + } + } + } + if(aBaseMetaTileEntity.isServerSide()){ + + doDisplayThings(); + + if(!aBaseMetaTileEntity.isActive()) + { + if(aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) + { + int check = checkRecipe(); + if(check == FOUND_AND_SUCCESSFULLY_USED_RECIPE) { + aBaseMetaTileEntity.setActive(true); + } + } + } + else{ + + if(this.mProgresstime < 0) + { + this.mProgresstime++; + return; + } + if(this.mStuttering) + { + if(!aBaseMetaTileEntity.isAllowedToWork()) + return; + if(aTick % 100 == 0) + this.mStuttering = false; + return; + } + if(this.hasErrors()) + { + if(!aBaseMetaTileEntity.isAllowedToWork()) + return; + if(aTick % 100 == 0) + if(!canWork(usedQueen)) + this.stutterProcess(); + return; + } + + if(!drainEnergyForProcess(this.mEUt)) + { + this.mStuttering = true; + this.stutterProcess(); + return; + } + this.mProgresstime++; + if(usedQueen != null) { + if(usedQueenBee == null) + usedQueenBee = beeRoot.getMember(usedQueen); + effectData = usedQueenBee.doEffect(effectData, this); + } + + if(this.mProgresstime % 100 == 0) + { + if(!canWork(usedQueen)) + { + this.stutterProcess(); + return; + } + } + + if(this.mProgresstime >= this.mMaxProgresstime) + { + updateModifiers(); + for (int i = 0; i < mOutputItems.length; i++) + if(mOutputItems[i] != null) + for (int j = 0; j < mOutputItems.length; j++) { + if(isAutomated) + { + if(beeRoot.isMember(mOutputItems[i], EnumBeeType.QUEEN.ordinal()) || beeRoot.isMember(mOutputItems[i], EnumBeeType.PRINCESS.ordinal())) { + if(aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[i])) + break; + } + else if(beeRoot.isMember(mOutputItems[i], EnumBeeType.DRONE.ordinal())) + if(aBaseMetaTileEntity.addStackToSlot(drone, mOutputItems[i])) + break; + } + if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) + break; + } + Arrays.fill(mOutputItems, null); + mEUt = 0; + mProgresstime = 0; + mMaxProgresstime = 0; + mStuttering = false; + aBaseMetaTileEntity.setActive(false); + + if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing) { + TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); + long tStoredEnergy = aBaseMetaTileEntity.getUniversalEnergyStored(); + int tMaxStacks = (int)(tStoredEnergy/64L); + if (tMaxStacks > mOutputItems.length) + tMaxStacks = mOutputItems.length; + + moveMultipleItemStacks(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1,tMaxStacks); + } + + if(aBaseMetaTileEntity.isAllowedToWork() && checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) + aBaseMetaTileEntity.setActive(true); + } + } + } + } + + public void cancelProcess(){ + if(this.getBaseMetaTileEntity().isActive() && this.getBaseMetaTileEntity().isServerSide() && usedQueen != null && beeRoot.isMember(usedQueen, EnumBeeType.QUEEN.ordinal())) + { + Arrays.fill(mOutputItems, null); + mEUt = 0; + mProgresstime = 0; + mMaxProgresstime = 0; + mStuttering = false; + this.getBaseMetaTileEntity().setActive(false); + setQueen(usedQueen); + this.getBaseMetaTileEntity().disableWorking(); + } + } + + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { + if(aStack == null) return false; + if(aIndex < getInputSlot()) + return true; + if(aIndex == queen) return beeRoot.isMember(aStack, EnumBeeType.QUEEN.ordinal()) || beeRoot.isMember(aStack, EnumBeeType.PRINCESS.ordinal()); + else if(aIndex == drone) return beeRoot.isMember(aStack, EnumBeeType.DRONE.ordinal()); + else if(aIndex < getOutputSlot()) { + if(!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack)) + return false; + for(int i = drone+1; i < drone+1+4; i++) + { + if(aIndex == i) + continue; + ItemStack s = getStackInSlot(i); + if(s == null) + continue; + if(GT_Utility.areStacksEqual(getStackInSlot(i), aStack)) + return false; + if(GT_ApiaryUpgrade.isUpgrade(aStack)) + { + if(!GT_ApiaryUpgrade.getUpgrade(aStack).isAllowedToWorkWith(getStackInSlot(i))) + return false; + } + else if(GT_ApiaryUpgrade.isUpgrade(s)) + { + if(!GT_ApiaryUpgrade.getUpgrade(s).isAllowedToWorkWith(aStack)) + return false; + } + } + return true; + } + else return false; + + } + + @Override + public void setInventorySlotContents(int aIndex, ItemStack aStack) { + if(aIndex == queen && aStack != null && getBaseMetaTileEntity().isClientSide()) + usedQueen = aStack.copy(); + super.setInventorySlotContents(aIndex, aStack); + } + + // Gets called on slot click // + public void onInventoryUpdate(int aIndex){ + if(aIndex > drone && aIndex < getOutputSlot()) + updateModifiers(); + } + + @SideOnly(Side.CLIENT) + public ItemStack getUsedQueen(){ + return usedQueen; + } + + //region IBeeHousing + + @Override + public Iterable getBeeModifiers() { + return Collections.singletonList(this); + } + + @Override + public Iterable getBeeListeners() { + return Collections.singletonList(this); + } + + @Override + public IBeeHousingInventory getBeeInventory() { + return this; + } + + @Override + public IBeekeepingLogic getBeekeepingLogic() { + return dummylogic; + } + + @Override + public int getBlockLightValue() { + return this.getBaseMetaTileEntity().getLightLevelAtSide((byte) 1); + } + + @Override + public boolean canBlockSeeTheSky() { + return this.getBaseMetaTileEntity().getSkyAtSide((byte)1); + } + + @Override + public World getWorld() { + return this.getBaseMetaTileEntity().getWorld(); + } + + GameProfile owner = null; + + @Override + public GameProfile getOwner() { + if(owner == null) + owner = new GameProfile(this.getBaseMetaTileEntity().getOwnerUuid(), this.getBaseMetaTileEntity().getOwnerName()); + return owner; + } + + @Override + public Vec3 getBeeFXCoordinates() { + return Vec3.createVectorHelper(getBaseMetaTileEntity().getXCoord() + 0.5, getBaseMetaTileEntity().getYCoord() + 0.5, getBaseMetaTileEntity().getZCoord() + 0.5); + } + + @Override + public BiomeGenBase getBiome() { + if(biomeOverride == null) + return this.getBaseMetaTileEntity().getBiome(); + return biomeOverride; + } + + @Override + public EnumTemperature getTemperature() { + return EnumTemperature.getFromValue(getBiome().temperature + temperatureMod); + } + + @Override + public EnumHumidity getHumidity() { + return EnumHumidity.getFromValue(getBiome().rainfall + humidityMod); + } + + @Override + public IErrorLogic getErrorLogic() { + return this; + } + + @Override + public ChunkCoordinates getCoordinates() { + return this.getBaseMetaTileEntity().getCoords(); + } + + //endregion + +//region IBeeHousingInventory + @Override + public ItemStack getQueen() { + return getStackInSlot(queen); + } + + @Override + public ItemStack getDrone() { + return getStackInSlot(drone); + } + + @Override + public void setQueen(ItemStack itemStack) { + setInventorySlotContents(queen, itemStack); + } + + @Override + public void setDrone(ItemStack itemStack) { + setInventorySlotContents(drone, itemStack); + } + + @Override + public boolean addProduct(ItemStack itemStack, boolean b) { + throw new RuntimeException("Should not happen :F"); + } +//endregion + +//region IErrorLogic + + public HashSet mErrorStates = new HashSet<>(); + + @Override + public boolean setCondition(boolean b, IErrorState iErrorState) { + if(b) + mErrorStates.add(iErrorState); + else + mErrorStates.remove(iErrorState); + return b; + } + + @Override + public boolean contains(IErrorState iErrorState) { + return mErrorStates.contains(iErrorState); + } + + @Override + public boolean hasErrors() { + return !mErrorStates.isEmpty(); + } + + @Override + public void clearErrors() { + mErrorStates.clear(); + } + + @Override + public void writeData(DataOutputStream dataOutputStream) throws IOException { + dataOutputStream.write(mErrorStates.size()); + for(IErrorState s : mErrorStates) + dataOutputStream.writeUTF(s.getUniqueName()); + } + + @Override + public void readData(DataInputStream dataInputStream) throws IOException { + for(int i = dataInputStream.readInt(); i > 0; i--) + mErrorStates.add(ForestryAPI.errorStateRegistry.getErrorState(dataInputStream.readUTF())); + } + + @Override + public ImmutableSet getErrorStates() { + return ImmutableSet.copyOf(mErrorStates); + } + + private String flowerType = ""; + private ChunkCoordinates flowercoords = null; + private Block flowerBlock; + private int flowerBlockMeta; + + + private boolean checkFlower(IBee bee){ + String flowerType = bee.getGenome().getFlowerProvider().getFlowerType(); + if(!this.flowerType.equals(flowerType)) + flowercoords = null; + if(flowercoords != null) { + if( getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ) != flowerBlock + || getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ) != flowerBlockMeta) + if (!FlowerManager.flowerRegistry.isAcceptedFlower(flowerType, getWorld(), flowercoords.posX, flowercoords.posY, flowercoords.posZ)) + flowercoords = null; + else + { + flowerBlock = getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ); + flowerBlockMeta = getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ); + } + } + if(flowercoords == null) { + flowercoords = FlowerManager.flowerRegistry.getAcceptedFlowerCoordinates(this, bee, flowerType); + if(flowercoords != null) + { + flowerBlock = getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ); + flowerBlockMeta = getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ); + this.flowerType = flowerType; + } + } + return flowercoords != null; + } + + private boolean canWork(ItemStack queen){ + clearErrors(); + if(queen == null) + return true; // Reloaded the chunk ? + if(beeRoot.isMember(queen, EnumBeeType.PRINCESS.ordinal())) + return true; + IBee bee = beeRoot.getMember(queen); + for(IErrorState err : bee.getCanWork(this)) + setCondition(true, err); + setCondition(!checkFlower(bee), EnumErrorCode.NO_FLOWER); + return !hasErrors(); + } + + private boolean canWork(){ + clearErrors(); + EnumBeeType beeType = beeRoot.getType(getQueen()); + if(beeType == EnumBeeType.PRINCESS) + { + setCondition(!beeRoot.isDrone(getDrone()), EnumErrorCode.NO_DRONE); + return !hasErrors(); + } + if(beeType == EnumBeeType.QUEEN) + { + IBee bee = beeRoot.getMember(getQueen()); + for(IErrorState err : bee.getCanWork(this)) + setCondition(true, err); + setCondition(!checkFlower(bee), EnumErrorCode.NO_FLOWER); + return !hasErrors(); + } + else + { + setCondition(true, EnumErrorCode.NO_QUEEN); + return false; + } + } + + +//endregion + + //region IBeeModifier + + private float terrorityMod = 1f; + private float mutationMod = 1f; + private float lifespanMod = 1f; + private float productionMod = 1f; + private float floweringMod = 1f; + private float geneticDecayMod = 1f; + private float energyMod = 1f; + private boolean sealedMod = false; + private boolean selfLightedMod = false; + private boolean sunlightSimulatedMod = false; + private BiomeGenBase biomeOverride = null; + private float humidityMod = 0f; + private float temperatureMod = 0f; + private boolean isAutomated = false; + + private int maxspeed = 0; + + public void updateModifiers(){ + maxspeed = 0; + ApiaryModifiers mods = new ApiaryModifiers(); + for(int i = 2; i < 2+4; i++) + { + ItemStack s = getInputAt(i); + if(s == null) + continue; + if(s.getItem() instanceof IApiaryUpgrade) { + IApiaryUpgrade up = (IApiaryUpgrade) s.getItem(); + up.applyModifiers(mods, s); + } + else if(GT_ApiaryUpgrade.isUpgrade(s)) + { + GT_ApiaryUpgrade upgrade = GT_ApiaryUpgrade.getUpgrade(s); + if(upgrade != null) + { + maxspeed = upgrade.applyMaxSpeedModifier(maxspeed); + upgrade.applyModifiers(mods, s); + } + } + } + + + + terrorityMod = mods.territory; + mutationMod = mods.mutation; + lifespanMod = mods.lifespan; + productionMod = mods.production; + floweringMod = mods.flowering; + geneticDecayMod = mods.geneticDecay; + energyMod = mods.energy; + sealedMod = mods.isSealed; + selfLightedMod = mods.isSelfLighted; + sunlightSimulatedMod = mods.isSunlightSimulated; + biomeOverride = mods.biomeOverride; + humidityMod = mods.humidity; + temperatureMod = mods.temperature; + isAutomated = mods.isAutomated; + + if(mLockedSpeed) + mSpeed = maxspeed; + else + mSpeed = Math.min(mSpeed, maxspeed); + } + + @Override + public float getTerritoryModifier(IBeeGenome iBeeGenome, float v) { + return Math.min(5, terrorityMod); + } + + @Override + public float getMutationModifier(IBeeGenome iBeeGenome, IBeeGenome iBeeGenome1, float v) { + return mutationMod; + } + + @Override + public float getLifespanModifier(IBeeGenome iBeeGenome, IBeeGenome iBeeGenome1, float v) { + return lifespanMod; + } + + @Override + public float getProductionModifier(IBeeGenome iBeeGenome, float v) { + return productionMod; + } + + @Override + public float getFloweringModifier(IBeeGenome iBeeGenome, float v) { + return floweringMod; + } + + @Override + public float getGeneticDecay(IBeeGenome iBeeGenome, float v) { + return geneticDecayMod; + } + + public float getEnergyModifier() { + return energyMod; + } + + @Override + public boolean isSealed() { + return sealedMod; + } + + @Override + public boolean isSelfLighted() { + return selfLightedMod; + } + + @Override + public boolean isSunlightSimulated() { + return sunlightSimulatedMod; + } + + + @Override + public boolean isHellish() { + return getBiome() == BiomeGenBase.hell; + } + + public int getMaxSpeed(){ + return maxspeed; + } + + //endregion + + //region IBeeListener + + @Override + public void wearOutEquipment(int i) { + + } + + @Override + public void onQueenDeath() { + + } + + @Override + public boolean onPollenRetrieved(IIndividual iIndividual) { + return false; + } + + + //endregion + + static final IBeekeepingLogic dummylogic = new IBeekeepingLogic() { + @Override + public boolean canWork() { + return true; + } + + @Override + public void doWork() { + + } + + @Override + public void syncToClient() { + + } + + @Override + public void syncToClient(EntityPlayerMP entityPlayerMP) { + + } + + @Override + public int getBeeProgressPercent() { + return 0; + } + + @Override + public boolean canDoBeeFX() { + return false; + } + + @Override + public void doBeeFX() { + + } + + @Override + public void readFromNBT(NBTTagCompound nbtTagCompound) { + + } + + @Override + public void writeToNBT(NBTTagCompound nbtTagCompound) { + + } + }; + + +} diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index 6c085a645b..f423df8ee7 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -13,10 +13,11 @@ import gregtech.common.tileentities.boilers.*; import gregtech.common.tileentities.generators.*; import gregtech.common.tileentities.machines.*; import gregtech.common.tileentities.machines.basic.*; +import gregtech.common.tileentities.machines.long_distance.GT_MetaTileEntity_LongDistancePipelineFluid; +import gregtech.common.tileentities.machines.long_distance.GT_MetaTileEntity_LongDistancePipelineItem; import gregtech.common.tileentities.machines.multi.*; import gregtech.common.tileentities.machines.steam.*; import gregtech.common.tileentities.storage.*; -import gregtech.common.tileentities.machines.long_distance.*; import gregtech.loaders.postload.GT_ProcessingArrayRecipeLoader; import ic2.core.Ic2Items; import net.minecraft.init.Blocks; @@ -693,6 +694,22 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI GT_ModHandler.addCraftingRecipe(ItemList.Machine_EV_Disassembler.get(1L), bitsd, new Object[]{"ACA", aTextWireHull, "ACA", 'M', ItemList.Hull_EV, 'A', ItemList.Robot_Arm_EV, 'C', OrePrefixes.circuit.get(Materials.Data), 'W', OrePrefixes.cableGt01.get(Materials.Aluminium)}); GT_ModHandler.addCraftingRecipe(ItemList.Machine_IV_Disassembler.get(1L), bitsd, new Object[]{"ACA", aTextWireHull, "ACA", 'M', ItemList.Hull_IV, 'A', ItemList.Robot_Arm_IV, 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.cableGt01.get(Materials.Tungsten)}); + if(Loader.isModLoaded("Forestry") && Loader.isModLoaded("gendustry")) { + ItemList.Machine_IndustrialApiary.set(new GT_MetaTileEntity_IndustrialApiary(9399, "basicmachine.industrialapiary", "Industrial Apiary", 8).getStackForm(1L)); + /* Conversion recipe / + / Real recipe is in scripts */ + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Machine_IndustrialApiary.get(1L), new Object[]{GT_ModHandler.getModItem("gendustry", "IndustrialApiary", 1, 0)}); + + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_1.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11100)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_2.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11101)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_3.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11102)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_4.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11103)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_5.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11104)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_6.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11105)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_7.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11106)}); + GT_ModHandler.addCraftingRecipe(ItemList.IndustrialApiary_Upgrade_Acceleration_8.get(1L), bitsd, new Object[]{"PPP", "PAP", "PPP", 'P', GT_ModHandler.getModItem("gendustry", "ApiaryUpgrade", 1, 0), 'A', GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 11107)}); + } + ItemList.Machine_LV_Massfab.set(new GT_MetaTileEntity_Massfabricator(461, "basicmachine.massfab.tier.01", "Basic Mass Fabricator", 1).getStackForm(1L)); ItemList.Machine_MV_Massfab.set(new GT_MetaTileEntity_Massfabricator(462, "basicmachine.massfab.tier.02", "Advanced Mass Fabricator", 2).getStackForm(1L)); ItemList.Machine_HV_Massfab.set(new GT_MetaTileEntity_Massfabricator(463, "basicmachine.massfab.tier.03", "Advanced Mass Fabricator II", 3).getStackForm(1L)); diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index c1e45e9286..1e4caa00f6 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -134,6 +134,28 @@ GT5U.machines.stalled_vent.tooltip.extended=§7Progress was lost, but not GT5U.machines.stalled_vent.tooltip.extended.1=§7the recipe's output. GT5U.machines.oreprocessor=§eRunning Mode: %s §cTime: %s s GT5U.machines.oreprocessor.void=§eVoid Stone Dust: %s +GT5U.machines.industrialapiary.pollen.tooltip=Retrevie Pollen +GT5U.machines.industrialapiary.pollen.tooltip.1=§cWARNING: INCREASES LAG +GT5U.machines.industrialapiary.cancel.tooltip=§cCancel process +GT5U.machines.industrialapiary.cancel.tooltip.1=§7Will also disable machine (soft mallet) +GT5U.machines.industrialapiary.cancel.tooltip.2=§7§oCan't stop princess breeding +GT5U.machines.industrialapiary.speedlocked.tooltip=§rAcceleration: %1$dx §7§o(locked to maximum) +GT5U.machines.industrialapiary.speedlocked.tooltip.1=§7Energy usage: +%2$s EU/t +GT5U.machines.industrialapiary.speedlocked.tooltip.2=§7§oRight-click to unlock +GT5U.machines.industrialapiary.speed.tooltip=Acceleration: %1$dx +GT5U.machines.industrialapiary.speed.tooltip.1=§7Energy usage: +%2$s EU/t +GT5U.machines.industrialapiary.speed.tooltip.2=§7§oRight-click to lock at maximum +GT5U.machines.industrialapiary.info.tooltip=Energy required: %1$s EU/t +GT5U.machines.industrialapiary.info.tooltip.1=Temperature: %2$s +GT5U.machines.industrialapiary.info.tooltip.2=Humidity: %3$s +GT5U.machines.industrialapiary.info.tooltip.3=§7§oInsert analyzed bee to see more info +GT5U.machines.industrialapiary.infoextended.tooltip=Energy required: %1$s EU/t +GT5U.machines.industrialapiary.infoextended.tooltip.1=Temperature: %2$s +GT5U.machines.industrialapiary.infoextended.tooltip.2=Humidity: %3$s +GT5U.machines.industrialapiary.infoextended.tooltip.3=Production Modifier: %4$d %% +GT5U.machines.industrialapiary.infoextended.tooltip.4=Flowering Chance: %5$d %% +GT5U.machines.industrialapiary.infoextended.tooltip.5=Lifespan Modifier: %6$d %% +GT5U.machines.industrialapiary.infoextended.tooltip.6=Terrority: %7$d x %8$d x %9$d GT5U.recipe_filter.representation_slot.tooltip=Click with a machine to set filter diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY.png new file mode 100644 index 0000000000..6c7e63b924 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE.png new file mode 100644 index 0000000000..6c7e63b924 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW.png new file mode 100644 index 0000000000..6c7e63b924 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW.png new file mode 100644 index 0000000000..6c7e63b924 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY.png new file mode 100644 index 0000000000..9676dc210e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png new file mode 100644 index 0000000000..64e96e1a90 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..07dc1943ab --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "frametime": 3 + } +} + diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png new file mode 100644 index 0000000000..d7ac33e480 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta new file mode 100644 index 0000000000..07dc1943ab --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "frametime": 3 + } +} + diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW.png new file mode 100644 index 0000000000..6c7e63b924 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY.png new file mode 100644 index 0000000000..5bbc94f2fd Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png new file mode 100644 index 0000000000..445380129a Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..07dc1943ab --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "frametime": 3 + } +} + diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png new file mode 100644 index 0000000000..175d3cd187 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta new file mode 100644 index 0000000000..07dc1943ab --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": { + "frametime": 3 + } +} + diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW.png new file mode 100644 index 0000000000..6c7e63b924 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY.png new file mode 100644 index 0000000000..d150d18097 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png new file mode 100644 index 0000000000..01718a8a3b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta new file mode 100644 index 0000000000..cd2c2be182 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE.png.mcmeta @@ -0,0 +1,13 @@ +{ + "animation": { + "frametime": 1, + "frames": [ + { "index": 0, "time": 90 }, + { "index": 1, "time": 2 }, + { "index": 0, "time": 1 }, + { "index": 1, "time": 2 }, + + + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png new file mode 100644 index 0000000000..121c7e0266 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta new file mode 100644 index 0000000000..cd2c2be182 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW.png.mcmeta @@ -0,0 +1,13 @@ +{ + "animation": { + "frametime": 1, + "frames": [ + { "index": 0, "time": 90 }, + { "index": 1, "time": 2 }, + { "index": 0, "time": 1 }, + { "index": 1, "time": 2 }, + + + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW.png new file mode 100644 index 0000000000..81e7361539 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW.png differ diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png new file mode 100644 index 0000000000..261f569cd7 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/gui/basicmachines/IndustrialApiary.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/200.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/200.png new file mode 100644 index 0000000000..57e349f48f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/200.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/201.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/201.png new file mode 100644 index 0000000000..183ffe343f Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/201.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/202.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/202.png new file mode 100644 index 0000000000..04a4508383 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/202.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/203.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/203.png new file mode 100644 index 0000000000..6955484d4b Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/203.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/204.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/204.png new file mode 100644 index 0000000000..2f9d227a35 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/204.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/205.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/205.png new file mode 100644 index 0000000000..78a97208a9 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/205.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/206.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/206.png new file mode 100644 index 0000000000..6c90d87036 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/206.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/207.png b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/207.png new file mode 100644 index 0000000000..3f971630a6 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.metaitem.03/207.png differ -- cgit