mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
Refactor GUI handling code
This commit is contained in:
1 parent
31231db459
commit
408a66bb40
97 files changed
+1053
-1729
No files matched your search
@@ -0,0 +1,38 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.gui.ContainerImprinter;
|
||||
import forestry.apiculture.gui.GuiImprinter;
|
||||
import forestry.apiculture.inventory.ItemInventoryImprinter;
|
||||
import forestry.core.items.ItemWithGui;
|
||||
|
||||
public class ItemImprinter extends ItemWithGui {
|
||||
public ItemImprinter() {
|
||||
super(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGui(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
return new GuiImprinter(player.inventory, new ItemInventoryImprinter(player, heldItem));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getContainer(EntityPlayer player, ItemStack heldItem, int data) {
|
||||
BeeManager.beeRoot.syncBreedingTrackerToPlayer(player);
|
||||
return new ContainerImprinter(player.inventory, new ItemInventoryImprinter(player, heldItem));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user