diff --git a/build.gradle b/build.gradle index 7b5fd7f..613550d 100644 --- a/build.gradle +++ b/build.gradle @@ -16,19 +16,19 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.liteloader' -version = "1.1.1" +version = "1.2.0" group = "io.github.kyzderp.liteaccountswitcher" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "liteaccountswitcher" minecraft { - version = "1.10.2" - mappings = "snapshot_20160906" + version = "1.12.2" + mappings = "snapshot_20170929" runDir = "run" } @@ -40,7 +40,7 @@ sourceSets { litemod { json { name = "Lite Account Switcher" - mcversion = "1.10.r1" + mcversion = "1.12.2" author = "Kyzeragon" description = "Ingame Account Switcher for LiteLoader" } diff --git a/src/main/java/io/github/kyzderp/liteaccountswitcher/LiteModAccountSwitcher.java b/src/main/java/io/github/kyzderp/liteaccountswitcher/LiteModAccountSwitcher.java index b7458ff..16c2980 100644 --- a/src/main/java/io/github/kyzderp/liteaccountswitcher/LiteModAccountSwitcher.java +++ b/src/main/java/io/github/kyzderp/liteaccountswitcher/LiteModAccountSwitcher.java @@ -24,17 +24,14 @@ public class LiteModAccountSwitcher implements Tickable private UserFileAccessor userfile; private AccountManager accManager; - @Override public String getName() { return "Lite Account Switcher"; } - @Override - public String getVersion() { return "1.1.1"; } + public String getVersion() { return "1.2.0"; } public LiteModAccountSwitcher() { instance = this; } - @Override public void init(File configPath) { LiteLoader.getInput().registerKeyBinding(keyGui); @@ -42,10 +39,8 @@ public void init(File configPath) this.accManager = new AccountManager(); } - @Override public void upgradeSettings(String version, File configPath, File oldConfigPath) {} - @Override public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, boolean clock) { // Allow switching ingame diff --git a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/EditUserGui.java b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/EditUserGui.java index 4843955..e45f156 100644 --- a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/EditUserGui.java +++ b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/EditUserGui.java @@ -66,10 +66,10 @@ public void initGui() this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 18, "Cancel")); this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 150, "Hide/Show Password")); - this.loginField = new GuiTextField(0, this.fontRendererObj, this.width / 2 - 100, 46, 200, 20); + this.loginField = new GuiTextField(0, this.fontRenderer, this.width / 2 - 100, 46, 200, 20); this.loginField.setFocused(true); - this.notesField = new GuiTextField(1, this.fontRendererObj, this.width / 2 - 100, 86, 200, 20); + this.notesField = new GuiTextField(1, this.fontRenderer, this.width / 2 - 100, 86, 200, 20); this.notesField.setMaxStringLength(18); this.passField = new GuiHiddenTextField(1, this.width / 2 - 100, 126, 200, 20); @@ -209,10 +209,10 @@ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOEx public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 17, 16777215); - this.drawString(this.fontRendererObj, "Username / Email", this.width / 2 - 100, 33, 10526880); - this.drawString(this.fontRendererObj, "Short Note", this.width / 2 - 100, 73, 10526880); - this.drawString(this.fontRendererObj, "Password", this.width / 2 - 100, 113, 10526880); + this.drawCenteredString(this.fontRenderer, this.title, this.width / 2, 17, 16777215); + this.drawString(this.fontRenderer, "Username / Email", this.width / 2 - 100, 33, 10526880); + this.drawString(this.fontRenderer, "Short Note", this.width / 2 - 100, 73, 10526880); + this.drawString(this.fontRenderer, "Password", this.width / 2 - 100, 113, 10526880); this.loginField.drawTextBox(); this.notesField.drawTextBox(); this.passField.drawTextBox(); diff --git a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/GuiHiddenTextField.java b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/GuiHiddenTextField.java index 0f2e3bf..ea3ff02 100644 --- a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/GuiHiddenTextField.java +++ b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/GuiHiddenTextField.java @@ -8,7 +8,7 @@ public class GuiHiddenTextField extends GuiTextField { private boolean showText = false; public GuiHiddenTextField(int id, int x, int y, int width, int height) { - super(id, Minecraft.getMinecraft().fontRendererObj, x, y, width, height); + super(id, Minecraft.getMinecraft().fontRenderer, x, y, width, height); } diff --git a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/KeyInfoGui.java b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/KeyInfoGui.java index c8eb5ae..0008cb2 100644 --- a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/KeyInfoGui.java +++ b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/KeyInfoGui.java @@ -71,7 +71,7 @@ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOEx public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRendererObj, "What is the \"Key\"?", this.width / 2, this.height / 2 - 100, 16777215); + this.drawCenteredString(this.fontRenderer, "What is the \"Key\"?", this.width / 2, this.height / 2 - 100, 16777215); String[] lines = {"Your key is the \"password\" that is used to encrypt your login", "credentials. Think of it as an extra layer of security so that someone", @@ -83,7 +83,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) int y = 0; for (String line: lines) { - this.drawString(this.fontRendererObj, line, this.width / 2 - 180, this.height / 2 - 70 + y, 16777215); + this.drawString(this.fontRenderer, line, this.width / 2 - 180, this.height / 2 - 70 + y, 16777215); y += 14; } diff --git a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistGui.java b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistGui.java index 723f0c1..291da35 100644 --- a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistGui.java +++ b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistGui.java @@ -77,7 +77,7 @@ public void postInit() this.offlineButton.enabled = false; this.deleteButton.enabled = false; - this.keyField = new GuiTextField(0, this.mc.fontRendererObj, this.width / 2 + 29, this.height - 50, 100, 16); + this.keyField = new GuiTextField(0, this.mc.fontRenderer, this.width / 2 + 29, this.height - 50, 100, 16); this.keyField.setFocused(true); this.keyField.setText(Encryption.currentKey); @@ -140,12 +140,12 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.selectionList.drawScreen(mouseX, mouseY, partialTicks); this.keyField.drawTextBox(); - this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRenderer, this.title, this.width / 2, 20, 16777215); if (!this.message.isEmpty()) - this.drawCenteredString(this.fontRendererObj, this.message, this.width / 2, 5, 6618980); + this.drawCenteredString(this.fontRenderer, this.message, this.width / 2, 5, 6618980); - this.drawString(this.fontRendererObj, "Key", this.width / 2 + 5, this.height - 46, 16777215); + this.drawString(this.fontRenderer, "Key", this.width / 2 + 5, this.height - 46, 16777215); super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistSelectionEntry.java b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistSelectionEntry.java index 14db128..79c9680 100644 --- a/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistSelectionEntry.java +++ b/src/main/java/io/github/kyzderp/liteaccountswitcher/gui/UserlistSelectionEntry.java @@ -23,7 +23,7 @@ public UserlistSelectionEntry(UserlistSelectionList listWorldSelIn, AccountInfo this.mc = Minecraft.getMinecraft(); } - public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partialTicks) { int color = 8421504; if (this.account.status.equals("Premium")) @@ -33,11 +33,11 @@ else if (this.account.status.equals("Invalid Credentials") || this.account.status.equals("Wrong Key")) color = 16737380; - this.mc.fontRendererObj.drawString(this.account.username, x + 32 + 3, y + 1, 16777215); - this.mc.fontRendererObj.drawString(this.account.login, x + 32 + 3, y + this.mc.fontRendererObj.FONT_HEIGHT + 3, 8421504); - this.mc.fontRendererObj.drawString(this.account.status, x + 32 + 3, y + this.mc.fontRendererObj.FONT_HEIGHT + this.mc.fontRendererObj.FONT_HEIGHT + 3, color); - int notesWidth = this.mc.fontRendererObj.getStringWidth(this.account.notes); - this.mc.fontRendererObj.drawString(this.account.notes, x + 265 - notesWidth, y + this.mc.fontRendererObj.FONT_HEIGHT + this.mc.fontRendererObj.FONT_HEIGHT + 3, 8421504); + this.mc.fontRenderer.drawString(this.account.username, x + 32 + 3, y + 1, 16777215); + this.mc.fontRenderer.drawString(this.account.login, x + 32 + 3, y + this.mc.fontRenderer.FONT_HEIGHT + 3, 8421504); + this.mc.fontRenderer.drawString(this.account.status, x + 32 + 3, y + this.mc.fontRenderer.FONT_HEIGHT + this.mc.fontRenderer.FONT_HEIGHT + 3, color); + int notesWidth = this.mc.fontRenderer.getStringWidth(this.account.notes); + this.mc.fontRenderer.drawString(this.account.notes, x + 265 - notesWidth, y + this.mc.fontRenderer.FONT_HEIGHT + this.mc.fontRenderer.FONT_HEIGHT + 3, 8421504); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (this.mc.gameSettings.touchscreen || isSelected) @@ -144,4 +144,9 @@ public void delete() { this.containingListSel.deleteEntry(this); } + + public void updatePosition(int slotIndex, int x, int y, float partialTicks) { + // TODO Auto-generated method stub + + } } diff --git a/src/main/java/org/apache/commons/codec/StringEncoderComparator.java b/src/main/java/org/apache/commons/codec/StringEncoderComparator.java index 49e0fa5..ce2b276 100644 --- a/src/main/java/org/apache/commons/codec/StringEncoderComparator.java +++ b/src/main/java/org/apache/commons/codec/StringEncoderComparator.java @@ -71,7 +71,6 @@ public StringEncoderComparator(final StringEncoder stringEncoder) { * @return the Comparable.compareTo() return code or 0 if an encoding error was caught. * @see Comparable */ - @Override public int compare(final Object o1, final Object o2) { int compareCode = 0; diff --git a/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java b/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java index 0e5a0cd..e1f8398 100644 --- a/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java +++ b/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java @@ -330,7 +330,6 @@ protected static boolean isWhiteSpace(final byte byteToCheck) { * @throws EncoderException * if the parameter supplied is not of type byte[] */ - @Override public Object encode(final Object obj) throws EncoderException { if (!(obj instanceof byte[])) { throw new EncoderException("Parameter supplied to Base-N encode is not a byte[]"); @@ -372,7 +371,6 @@ public String encodeAsString(final byte[] pArray){ * @throws DecoderException * if the parameter supplied is not of type byte[] */ - @Override public Object decode(final Object obj) throws DecoderException { if (obj instanceof byte[]) { return decode((byte[]) obj); @@ -401,7 +399,6 @@ public byte[] decode(final String pArray) { * A byte array containing Base-N character data * @return a byte array containing binary data */ - @Override public byte[] decode(final byte[] pArray) { if (pArray == null || pArray.length == 0) { return pArray; @@ -421,7 +418,6 @@ public byte[] decode(final byte[] pArray) { * a byte array containing binary data * @return A byte array containing only the basen alphabetic character data */ - @Override public byte[] encode(final byte[] pArray) { if (pArray == null || pArray.length == 0) { return pArray; diff --git a/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java b/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java index 9d8bfee..b9413cb 100644 --- a/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java +++ b/src/main/java/org/apache/commons/codec/binary/BinaryCodec.java @@ -78,7 +78,6 @@ public class BinaryCodec implements BinaryDecoder, BinaryEncoder { * @return 0 and 1 ASCII character bytes one for each bit of the argument * @see org.apache.commons.codec.BinaryEncoder#encode(byte[]) */ - @Override public byte[] encode(final byte[] raw) { return toAsciiBytes(raw); } @@ -93,7 +92,6 @@ public byte[] encode(final byte[] raw) { * if the argument is not a byte[] * @see org.apache.commons.codec.Encoder#encode(Object) */ - @Override public Object encode(final Object raw) throws EncoderException { if (!(raw instanceof byte[])) { throw new EncoderException("argument not a byte array"); @@ -111,7 +109,6 @@ public Object encode(final Object raw) throws EncoderException { * if argument is not a byte[], char[] or String * @see org.apache.commons.codec.Decoder#decode(Object) */ - @Override public Object decode(final Object ascii) throws DecoderException { if (ascii == null) { return EMPTY_BYTE_ARRAY; @@ -136,7 +133,6 @@ public Object decode(final Object ascii) throws DecoderException { * @return the raw encoded binary where each bit corresponds to a byte in the byte array argument * @see org.apache.commons.codec.Decoder#decode(Object) */ - @Override public byte[] decode(final byte[] ascii) { return fromAscii(ascii); } diff --git a/src/main/java/org/apache/commons/codec/binary/Hex.java b/src/main/java/org/apache/commons/codec/binary/Hex.java index c9f1237..4fee6b0 100644 --- a/src/main/java/org/apache/commons/codec/binary/Hex.java +++ b/src/main/java/org/apache/commons/codec/binary/Hex.java @@ -227,7 +227,6 @@ public Hex(final String charsetName) { * Thrown if an odd number of characters is supplied to this function * @see #decodeHex(char[]) */ - @Override public byte[] decode(final byte[] array) throws DecoderException { return decodeHex(new String(array, getCharset()).toCharArray()); } @@ -245,7 +244,6 @@ public byte[] decode(final byte[] array) throws DecoderException { * char[] * @see #decodeHex(char[]) */ - @Override public Object decode(final Object object) throws DecoderException { try { final char[] charArray = object instanceof String ? ((String) object).toCharArray() : (char[]) object; @@ -270,7 +268,6 @@ public Object decode(final Object object) throws DecoderException { * @since 1.7 No longer throws IllegalStateException if the charsetName is invalid. * @see #encodeHex(byte[]) */ - @Override public byte[] encode(final byte[] array) { return encodeHexString(array).getBytes(this.getCharset()); } @@ -291,7 +288,6 @@ public byte[] encode(final byte[] array) { * Thrown if the given object is not a String or byte[] * @see #encodeHex(byte[]) */ - @Override public Object encode(final Object object) throws EncoderException { try { final byte[] byteArray = object instanceof String ? diff --git a/src/main/resources/assets/liteaccountswitcher/lang/en_US.lang b/src/main/resources/assets/liteaccountswitcher/lang/en_us.lang similarity index 100% rename from src/main/resources/assets/liteaccountswitcher/lang/en_US.lang rename to src/main/resources/assets/liteaccountswitcher/lang/en_us.lang