Skip to content

Commit

Permalink
Merge pull request #231 from DoKM/master
Browse files Browse the repository at this point in the history
DoKM Fork Merge
  • Loading branch information
Moulberry authored Oct 13, 2021
2 parents 8eee626 + 030f72b commit b117429
Show file tree
Hide file tree
Showing 39 changed files with 2,157 additions and 1,501 deletions.
47 changes: 47 additions & 0 deletions Update Notes/2.0-Pre31-Release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# These are the change notes for PRE31-Release

### **Major Changes**
- None yet. Prob not gonna happen this is mainly for small things.


### **Minor Changes:**
- Added a check to see if the storagegui is on before yelling at you for having fastrender on.
- Added toggle to disable showing the treecap cooldown in item durability. (Lulonaut)#
- Added text to inform the user to "/api new" when the /pv doesn't load.
- Added support for the new arrows to the PV.
- Improved metal detector location detection logic. (Keebler408)
- Improved metal detector wrong location handling. (Keebler408)
- Added Beacons waypoints for metal detector waypoint locations. (Keebler408)
- Made the PV command block in the right click player menu dynamically choose its position based on a empty slot. (DeDiamondPro)
- Added Tab auto completion to the AH search gui. (Lulonaut)

### **Bug Fixes**
- Fixed a nullpointer exception in dwarven textures (got some confirmation that it fixed it).
- Fixed neuec not parsing correctly.
- Fixed crashing when you copy text while in the neuec/neu buttons editor menu.
- Fixed crash when collecting supper pairs (nullpointer).
- Fixed accessory bag overlay not counting stats with a %.
- Fixed golden goblin not having a icon.
- Fixed accessory bag overlay's reforge stat detection as hypixel broke it with their tooltip changes.
- Fixed NeuEC as hypixel broke it with their tooltip changes.
- Fixed not being able to press repeat keys in chat.
- Fixed gemstone gauntlet/Divan Drill not being recognised as mining tools.
- Fixed morph pets not being recognized by the extended pet info tooltip tweak.
- Fixed wrong commission maxes values for goblin in dwarven mines and the crystal hollows. (Keebler408)
- Fixed player right click menu command block text appearing on an inventory item. (DeDiamondPro)



### **Other**
- Enabled help button by default.
- Added SecondPfirsisch cape.
- Added Stormy_LH cape.
- Change cape order in /neucosmetics because ironmoon asked for it.


### **Notes for texturepack creators**


### **Previous change log**
https://github.com/DoKM/NotEnoughUpdates/blob/master/Update%20Notes/2.0-Pre31.md

Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@
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;
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;
Expand Down Expand Up @@ -166,7 +160,7 @@ private void displayUpdateMessageIfOutOfDate() {
@SubscribeEvent
public void onWorldLoad(WorldEvent.Unload event) {
NotEnoughUpdates.INSTANCE.saveConfig();
CrystalMetalDetectorSolver.reset();
CrystalMetalDetectorSolver.reset(false);
}

private static long notificationDisplayMillis = 0;
Expand Down Expand Up @@ -206,7 +200,9 @@ public static void displayNotification(List<String> lines, boolean showForever,

@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;
Expand Down Expand Up @@ -862,7 +858,7 @@ public void onGuiChat(ClientChatReceivedEvent e) {
}
}
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!"))
Expand Down Expand Up @@ -1429,16 +1425,16 @@ public void onGuiScreenMouse(GuiScreenEvent.MouseInputEvent.Pre event) {
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){
NBTTagCompound tag = eventGui.inventorySlots.inventorySlots.get(22).getStack().getTagCompound();
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});
}
}
}
Expand Down Expand Up @@ -1728,30 +1724,7 @@ public void onGuiScreenKeyboard(GuiScreenEvent.KeyboardInputEvent.Pre event) {
}
}

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<>();
{
Expand Down Expand Up @@ -1826,9 +1799,9 @@ public void onItemTooltipLow(ItemTooltipEvent event) {
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;
}
Expand Down Expand Up @@ -1907,7 +1880,7 @@ public void onItemTooltipLow(ItemTooltipEvent event) {
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;
Expand Down Expand Up @@ -2072,17 +2045,18 @@ public void onItemTooltipLow(ItemTooltipEvent event) {
//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);
Expand Down Expand Up @@ -2142,7 +2116,7 @@ public void onItemTooltipLow(ItemTooltipEvent event) {
}
}
if(matches) {
String enchantText = matcher.group(2);
String enchantText = matcher.group("enchantName");
StringBuilder extraModifiersBuilder = new StringBuilder();

if((modifierI & GuiEnchantColour.BOLD_MODIFIER) != 0) {
Expand All @@ -2168,6 +2142,8 @@ public void onItemTooltipLow(ItemTooltipEvent event) {
"\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+".*", ""));
Expand All @@ -2177,6 +2153,10 @@ public void onItemTooltipLow(ItemTooltipEvent event) {
"\\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));
}
}
}
Expand Down Expand Up @@ -2406,7 +2386,7 @@ private List<String> petToolTipXPExtend(ItemTooltipEvent event) {
}
//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;

Expand Down Expand Up @@ -2442,12 +2422,14 @@ private List<String> petToolTipXPExtend(ItemTooltipEvent event) {
}
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;
Expand Down
Loading

0 comments on commit b117429

Please sign in to comment.