By Eris it works on MP.
parent
3206c61a9e
commit
9811e590e7
@ -0,0 +1,29 @@
|
||||
package net.brokenmoon.afloydironchest.mixin;
|
||||
|
||||
import net.brokenmoon.afloydironchest.MixinInterfaces.IEntityPlayerSP;
|
||||
import net.brokenmoon.afloydironchest.tileEntities.TileEntityDiamondChest;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.NetClientHandler;
|
||||
import net.minecraft.src.Packet100OpenWindow;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(value = NetClientHandler.class, remap = false)
|
||||
public class MixinNetClientHandler {
|
||||
|
||||
@Shadow
|
||||
private Minecraft mc;
|
||||
|
||||
@Inject(method = "handleOpenWindow", at = @At("TAIL"))
|
||||
public void injectMethod(Packet100OpenWindow packet100openwindow, CallbackInfo info) {
|
||||
if (packet100openwindow.inventoryType == 7) {
|
||||
TileEntityDiamondChest dchest = new TileEntityDiamondChest();
|
||||
((IEntityPlayerSP)this.mc.thePlayer).displayGUIDiamondChest(dchest);
|
||||
this.mc.thePlayer.craftingInventory.windowId = packet100openwindow.windowId;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.5 KiB |
Loading…
Reference in New Issue