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.

31 lines
1.5 KiB
Java

package net.brokenmoon.afloydtubemod.mixin;
import net.brokenmoon.afloydtubemod.gui.ContainerTransposer;
import net.brokenmoon.afloydtubemod.mixinInterface.IEntityPlayer;
import net.minecraft.src.EntityPlayerMP;
import net.minecraft.src.IInventory;
import net.minecraft.src.NetServerHandler;
import net.minecraft.src.Packet100OpenWindow;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(value = EntityPlayerMP.class, remap = false)
public class MixinEntityPlayerMP implements IEntityPlayer {
@Shadow
private void getNextWindowId() {}
@Shadow
private int currentWindowId;
@Shadow
public NetServerHandler playerNetServerHandler;
@Override
public void displayGUITransposer(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, 8, iInventory.getInvName(), iInventory.getSizeInventory()));
((EntityPlayerMP)(Object)this).craftingInventory = new ContainerTransposer(((EntityPlayerMP)(Object)this).inventory, iInventory);
((EntityPlayerMP)(Object)this).craftingInventory.windowId = this.currentWindowId;
((EntityPlayerMP)(Object)this).craftingInventory.onContainerInit(((EntityPlayerMP)(Object)this));
}
}