Skip to content

Commit

Permalink
Compile for 1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay113355 committed Feb 8, 2017
1 parent 7d06e32 commit ae7fc7a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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.
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mcf/davidee/nbtedit/CommandNBTEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <EntityId> OR /nbtedit <TileX> <TileY> <TileZ>";
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mcf/davidee/nbtedit/NBTEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mcf/davidee/nbtedit/NBTHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void nbtWrite(NBTTagCompound compound, DataOutput out) throws IOEx
}

public static Map<String, NBTBase> 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) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mcf/davidee/nbtedit/forge/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mcf/davidee/nbtedit/forge/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/mcf/davidee/nbtedit/gui/GuiEditNBTTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected void actionPerformed(GuiButton b) {
}

public void updateScreen() {
if (!mc.thePlayer.isEntityAlive())
if (!mc.player.isEntityAlive())
quitWithoutSaving();
else
guiTree.updateScreen();
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit ae7fc7a

Please sign in to comment.