mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 14:39:43 +00:00
Make Save PlayerData within PlayerData. More multithreaded saving
This commit is contained in:
1 parent
cf82314181
commit
221f00ccf4
17 files changed
+120
-101
No files matched your search
@@ -27,12 +27,12 @@ public class CustomGuiController {
|
||||
EntityPlayerMP entityPlayerMP = (EntityPlayerMP) player.getMCEntity();
|
||||
entityPlayerMP.openGui(CustomNpcs.instance, EnumGuiType.CustomGui.ordinal(), player.getWorld().getMCWorld(), gui.getSlots().size(), 0, 0);
|
||||
((ContainerCustomGui)((EntityPlayerMP)player.getMCEntity()).openContainer).setGui(gui, (EntityPlayer)player.getMCEntity());
|
||||
Server.sendData((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.GUI_DATA, new Object[]{gui.toNBT()});
|
||||
Server.sendDataChecked((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.GUI_DATA, new Object[]{gui.toNBT()});
|
||||
}
|
||||
|
||||
public static boolean updateGui(IPlayer player, ScriptGui gui) {
|
||||
if (((EntityPlayerMP)player.getMCEntity()).openContainer instanceof ContainerCustomGui) {
|
||||
Server.sendData((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.GUI_DATA, new Object[]{gui.toNBT()});
|
||||
Server.sendDataChecked((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.GUI_DATA, new Object[]{gui.toNBT()});
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -40,11 +40,11 @@ public class CustomGuiController {
|
||||
}
|
||||
|
||||
public static void openOverlay(IPlayer player, ScriptOverlay gui) {
|
||||
Server.sendData((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.SCRIPT_OVERLAY_DATA, new Object[]{gui.toNBT()});
|
||||
Server.sendDataChecked((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.SCRIPT_OVERLAY_DATA, new Object[]{gui.toNBT()});
|
||||
}
|
||||
|
||||
public static boolean updateOverlay(IPlayer player, ScriptOverlay gui) {
|
||||
Server.sendData((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.SCRIPT_OVERLAY_DATA, new Object[]{gui.toNBT()});
|
||||
Server.sendDataChecked((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.SCRIPT_OVERLAY_DATA, new Object[]{gui.toNBT()});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user