simple-tech

Minecraft: Better than Adventure! mod that adds simple blocks to automate tasks
git clone git://memoryshards.xyz/simple-tech.git
Log | Files | Refs | README | LICENSE

EntityPlayerSPMixin.java (937B)


      1 package ambos.simpletech.mixin;
      2 
      3 import net.minecraft.client.Minecraft;
      4 import net.minecraft.client.entity.player.EntityPlayerSP;
      5 import net.minecraft.core.entity.player.EntityPlayer;
      6 import net.minecraft.core.world.World;
      7 import org.spongepowered.asm.mixin.Mixin;
      8 import org.spongepowered.asm.mixin.Shadow;
      9 
     10 import ambos.simpletech.IPlayerDisplayer;
     11 import ambos.simpletech.block.entity.TileEntityAllocator;
     12 import ambos.simpletech.gui.GuiAllocator;
     13 
     14 @Mixin(value = EntityPlayerSP.class, remap = false)
     15 public abstract class EntityPlayerSPMixin extends EntityPlayer implements IPlayerDisplayer {
     16     @Shadow
     17     protected Minecraft mc;
     18 
     19     public EntityPlayerSPMixin(World world) {
     20         super(world);
     21     }
     22 
     23     @Override
     24     public void simple_tech$displayGUIAllocator(TileEntityAllocator allocator) {
     25         if (allocator != null) {
     26             this.mc.displayGuiScreen(new GuiAllocator(inventory, allocator));
     27         }
     28     }
     29 }