net.minecraft.world.WorldSettings.GameType Java Examples
The following examples show how to use
net.minecraft.world.WorldSettings.GameType.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NEIServerUtils.java From NotEnoughItems with MIT License | 5 votes |
public static GameType getGameType(int mode) { switch (mode) { case 0: return GameType.SURVIVAL; case 1: case 2: return GameType.CREATIVE; case 3: return GameType.ADVENTURE; } return null; }
Example #2
Source File: EntityNBTPacket.java From NBTEdit with GNU General Public License v3.0 | 5 votes |
@Override public void handleServerSide(EntityPlayerMP player) { Entity e = player.worldObj.getEntityByID(entityID); if (e != null) { try { GameType preGameType = player.theItemInWorldManager.getGameType(); e.readFromNBT(tag); NBTEdit.log(Level.FINE, player.getCommandSenderName() + " edited a tag -- Entity ID #" + entityID); NBTEdit.logTag(tag); if (e == player) { //Update player info player.sendContainerToPlayer(player.inventoryContainer); GameType type = player.theItemInWorldManager.getGameType(); if (preGameType != type) player.setGameType(type); player.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel())); player.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); player.sendPlayerAbilities(); } sendMessageToPlayer(player, "Your changes have been saved"); } catch(Throwable t) { sendMessageToPlayer(player, SECTION_SIGN + "cSave Failed - Invalid NBT format for Entity"); NBTEdit.log(Level.WARNING, player.getCommandSenderName() + " edited a tag and caused an exception"); NBTEdit.logTag(tag); NBTEdit.throwing("EntityNBTPacket", "handleServerSide", t); } } }
Example #3
Source File: ProxyWorld.java From LookingGlass with GNU General Public License v3.0 | 4 votes |
public ProxyWorld(int dimensionID) { super(Minecraft.getMinecraft().getNetHandler(), new WorldSettings(0L, GameType.SURVIVAL, true, false, WorldType.DEFAULT), dimensionID, Minecraft.getMinecraft().gameSettings.difficulty, Minecraft.getMinecraft().theWorld.theProfiler); }
Example #4
Source File: FakeWorldClient.java From Framez with GNU General Public License v3.0 | 4 votes |
private FakeWorldClient() { super(new NetHandlerPlayClient(Minecraft.getMinecraft(), null, new NetworkManager(true)), new WorldSettings(0, GameType.NOT_SET, false, false, WorldType.DEFAULT), 0, EnumDifficulty.PEACEFUL, Minecraft.getMinecraft().theWorld.theProfiler); }