mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-21 20:52:11 +00:00
Made gamemode cycling with creative+ inventory as smooth as possible
This commit is contained in:
1 parent
583c8dc7a7
commit
e34189ae9c
3 files changed
+8
-5
No files matched your search
@@ -239,9 +239,13 @@ public class NEIServerUtils
|
||||
!NEIServerConfig.canPlayerPerformAction(player.getCommandSenderName(), NEIActions.gameModes[mode]))
|
||||
return;
|
||||
|
||||
//creative+
|
||||
NEIServerConfig.forPlayer(player.getCommandSenderName()).enableAction("creative+", mode == 2);
|
||||
if(mode == 2 && !(player.openContainer instanceof ContainerCreativeInv))//open the container immediately for the client
|
||||
NEISPH.processCreativeInv(player, true);
|
||||
|
||||
//change it on the server
|
||||
player.theItemInWorldManager.setGameType(getGameType(mode));
|
||||
NEIServerConfig.forPlayer(player.getCommandSenderName()).enableAction("creative+", mode == 2);
|
||||
|
||||
//tell the client to change it
|
||||
new PacketCustom(NEISPH.channel, 14).writeByte(mode).sendToPlayer(player);
|
||||
|
||||
Reference in new issue
Block a user