diff options
| author | Moulberry <jjenour@student.unimelb.edu.au> | 2021-10-13 15:46:13 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-13 15:46:13 +0800 |
| commit | b11742988dec635b5c5da7c2363803cbfafb37b1 (patch) | |
| tree | d161c7ab2f675dd1f82d2fe8194d7e62bbdaac0a /src | |
| parent | 8eee6262a6e2c372240331f3c43c2279bd18539e (diff) | |
| parent | 030f72bb49ab4bca0c35899090550432c5aa0bea (diff) | |
| download | NotEnoughUpdates-2.0.0.tar.gz NotEnoughUpdates-2.0.0.tar.bz2 NotEnoughUpdates-2.0.0.zip | |
Merge pull request #231 from DoKM/master2.0.0
DoKM Fork Merge
Diffstat (limited to 'src')
38 files changed, 2110 insertions, 1501 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index e0a36686..42b53ef2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -19,10 +19,7 @@ import io.github.moulberry.notenoughupdates.overlays.*; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.util.*; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.*; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiEditSign; @@ -30,12 +27,9 @@ import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -166,7 +160,7 @@ public class NEUEventListener { @SubscribeEvent public void onWorldLoad(WorldEvent.Unload event) { NotEnoughUpdates.INSTANCE.saveConfig(); - CrystalMetalDetectorSolver.reset(); + CrystalMetalDetectorSolver.reset(false); } private static long notificationDisplayMillis = 0; @@ -206,7 +200,9 @@ public class NEUEventListener { @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { - Keyboard.enableRepeatEvents(false); + if(Minecraft.getMinecraft().currentScreen == null || !(Minecraft.getMinecraft().currentScreen instanceof GuiChat)) { + Keyboard.enableRepeatEvents(false); + } if(event.phase != TickEvent.Phase.START) return; if(Minecraft.getMinecraft().theWorld == null) return; if(Minecraft.getMinecraft().thePlayer == null) return; @@ -862,7 +858,7 @@ public class NEUEventListener { } } if (unformatted.startsWith("You found ") && SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows")){ - CrystalMetalDetectorSolver.reset(); + CrystalMetalDetectorSolver.reset(true); } if(unformatted.startsWith("[NPC] Keeper of ") | unformatted.startsWith("[NPC] Professor Robot: ") || unformatted.startsWith(" ") || unformatted.startsWith("✦") || unformatted.equals(" You've earned a Crystal Loot Bundle!")) @@ -1429,8 +1425,8 @@ public class NEUEventListener { GuiChest eventGui = (GuiChest) guiScreen; ContainerChest cc = (ContainerChest) eventGui.inventorySlots; containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); - if(containerName.contains(" Profile") && eventGui.isMouseOverSlot(cc.inventorySlots.get(42), mouseX, mouseY) - && Mouse.getEventButton() >= 0) { + if(containerName.contains(" Profile") && BetterContainers.profileViewerStackIndex != -1 && + eventGui.isMouseOverSlot(cc.inventorySlots.get(BetterContainers.profileViewerStackIndex), mouseX, mouseY) && Mouse.getEventButton() >= 0) { event.setCanceled(true); if(Mouse.getEventButtonState() && eventGui.inventorySlots.inventorySlots.get(22).getStack() != null && eventGui.inventorySlots.inventorySlots.get(22).getStack().getTagCompound() != null){ @@ -1438,7 +1434,7 @@ public class NEUEventListener { if(tag.hasKey("SkullOwner") && tag.getCompoundTag("SkullOwner").hasKey("Name")){ String username = tag.getCompoundTag("SkullOwner").getString("Name"); Utils.playPressSound(); - NotEnoughUpdates.INSTANCE.viewProfileRunnable.processCommand(null, new String[]{username}); + NotEnoughUpdates.INSTANCE.commands.viewProfileRunnable.processCommand(null, new String[]{username}); } } } @@ -1728,30 +1724,7 @@ public class NEUEventListener { } } - private static String[] rarityArrC = new String[] { - EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", - EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", - EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", - EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", - EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", - EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", - }; - private static final HashMap<String, String> rarityArrMap = new HashMap<>(); - static { - rarityArrMap.put("COMMON", rarityArrC[0]); - rarityArrMap.put("UNCOMMON", rarityArrC[1]); - rarityArrMap.put("RARE", rarityArrC[2]); - rarityArrMap.put("EPIC", rarityArrC[3]); - rarityArrMap.put("LEGENDARY", rarityArrC[4]); - rarityArrMap.put("MYTHIC", rarityArrC[5]); - rarityArrMap.put("SPECIAL", rarityArrC[6]); - rarityArrMap.put("VERY SPECIAL", rarityArrC[7]); - rarityArrMap.put("SUPREME", rarityArrC[8]); - } private HashSet<String> percentStats = new HashSet<>(); { @@ -1826,9 +1799,9 @@ public class NEUEventListener { out: for (int i = list.tagCount(); i >= 0; i--) { String line = list.getStringTagAt(i); - for(int j=0; j<rarityArrC.length; j++) { + for(int j=0; j<Utils.rarityArrC.length; j++) { for(Map.Entry<String, JsonElement> entry : enchantsObj.entrySet()) { - if(line.contains(rarityArrC[j] + " " + entry.getKey()) || line.contains(rarityArrC[j] + " DUNGEON " + entry.getKey())) { + if(line.contains(Utils.rarityArrC[j] + " " + entry.getKey()) || line.contains(Utils.rarityArrC[j] + " DUNGEON " + entry.getKey())) { allItemEnchs = entry.getValue().getAsJsonArray(); break out; } @@ -1907,7 +1880,7 @@ public class NEUEventListener { JsonElement statsE = reforgeInfo.get("reforgeStats"); - String rarityFormatted = rarityArrMap.getOrDefault(rarity, rarity); + String rarityFormatted = Utils.rarityArrMap.getOrDefault(rarity, rarity); JsonElement reforgeAbilityE = reforgeInfo.get("reforgeAbility"); String reforgeAbility = null; @@ -2072,17 +2045,18 @@ public class NEUEventListener { //9([a-zA-Z ]+?) ([0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X))(,|$) Pattern pattern; try { - pattern = Pattern.compile("(\\u00A79|\\u00A79\\u00A7d\\u00A7l)("+enchantName+") " + - "([0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX))(,|$)"); + pattern = Pattern.compile("(\\u00A79|\\u00A7(9|l)\\u00A7d\\u00A7l)(?<enchantName>"+enchantName+") " + + "(?<level>[0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX))((\\u00A79)?,|( \\u00A78(?:,?[0-9]+)*)?$)"); } catch(Exception e) {continue;} //malformed regex Matcher matcher = pattern.matcher(line); int matchCount = 0; while(matcher.find() && matchCount < 5) { - if(Utils.cleanColour(matcher.group(2)).startsWith(" ")) continue; + if(Utils.cleanColour(matcher.group("enchantName")).startsWith(" ")) continue; + matchCount++; int level = -1; - String levelStr = matcher.group(matcher.groupCount()-2); + String levelStr = matcher.group("level"); if(levelStr == null) continue; try { level = Integer.parseInt(levelStr); @@ -2142,7 +2116,7 @@ public class NEUEventListener { } } if(matches) { - String enchantText = matcher.group(2); + String enchantText = matcher.group("enchantName"); StringBuilder extraModifiersBuilder = new StringBuilder(); if((modifierI & GuiEnchantColour.BOLD_MODIFIER) != 0) { @@ -2168,6 +2142,8 @@ public class NEUEventListener { "\u00A7"+colourCode+extraMods+enchantText); line = line.replace("\u00A79\u00A7d\u00A7l"+enchantText, "\u00A7"+colourCode+extraMods+enchantText); + line = line.replace("\u00A7l\u00A7d\u00A7l"+enchantText, + "\u00A7"+colourCode+extraMods+enchantText); } else { int offset = Minecraft.getMinecraft().fontRendererObj.getStringWidth(line.replaceAll( "\\u00A79"+enchantText+".*", "")); @@ -2177,6 +2153,10 @@ public class NEUEventListener { "\\u00A79\\u00A7d\\u00A7l"+enchantText+".*", "")); line = line.replace("\u00A79\u00A7d\u00A7l"+enchantText, Utils.chromaString(enchantText, offset/12f+index, true)); + offset = Minecraft.getMinecraft().fontRendererObj.getStringWidth(line.replaceAll( + "\\u00A7l\\u00A7d\\u00A7l"+enchantText+".*", "")); + line = line.replace("\u00A7l\u00A7d\u00A7l"+enchantText, Utils.chromaString(enchantText, + offset/12f+index, true)); } } } @@ -2406,7 +2386,7 @@ public class NEUEventListener { } //7 is just a random number i chose, prob no pets with less lines than 7 if (event.toolTip.size() > 7) { - if (Utils.cleanColour(event.toolTip.get(1)).matches("((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)).*")) { + if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) { GuiProfileViewer.PetLevel petlevel = null; @@ -2442,12 +2422,14 @@ public class NEUEventListener { } return tooltipText; } + + private static final String petToolTipRegex = "((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)|(Morph)).*"; private void petToolTipXPExtendPetMenu(ItemTooltipEvent event) { if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { //7 is just a random number i chose, prob no pets with less lines than 7 if (event.toolTip.size() > 7) { - if (Utils.cleanColour(event.toolTip.get(1)).matches("((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)).*")) { + if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) { GuiProfileViewer.PetLevel petlevel = null; int xpLine = -1; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 5eb0f861..6a0d3ab4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -8,6 +8,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; import io.github.moulberry.notenoughupdates.collectionlog.GuiCollectionLog; +import io.github.moulberry.notenoughupdates.commands.Commands; import io.github.moulberry.notenoughupdates.commands.SimpleCommand; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; @@ -96,6 +97,13 @@ public class NotEnoughUpdates { private File configFile; + public File getConfigFile(){ + return this.configFile; + } + public void newConfigFile(){ + this.configFile = new File(NotEnoughUpdates.INSTANCE.getNeuDir(), "configNew.json"); + } + private static final long CHAT_MSG_COOLDOWN = 200; private long lastChatMessage = 0; private long secondLastChatMessage = 0; @@ -107,284 +115,11 @@ public class NotEnoughUpdates { public GuiScreen openGui = null; public long lastOpenedGui = 0; - SimpleCommand.ProcessCommandRunnable collectionLogRun = new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - openGui = new GuiCollectionLog(); - } - }; - - SimpleCommand collectionLogCommand = new SimpleCommand("neucl", collectionLogRun); - SimpleCommand collectionLogCommand2 = new SimpleCommand("collectionlog", collectionLogRun); - - SimpleCommand nullzeeSphereCommand = new SimpleCommand("neuzeesphere", new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - if(args.length != 1) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Usage: /neuzeesphere [on/off] or /neuzeesphere (radius) or /neuzeesphere setCenter")); - return; - } - if(args[0].equalsIgnoreCase("on")) { - NullzeeSphere.enabled = true; - } else if(args[0].equalsIgnoreCase("off")) { - NullzeeSphere.enabled = false; - } else if(args[0].equalsIgnoreCase("setCenter")) { - EntityPlayerSP p = ((EntityPlayerSP)sender); - NullzeeSphere.centerPos = new BlockPos(p.posX, p.posY, p.posZ); - NullzeeSphere.overlayVBO = null; - } else { - try { - float radius = Float.parseFloat(args[0]); - NullzeeSphere.size = radius; - NullzeeSphere.overlayVBO = null; - } catch(Exception e) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED+"Can't parse radius: " + args[0])); - } - } - } - }); - - /*SimpleCommand itemRenameCommand = new SimpleCommand("neurename", new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - if(args.length == 0) { - args = new String[]{"help"}; - } - String heldUUID = manager.getUUIDForItem(Minecraft.getMinecraft().thePlayer.getHeldItem()); - switch(args[0].toLowerCase()) { - case "clearall": - manager.itemRenameJson = new JsonObject(); - manager.saveItemRenameConfig(); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "[NEU] Cleared custom name for all items")); - break; - case "clear": - if(heldUUID == null) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Can't clear rename - no UUID")); - return; - } - manager.itemRenameJson.remove(heldUUID); - manager.saveItemRenameConfig(); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "[NEU] Cleared custom name for held item")); - break; - case "copyuuid": - if(heldUUID == null) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Can't clear rename - no UUID")); - return; - } - StringSelection selection = new StringSelection(heldUUID); - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "[NEU] UUID copied to clipboard")); - break; - case "uuid": - if(heldUUID == null) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Can't get UUID - no UUID")); - return; - } - ChatStyle style = new ChatStyle(); - style.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, - new ChatComponentText(EnumChatFormatting.GRAY+"Click to copy to clipboard"))); - style.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/neurename copyuuid")); - - ChatComponentText text = new ChatComponentText(EnumChatFormatting.YELLOW+"[NEU] The UUID of your currently held item is: " + - EnumChatFormatting.GREEN + heldUUID); - text.setChatStyle(style); - sender.addChatMessage(text); - break; - case "set": - if(heldUUID == null) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Can't rename item - no UUID")); - return; - } - if(args.length == 1) { - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Usage: /neurename set [name...]")); - return; - } - StringBuilder sb = new StringBuilder(); - for(int i=1; i<args.length; i++) { - sb.append(args[i]); - if(i<args.length-1) sb.append(" "); - } - String name = sb.toString() - .replace("\\&", "{amp}") - .replace("&", "\u00a7") - .replace("{amp}", "&"); - name = new UnicodeUnescaper().translate(name); - manager.itemRenameJson.addProperty(heldUUID, name); - manager.saveItemRenameConfig(); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "[NEU] Set custom name for held item")); - break; - default: - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Unknown subcommand \""+args[0]+"\"")); - case "help": - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "[NEU] Available commands:")); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "help: Print this message")); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "clearall: Clears all custom names " - + EnumChatFormatting.BOLD + "(Cannot be undone)")); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "clear: Clears held item name " - + EnumChatFormatting.BOLD + "(Cannot be undone)")); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "uuid: Returns the UUID of the currently held item")); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "set: Sets the custom name of the currently held item")); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Usage: /neurename set [name...]")); - - } - } - });*/ - - SimpleCommand neuHelp = new SimpleCommand("neuhelp", new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - ArrayList<String> neuHelpMessages = Lists.newArrayList( - "\u00a75\u00a7lNotEnoughUpdates commands", - "\u00a76/neu \u00a77- Opens the main neu GUI.", - "\u00a76/pv \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer", - "\u00a76/neusouls {on/off/clear/unclear} \u00a7r\u00a77- Shows waypoints to fairy souls.", - "\u00a76/neubuttons \u00a7r\u00a77- Opens a GUI which allows you to customize inventory buttons.", - "\u00a76/neuec \u00a7r\u00a77- Opens the enchant colour GUI.", - - "\u00a76/join {floor} \u00a7r\u00a77- Short Command to join a Dungeon. \u00a7lNeed a Party of 5 People\u00a7r\u00a77 {4/f7/m5}.", - "\u00a76/neucosmetics \u00a7r\u00a77- Opens the cosmetic GUI.", - "\u00a76/neurename \u00a7r\u00a77- Opens the NEU Item Customizer.", - "\u00a76/cata \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer's catacombs page.", - "\u00a76/neulinks \u00a7r\u00a77- Shows links to neu/moulberry.", - "\u00a76/neuoverlay \u00a7r\u00a77- Opens GUI Editor for quickcommands and searchbar.", - "\u00a76/neuah \u00a7r\u00a77- Opens neu's custom ah GUI.", - "\u00a76/neumap \u00a7r\u00a77- Opens the dungeon map GUI.", - "\u00a76/neucalendar \u00a7r\u00a77- Opens neu's custom calendar GUI.", - "", - "\u00a76\u00a7lOld commands:", - "\u00a76/peek \u00a7b?{user} \u00a72\u2D35 \u00a7r\u00a77- Shows quickly stats for a user.", - "", - "\u00a76\u00a7lDebug commands:", - "\u00a76/neustats \u00a7r\u00a77- Copies helpful info to the clipboard.", - "\u00a76/neustats modlist \u00a7r\u00a77- Copies modlist info to clipboard.", - "\u00a76/neuresetrepo \u00a7r\u00a77- Deletes all repo files.", - "\u00a76/neureloadrepo \u00a7r\u00a77- Debug command with repo.", - "", - "\u00a76\u00a7lDev commands:", - "\u00a76/neupackdev \u00a7r\u00a77- pack creator command - getnpc"); - for (int i = 0; i < neuHelpMessages.size(); i++) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(neuHelpMessages.get(i) - )); - - } - if(NotEnoughUpdates.INSTANCE.config.hidden.dev) { - ArrayList<String> neuDevHelpMessages = Lists.newArrayList( - "\u00a76/neudevtest \u00a7r\u00a77- dev test command", - "\u00a76/neuzeephere \u00a7r\u00a77- sphere", - "\u00a76/neudungeonwintest \u00a7r\u00a77- displays the dungeon win screen"); - - for (int i = 0; i < neuDevHelpMessages.size(); i++) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(neuDevHelpMessages.get(i) - )); + public Commands commands; - } - } - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("\u00a77Commands marked with a \u00a72\"\u2D35\"\u00a77 require are api key. You can set your api key via \"/api new\" or by manually putting it in the api field in \"/neu\"")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("\u00a77Arguments marked with a \u00a7b\"?\"\u00a77 are optional.")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("\u00a76\u00a7lScroll up to see everything")); - } - }); - - SimpleCommand neuFeatures = new SimpleCommand("neufeatures", new SimpleCommand.ProcessCommandRunnable() { - public void processCommand(ICommandSender sender, String[] args) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); - if(Constants.MISC == null || !Constants.MISC.has("featureslist")){ - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""+EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD+"WARNING: "+EnumChatFormatting.RESET+EnumChatFormatting.RED+"Could not load URL from repo.")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""+EnumChatFormatting.RED+ "Please run "+EnumChatFormatting.BOLD+"/neuresetrepo"+EnumChatFormatting.RESET+EnumChatFormatting.RED+" and "+EnumChatFormatting.BOLD+"restart your game"+EnumChatFormatting.RESET+EnumChatFormatting.RED+" in order to fix. "+EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD+"If that doesn't fix it"+EnumChatFormatting.RESET+EnumChatFormatting.RED+", please join discord.gg/moulberry and post in #neu-support")); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); - return; - } - String url = Constants.MISC.get("featureslist").getAsString(); - - Desktop desk = Desktop.getDesktop(); - try { - desk.browse(new URI(url)); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE+""+EnumChatFormatting.BOLD+"NEU"+EnumChatFor |
