aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-10-02 14:44:06 +1000
committerAlkalus <draknyte1@hotmail.com>2017-10-02 14:44:06 +1000
commit04cb1921bd93e91fd526800d0cc36ff4b1df616c (patch)
tree83891415efa34465788935bb1a01dd3db7e80d29 /src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
parent0a671c03811dce0ed11844cc503db3652c4ee2ef (diff)
downloadGT5-Unofficial-04cb1921bd93e91fd526800d0cc36ff4b1df616c.tar.gz
GT5-Unofficial-04cb1921bd93e91fd526800d0cc36ff4b1df616c.tar.bz2
GT5-Unofficial-04cb1921bd93e91fd526800d0cc36ff4b1df616c.zip
$ Fixed Toluene handling.
% Adjusted Eglin base Compound slightly. - Disabled new, non-working Forestry content.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java')
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java b/src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
new file mode 100644
index 0000000000..d121c920b2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/tileentities/TileDenseBeeHouse.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package gtPlusPlus.xmod.forestry.bees.tileentities;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+
+import net.minecraftforge.common.util.ForgeDirection;
+
+import cpw.mods.fml.common.Optional;
+
+import forestry.api.apiculture.IBeeHousingInventory;
+import forestry.api.apiculture.IBeeListener;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IHiveFrame;
+import forestry.apiculture.ApiaryBeeListener;
+import forestry.apiculture.ApiaryBeeModifier;
+import forestry.apiculture.IApiary;
+import forestry.apiculture.inventory.IApiaryInventory;
+import forestry.apiculture.inventory.InventoryApiary;
+import forestry.apiculture.tiles.TileBeeHousingBase;
+import forestry.apiculture.trigger.ApicultureTriggers;
+import gtPlusPlus.xmod.forestry.bees.gui.ContainerBeeHouse;
+import gtPlusPlus.xmod.forestry.bees.gui.GuiBeeHouse;
+import buildcraft.api.statements.ITriggerExternal;
+
+public class TileDenseBeeHouse extends TileBeeHousingBase implements IApiary {
+ private final IBeeModifier beeModifier = new ApiaryBeeModifier();
+ private final IBeeListener beeListener = new ApiaryBeeListener(this);
+ private final InventoryApiary inventory = new InventoryApiary(getAccessHandler());
+
+ public TileDenseBeeHouse() {
+ super("apiary2");
+ setInternalInventory(inventory);
+ }
+
+ @Override
+ public IBeeHousingInventory getBeeInventory() {
+ return inventory;
+ }
+
+ @Override
+ public IApiaryInventory getApiaryInventory() {
+ return inventory;
+ }
+
+ @Override
+ public Collection<IBeeModifier> getBeeModifiers() {
+ List<IBeeModifier> beeModifiers = new ArrayList<>();
+
+ beeModifiers.add(beeModifier);
+
+ for (IHiveFrame frame : inventory.getFrames()) {
+ beeModifiers.add(frame.getBeeModifier());
+ }
+
+ return beeModifiers;
+ }
+
+ @Override
+ public Iterable<IBeeListener> getBeeListeners() {
+ return Collections.singleton(beeListener);
+ }
+
+ /* ITRIGGERPROVIDER */
+ @Optional.Method(modid = "BuildCraftAPI|statements")
+ @Override
+ public Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile) {
+ LinkedList<ITriggerExternal> res = new LinkedList<>();
+ res.add(ApicultureTriggers.missingQueen);
+ res.add(ApicultureTriggers.missingDrone);
+ res.add(ApicultureTriggers.noFrames);
+ return res;
+ }
+
+ @Override
+ public Object getGui(EntityPlayer player, int data) {
+ ContainerBeeHouse container = new ContainerBeeHouse(player.inventory, this, true);
+ return new GuiBeeHouse<>(this, container, GuiBeeHouse.Icon.APIARY);
+ }
+
+ @Override
+ public Object getContainer(EntityPlayer player, int data) {
+ return new ContainerBeeHouse(player.inventory, this, true);
+ }
+}