mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-23 21:49:49 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.craftgui.extratrees.dictionary;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.component.IComponentRecipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotBase;
|
||||
|
||||
public class ControlRecipeSlot extends ControlSlotBase
|
||||
{
|
||||
public ControlRecipeSlot(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 50);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final TileEntity tile = (TileEntity) Window.get(ControlRecipeSlot.this.getWidget()).getInventory();
|
||||
if (tile == null || !(tile instanceof TileEntityMachine)) {
|
||||
return;
|
||||
}
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
Window.get(ControlRecipeSlot.this.getWidget()).sendClientAction("recipe", nbt);
|
||||
}
|
||||
});
|
||||
this.setRotating();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
final IComponentRecipe recipe = Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory());
|
||||
return recipe.isRecipe() ? recipe.getProduct() : null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user