diff --git a/build.gradle b/build.gradle index 5d0c3d3..a4e48a8 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ repositories { apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.11-2.0.2" +version = "1.11.2-2.0.2" group = "com.mcf.davidee.nbtedit" archivesBaseName = "NBTEdit" @@ -29,9 +29,9 @@ sourceCompatibility = targetCompatibility = 1.7 idea { module { inheritOutputDirs = true } } minecraft { - version = "1.11-13.19.1.2189" + version = "1.11.2-13.20.0.2227" runDir = "run" - mappings = "snapshot_20161111" + mappings = "snapshot_20161220" //makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } diff --git a/src/main/java/com/mcf/davidee/nbtedit/CommandNBTEdit.java b/src/main/java/com/mcf/davidee/nbtedit/CommandNBTEdit.java index 8822f68..40223fc 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/CommandNBTEdit.java +++ b/src/main/java/com/mcf/davidee/nbtedit/CommandNBTEdit.java @@ -14,12 +14,12 @@ public class CommandNBTEdit extends CommandBase { @Override - public String getCommandName() { + public String getName() { return "nbtedit"; } @Override - public String getCommandUsage(ICommandSender sender) { + public String getUsage(ICommandSender sender) { return "/nbtedit OR /nbtedit OR /nbtedit "; } diff --git a/src/main/java/com/mcf/davidee/nbtedit/NBTEdit.java b/src/main/java/com/mcf/davidee/nbtedit/NBTEdit.java index 6fd2974..f50c0b1 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/NBTEdit.java +++ b/src/main/java/com/mcf/davidee/nbtedit/NBTEdit.java @@ -30,7 +30,7 @@ public class NBTEdit { public static final String MODID = "nbtedit"; public static final String NAME = "In-game NBTEdit"; - public static final String VERSION = "1.11-2.0.2"; + public static final String VERSION = "1.11.2-2.0.2"; public static final NBTNodeSorter SORTER = new NBTNodeSorter(); public static final PacketHandler NETWORK = new PacketHandler(); diff --git a/src/main/java/com/mcf/davidee/nbtedit/NBTHelper.java b/src/main/java/com/mcf/davidee/nbtedit/NBTHelper.java index a5e44e3..74b5a50 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/NBTHelper.java +++ b/src/main/java/com/mcf/davidee/nbtedit/NBTHelper.java @@ -24,7 +24,7 @@ public static void nbtWrite(NBTTagCompound compound, DataOutput out) throws IOEx } public static Map getMap(NBTTagCompound tag) { - return ReflectionHelper.getPrivateValue(NBTTagCompound.class, tag, 0); + return ReflectionHelper.getPrivateValue(NBTTagCompound.class, tag, 1); } public static NBTBase getTagAt(NBTTagList tag, int index) { diff --git a/src/main/java/com/mcf/davidee/nbtedit/forge/ClientProxy.java b/src/main/java/com/mcf/davidee/nbtedit/forge/ClientProxy.java index da72baf..d26856c 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/forge/ClientProxy.java +++ b/src/main/java/com/mcf/davidee/nbtedit/forge/ClientProxy.java @@ -79,7 +79,7 @@ public void run() { public void sendMessage(EntityPlayer player, String message, TextFormatting color) { ITextComponent component = new TextComponentString(message); component.getStyle().setColor(color); - Minecraft.getMinecraft().thePlayer.addChatMessage(component); + Minecraft.getMinecraft().player.sendMessage(component); } @SubscribeEvent @@ -95,7 +95,7 @@ else if (screen.isTileEntity()) { int x = screen.getBlockX(); int y = screen.y; int z = screen.z; - World world = Minecraft.getMinecraft().theWorld; + World world = Minecraft.getMinecraft().world; BlockPos pos = new BlockPos(x, y, z); IBlockState state = world.getBlockState(pos); Block block = world.getBlockState(pos).getBlock(); diff --git a/src/main/java/com/mcf/davidee/nbtedit/forge/CommonProxy.java b/src/main/java/com/mcf/davidee/nbtedit/forge/CommonProxy.java index 7003b25..7eb03c5 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/forge/CommonProxy.java +++ b/src/main/java/com/mcf/davidee/nbtedit/forge/CommonProxy.java @@ -28,12 +28,12 @@ public void sendMessage(EntityPlayer player, String message, TextFormatting colo if (player != null) { ITextComponent component = new TextComponentString(message); component.getStyle().setColor(color); - player.addChatMessage(component); + player.sendMessage(component); } } public boolean checkPermission(EntityPlayer player) { - if (NBTEdit.opOnly ? player.canCommandSenderUseCommand(4, NBTEdit.MODID) : player.capabilities.isCreativeMode) { + if (NBTEdit.opOnly ? player.canUseCommand(4, NBTEdit.MODID) : player.capabilities.isCreativeMode) { return true; } return false; diff --git a/src/main/java/com/mcf/davidee/nbtedit/gui/GuiEditNBTTree.java b/src/main/java/com/mcf/davidee/nbtedit/gui/GuiEditNBTTree.java index 7dced06..cdd12ff 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/gui/GuiEditNBTTree.java +++ b/src/main/java/com/mcf/davidee/nbtedit/gui/GuiEditNBTTree.java @@ -110,7 +110,7 @@ protected void actionPerformed(GuiButton b) { } public void updateScreen() { - if (!mc.thePlayer.isEntityAlive()) + if (!mc.player.isEntityAlive()) quitWithoutSaving(); else guiTree.updateScreen(); @@ -145,7 +145,7 @@ public boolean doesGuiPauseGame() { } public Entity getEntity() { - return entity ? mc.theWorld.getEntityByID(entityOrX) : null; + return entity ? mc.world.getEntityByID(entityOrX) : null; } public boolean isTileEntity() { diff --git a/src/main/java/com/mcf/davidee/nbtedit/gui/GuiSaveSlotButton.java b/src/main/java/com/mcf/davidee/nbtedit/gui/GuiSaveSlotButton.java index aa2dbcf..a08b1f1 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/gui/GuiSaveSlotButton.java +++ b/src/main/java/com/mcf/davidee/nbtedit/gui/GuiSaveSlotButton.java @@ -90,7 +90,7 @@ private void updatePosition() { width = mc.fontRendererObj.getStringWidth(text) + 24; if (width % 2 == 1) ++width; - width = MathHelper.clamp_int(width, MIN_WIDTH, MAX_WIDTH); + width = MathHelper.clamp(width, MIN_WIDTH, MAX_WIDTH); x = rightX - width; } diff --git a/src/main/java/com/mcf/davidee/nbtedit/packets/EntityNBTPacket.java b/src/main/java/com/mcf/davidee/nbtedit/packets/EntityNBTPacket.java index c369f78..06dc00f 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/packets/EntityNBTPacket.java +++ b/src/main/java/com/mcf/davidee/nbtedit/packets/EntityNBTPacket.java @@ -58,7 +58,7 @@ public IMessage onMessage(final EntityNBTPacket packet, MessageContext ctx) { player.getServerWorld().addScheduledTask(new Runnable() { @Override public void run() { - Entity entity = player.worldObj.getEntityByID(packet.entityID); + Entity entity = player.getServerWorld().getEntityByID(packet.entityID); if (entity != null && NBTEdit.proxy.checkPermission(player)) { try { GameType preGameType = null; diff --git a/src/main/java/com/mcf/davidee/nbtedit/packets/TileNBTPacket.java b/src/main/java/com/mcf/davidee/nbtedit/packets/TileNBTPacket.java index 85083c0..dc2e65b 100644 --- a/src/main/java/com/mcf/davidee/nbtedit/packets/TileNBTPacket.java +++ b/src/main/java/com/mcf/davidee/nbtedit/packets/TileNBTPacket.java @@ -57,12 +57,12 @@ public IMessage onMessage(final TileNBTPacket packet, MessageContext ctx) { player.getServerWorld().addScheduledTask(new Runnable() { @Override public void run() { - TileEntity te = player.worldObj.getTileEntity(packet.pos); + TileEntity te = player.getServerWorld().getTileEntity(packet.pos); if (te != null && NBTEdit.proxy.checkPermission(player)) { try { te.readFromNBT(packet.tag); te.markDirty();// Ensures changes gets saved to disk later on. - if (te.hasWorldObj() && te.getWorld() instanceof WorldServer) { + if (te.hasWorld() && te.getWorld() instanceof WorldServer) { ((WorldServer) te.getWorld()).getPlayerChunkMap().markBlockForUpdate(packet.pos);// Broadcast changes. } NBTEdit.log(Level.TRACE, player.getName() + " edited a tag -- Tile Entity at " + packet.pos.getX() + ", " + packet.pos.getY() + ", " + packet.pos.getZ());