/******************************************************************************* * 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 forestry.apiculture.tiles; import java.util.Collections; import net.minecraft.entity.player.EntityPlayer; import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.DefaultBeeListener; import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; import forestry.api.apiculture.IBeeModifier; import forestry.apiculture.BeehouseBeeModifier; import forestry.apiculture.InventoryBeeHousing; import forestry.apiculture.gui.ContainerBeeHousing; import forestry.apiculture.gui.GuiBeeHousing; public class TileBeehouse extends TileBeeHousingBase { private static final IBeeModifier beeModifier = new BeehouseBeeModifier(); private final IBeeListener beeListener; private final InventoryBeeHousing beeInventory; public TileBeehouse() { super("bee.house"); this.beeListener = new DefaultBeeListener(); beeInventory = new InventoryBeeHousing(12, getAccessHandler()); beeInventory.disableAutomation(); setInternalInventory(beeInventory); } @Override public IBeeHousingInventory getBeeInventory() { return beeInventory; } @Override public Iterable getBeeModifiers() { return Collections.singleton(beeModifier); } @Override public Iterable getBeeListeners() { return Collections.singleton(beeListener); } @Override public Object getGui(EntityPlayer player, int data) { ContainerBeeHousing container = new ContainerBeeHousing(player.inventory, this, false); return new GuiBeeHousing<>(this, container, GuiBeeHousing.Icon.BEE_HOUSE); } @Override public Object getContainer(EntityPlayer player, int data) { BeeManager.beeRoot.syncBreedingTrackerToPlayer(player); return new ContainerBeeHousing(player.inventory, this, false); } }