aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/common/covers/GT_Cover_Crafting.java
blob: 4eea9bca94d278399a2af57e594bb49025334f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package gregtech.common.covers;

import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.util.GT_CoverBehavior;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.play.server.S2DPacketOpenWindow;
import net.minecraft.world.World;

public class GT_Cover_Crafting
  extends GT_CoverBehavior
{
  public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
  {
    if ((aPlayer instanceof EntityPlayerMP))
    {
      ((EntityPlayerMP)aPlayer).getNextWindowId();
      ((EntityPlayerMP)aPlayer).playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(((EntityPlayerMP)aPlayer).currentWindowId, 1, "Crafting", 9, true));
      ((EntityPlayerMP)aPlayer).openContainer = new ContainerWorkbench(((EntityPlayerMP)aPlayer).inventory, ((EntityPlayerMP)aPlayer).worldObj, aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord())
      {
        public boolean canInteractWith(EntityPlayer par1EntityPlayer)
        {
          return true;
        }
      };
      ((EntityPlayerMP)aPlayer).openContainer.windowId = ((EntityPlayerMP)aPlayer).currentWindowId;
      ((EntityPlayerMP)aPlayer).openContainer.addCraftingToCrafters((EntityPlayerMP)aPlayer);
    }
    return true;
  }
}



/* Location:           F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar

 * Qualified Name:     gregtech.common.covers.GT_Cover_Crafting

 * JD-Core Version:    0.7.0.1

 */