diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
86 files changed, 5715 insertions, 3320 deletions
diff --git a/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java b/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java new file mode 100644 index 0000000000..c83441c350 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/Computronics/HANDLER_Computronics.java @@ -0,0 +1,41 @@ +package gtPlusPlus.xmod.Computronics; + +import gregtech.GT_Mod; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.lib.LoadedMods; + +public class HANDLER_Computronics { + + public static void preInit(){ + if (LoadedMods.Computronics){ + + } + + } + + public static void init(){ + if (LoadedMods.Computronics){ + + } + else { + GT_Mod.gregtechproxy.addFluid("Argon", "Argon", Materials.Argon, 2, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Argon, 1L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), 1000); + GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 1L), Materials.Air.getGas(1000L), Materials.Nitrogen.getGas(780L), 1600, 32, false); + GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 2L), Materials.Air.getGas(1000L), Materials.Oxygen.getGas(210L), 1600, 128, false); + GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 3L), Materials.Air.getGas(1000L), Materials.Argon.getGas(5L), 6000, 512, false); + GT_Values.RA.addElectrolyzerRecipe(ItemList.Cell_Air.get(1), null, null, Materials.Air.getGas(2000L), ItemList.Cell_Empty.get(1), null, null, null, null, null, null, 800, 30); + } + } + + public static void postInit(){ + if (LoadedMods.Computronics){ + + } + + } + + +} diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java new file mode 100644 index 0000000000..6736c54309 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyBeeListener.java @@ -0,0 +1,18 @@ +package gtPlusPlus.xmod.forestry.bees.alveary; + +import forestry.api.apiculture.DefaultBeeListener; +import gtPlusPlus.xmod.forestry.bees.alveary.gui.InventoryFrameHousing; + +public class AlvearyBeeListener extends DefaultBeeListener { + private final IAlvearyFrameHousing apiary; + + public AlvearyBeeListener(IAlvearyFrameHousing apiary) { + this.apiary = apiary; + } + + @Override + public void wearOutEquipment(int amount) { + InventoryFrameHousing apiaryInventory = apiary.getAlvearyInventory(); + apiaryInventory.wearOutFrames(apiary, amount); + } +} diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java new file mode 100644 index 0000000000..6eeefa2696 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyFrameHousing.java @@ -0,0 +1,9 @@ +package gtPlusPlus.xmod.forestry.bees.alveary; + +import forestry.api.apiculture.IBeeHousing; +import gtPlusPlus.xmod.forestry.bees.alveary.gui.InventoryFrameHousing; + +public interface IAlvearyFrameHousing extends IBeeHousing { + InventoryFrameHousing getAlvearyInventory(); + void wearOutFrames(IBeeHousing beeHousing, int amount); +} diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java index 12f97b5f0c..794b5d1be8 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java @@ -14,13 +14,19 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import forestry.api.apiculture.BeeManager; +import forestry.api.apiculture.DefaultBeeListener; import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeListener; import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeekeepingMode; import forestry.api.apiculture.IHiveFrame; +import forestry.api.arboriculture.EnumGermlingType; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.ISpeciesRoot; import forestry.api.multiblock.IAlvearyComponent; -import forestry.apiculture.ApiaryBeeModifier; +import forestry.apiculture.AlvearyBeeModifier; import forestry.apiculture.multiblock.MultiblockLogicAlveary; import forestry.apiculture.network.packets.PacketActiveUpdate; import forestry.apiculture.worldgen.Hive; @@ -32,15 +38,17 @@ import forestry.core.inventory.wrappers.InventoryIterator; import forestry.core.proxy.Proxies; import forestry.core.tiles.IActivatable; import forestry.core.utils.ItemStackUtil; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.forestry.bees.alveary.gui.CONTAINER_FrameHousing; import gtPlusPlus.xmod.forestry.bees.alveary.gui.GUI_FrameHousing; import gtPlusPlus.xmod.forestry.bees.alveary.gui.InventoryFrameHousing; public class TileAlvearyFrameHousing extends FR_TileAlveary -implements ISidedFrameWearingInventory, IActivatable, IAlvearyComponent.Active, IAlvearyComponent.BeeModifier +implements ISidedFrameWearingInventory, IActivatable, IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyFrameHousing, IAlvearyComponent.BeeListener { private final InventoryFrameHousing inventory; + private final IBeeListener beeListener; private final Stack<ItemStack> pendingSpawns = new Stack<ItemStack>(); private boolean active; @@ -48,6 +56,7 @@ implements ISidedFrameWearingInventory, IActivatable, IAlvearyComponent.Active, { super(FR_BlockAlveary.Type.FRAME); this.inventory = new InventoryFrameHousing(this); + this.beeListener = new AlvearyFrameHousingBeeListener(this.inventory); } @@ -66,17 +75,23 @@ implements ISidedFrameWearingInventory, IActivatable, IAlvearyComponent.Active, @Override public void updateServer(int tickCount) { - + if (getInternalInventory() == null) { return; } - + if (this.inventory.getStackInSlot(0) != null) { - setActive(true); - if (tickCount % 1000 == 0) { - wearOutFrames(this, 1); + if (((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeekeepingLogic().canWork()){ + setActive(true); + if (tickCount % 1000 == 0) { + wearOutFrames(this, 1); + } } + else { + Utils.LOG_INFO("Cannot work - Probably no queen alive."); + } + } else { @@ -85,7 +100,7 @@ implements ISidedFrameWearingInventory, IActivatable, IAlvearyComponent.Active, if (tickCount % 500 != 0) { return; } - + } @Override @@ -224,50 +239,51 @@ implements ISidedFrameWearingInventory |
