Fix remaining errors in v1.11

This commit is contained in:
Kirsty McNaught
2017-06-04 10:56:20 +01:00
parent 2df8bf3582
commit 574142ca84
5 changed files with 14 additions and 13 deletions
@@ -101,9 +101,9 @@ public class CraftingKeys {
public void onKeyInput(InputEvent.KeyInputEvent event) { public void onKeyInput(InputEvent.KeyInputEvent event) {
if (KeyBindings.openGuiBinding.isPressed()) { if (KeyBindings.openGuiBinding.isPressed()) {
Logger.info("onKeyInput(e)", "Open Crafting Keys Config Gui."); Logger.info("onKeyInput(e)", "Open Crafting Keys Config Gui.");
Util.client.thePlayer.openGui(instance, GuiConfig.GuiID, Util.client.theWorld, Util.client.player.openGui(instance, GuiConfig.GuiID, Util.client.world,
((int) Util.client.thePlayer.posX), (int) Util.client.thePlayer.posY, ((int) Util.client.player.posX), (int) Util.client.player.posY,
(int) Util.client.thePlayer.posZ); (int) Util.client.player.posZ);
} }
} }
@@ -142,11 +142,11 @@ public class GuiConfig extends GuiScreen {
public void actionPerformed(GuiButton button) { public void actionPerformed(GuiButton button) {
if (button.id == buttonAbortID) { if (button.id == buttonAbortID) {
Logger.info("actionPerformed(b)", "Closing Crafting Keys GUI now!"); Logger.info("actionPerformed(b)", "Closing Crafting Keys GUI now!");
mc.thePlayer.closeScreen(); mc.player.closeScreen();
} else if (button.id == buttonSaveID) { } else if (button.id == buttonSaveID) {
save(); save();
Logger.info("actionPerformed(b)", "Saving & closing Crafting Keys GUI now!"); Logger.info("actionPerformed(b)", "Saving & closing Crafting Keys GUI now!");
mc.thePlayer.closeScreen(); mc.player.closeScreen();
} else if (button.id >= 0 && button.id <= 11) { } else if (button.id >= 0 && button.id <= 11) {
if (selectedButtonID == -1) { if (selectedButtonID == -1) {
selectedButtonID = button.id; selectedButtonID = button.id;
@@ -161,7 +161,7 @@ public abstract class ContainerManager {
void handleNumKey(Slot currentHoveredSlot) { void handleNumKey(Slot currentHoveredSlot) {
// hotbar-slots are always the last 9 slots of the currently opened inventory // hotbar-slots are always the last 9 slots of the currently opened inventory
int hotbarStartIndex = Util.client.thePlayer.openContainer.getInventory().size() - 9 - 1; int hotbarStartIndex = Util.client.player.openContainer.getInventory().size() - 9 - 1;
if (Util.client.currentScreen instanceof GuiInventory) { if (Util.client.currentScreen instanceof GuiInventory) {
hotbarStartIndex -= 1; hotbarStartIndex -= 1;
@@ -505,7 +505,7 @@ public abstract class ContainerManager {
int rightClickData = (rightClick) ? 1 : 0; int rightClickData = (rightClick) ? 1 : 0;
CraftingKeys.proxy.sendSlotClick(Util.client.playerController, container.windowId, index, CraftingKeys.proxy.sendSlotClick(Util.client.playerController, container.windowId, index,
rightClickData, 0, Util.client.thePlayer); rightClickData, 0, Util.client.player);
} }
@@ -61,8 +61,8 @@ public class InputUtil {
// Constants from Minecraft Source Code // Constants from Minecraft Source Code
x -= (guiContainer.width - 176) / 2; x -= (guiContainer.width - 176) / 2;
y -= (guiContainer.height - 166) / 2; y -= (guiContainer.height - 166) / 2;
return x >= slot.xDisplayPosition - 1 && x < slot.xDisplayPosition + 16 + 1 return x >= slot.xPos - 1 && x < slot.xPos + 16 + 1
&& y >= slot.yDisplayPosition - 1 && y < slot.yDisplayPosition + 16 + 1; && y >= slot.yPos - 1 && y < slot.yPos + 16 + 1;
} else { } else {
return false; return false;
} }
@@ -32,7 +32,7 @@ public class Util {
* @return A item stack * @return A item stack
*/ */
public static ItemStack getHeldStack() { public static ItemStack getHeldStack() {
return client.thePlayer.inventory.getItemStack(); return client.player.inventory.getItemStack();
} }
/** /**
@@ -50,10 +50,10 @@ public class Util {
* @return True, if this is the first tick * @return True, if this is the first tick
*/ */
public static boolean isFirstInWorldTick() { public static boolean isFirstInWorldTick() {
if (firstInWorldTick && client.theWorld != null) { if (firstInWorldTick && client.world != null) {
firstInWorldTick = false; firstInWorldTick = false;
return true; return true;
} else if (client.theWorld == null) { } else if (client.world == null) {
firstInWorldTick = true; firstInWorldTick = true;
} }
return false; return false;
@@ -65,7 +65,8 @@ public class Util {
* @param lang_key key from lang-file * @param lang_key key from lang-file
*/ */
public static void printMessage(String lang_key) { public static void printMessage(String lang_key) {
client.thePlayer.addChatMessage(new TextComponentTranslation(lang_key)); String translated = (new TextComponentTranslation(lang_key)).getUnformattedComponentText();
client.player.sendChatMessage(translated);
} }
} }