mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-29 18:28:34 +01:00
parent
90c1f2c25f
commit
5e63208098
2 changed files with 18 additions and 12 deletions
|
@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBookletStand;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -67,7 +68,10 @@ public final class PacketHandler{
|
||||||
|
|
||||||
if(tile instanceof IButtonReactor){
|
if(tile instanceof IButtonReactor){
|
||||||
IButtonReactor reactor = (IButtonReactor)tile;
|
IButtonReactor reactor = (IButtonReactor)tile;
|
||||||
reactor.onButtonPressed(compound.getInteger("ButtonID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID")));
|
Entity entity = world.getEntityByID(compound.getInteger("PlayerID"));
|
||||||
|
if(entity != null && entity instanceof EntityPlayer){
|
||||||
|
reactor.onButtonPressed(compound.getInteger("ButtonID"), (EntityPlayer)entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class TileEntityGiantChest extends TileEntityInventoryBase implements IBu
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onButtonPressed(int buttonID, EntityPlayer player){
|
public void onButtonPressed(int buttonID, EntityPlayer player){
|
||||||
|
if(player != null && this.pos != null){
|
||||||
GuiHandler.GuiTypes type;
|
GuiHandler.GuiTypes type;
|
||||||
|
|
||||||
if(buttonID == 0){
|
if(buttonID == 0){
|
||||||
|
@ -59,4 +60,5 @@ public class TileEntityGiantChest extends TileEntityInventoryBase implements IBu
|
||||||
|
|
||||||
player.openGui(ActuallyAdditions.instance, type.ordinal(), this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ());
|
player.openGui(ActuallyAdditions.instance, type.ordinal(), this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue