You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
2.2 KiB
Java
38 lines
2.2 KiB
Java
package net.brokenmoon.afloydironchest.mixin;
|
|
|
|
import net.brokenmoon.afloydironchest.MixinInterfaces.IEntityPlayerMP;
|
|
import net.brokenmoon.afloydironchest.gui.ContainerWideChest;
|
|
import net.minecraft.src.*;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
|
|
@Mixin(value = EntityPlayerMP.class, remap = false)
|
|
public class MixinEntityPlayerMP implements IEntityPlayerMP {
|
|
|
|
@Shadow
|
|
private void getNextWindowId() {}
|
|
|
|
@Shadow
|
|
private int currentWindowId;
|
|
@Shadow
|
|
public NetServerHandler playerNetServerHandler;
|
|
|
|
public void displayGUIIronChest(IInventory iinventory) {
|
|
this.getNextWindowId();
|
|
NetServerHandler.logger.info(((EntityPlayerMP)(Object)this).username + " interacted with chest at (" + ((EntityPlayerMP)(Object)this).posX + ", " + ((EntityPlayerMP)(Object)this).posY + ", " + ((EntityPlayerMP)(Object)this).posZ + ")");
|
|
this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 0, iinventory.getInvName(), iinventory.getSizeInventory()));
|
|
((EntityPlayerMP)(Object)this).craftingInventory = new ContainerChest(((EntityPlayerMP)(Object)this).inventory, iinventory);
|
|
((EntityPlayerMP)(Object)this).craftingInventory.windowId = this.currentWindowId;
|
|
((EntityPlayerMP)(Object)this).craftingInventory.onContainerInit(((EntityPlayerMP)(Object)this));
|
|
}
|
|
|
|
public void displayGUIDiamondChest(IInventory iinventory) {
|
|
this.getNextWindowId();
|
|
NetServerHandler.logger.info(((EntityPlayerMP)(Object)this).username + " interacted with chest at (" + ((EntityPlayerMP)(Object)this).posX + ", " + ((EntityPlayerMP)(Object)this).posY + ", " + ((EntityPlayerMP)(Object)this).posZ + ")");
|
|
this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 7, iinventory.getInvName(), iinventory.getSizeInventory()));
|
|
((EntityPlayerMP)(Object)this).craftingInventory = new ContainerWideChest(((EntityPlayerMP)(Object)this).inventory, iinventory);
|
|
((EntityPlayerMP)(Object)this).craftingInventory.windowId = this.currentWindowId;
|
|
((EntityPlayerMP)(Object)this).craftingInventory.onContainerInit(((EntityPlayerMP)(Object)this));
|
|
}
|
|
}
|