-
-
Save Keridos/9ce33a4eafa657a80c2336b932b14412 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MessageHandlerOpenGUI implements IMessageHandler<MessageOpenGUI, IMessage> { | |
@Override | |
@SideOnly(Side.SERVER) | |
@SuppressWarnings("deprecation") | |
public IMessage onMessage(MessageOpenGUI messageIn, MessageContext ctx) { | |
final MessageOpenGUI message = messageIn; | |
final EntityPlayerMP player = ctx.getServerHandler().player; | |
Minecraft.getMinecraft().addScheduledTask(() -> { | |
World world = player.world; | |
TileEntity te = world.getTileEntity(new BlockPos(message.x, message.y, message.z)); | |
if (te instanceof ISyncable) { | |
((ISyncable) te).getSyncPlayerList().add(player); | |
Logger.getGlobal().severe("added player to list"); | |
} | |
}); | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment