aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2023-06-23 11:56:32 +0200
committerGitHub <noreply@github.com>2023-06-23 19:56:32 +1000
commit6cafb6fd76c0ac5ca7be4371eb2bba5f719be4f4 (patch)
tree1ff94f3a172a8e0f591ecec2b23afc855862c661 /src/main/java
parentb2dd1dd2dcd220a67c1b91d1affe5d993388b22c (diff)
downloadNotEnoughUpdates-6cafb6fd76c0ac5ca7be4371eb2bba5f719be4f4.tar.gz
NotEnoughUpdates-6cafb6fd76c0ac5ca7be4371eb2bba5f719be4f4.tar.bz2
NotEnoughUpdates-6cafb6fd76c0ac5ca7be4371eb2bba5f719be4f4.zip
Various rift related changes (#724)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EquipmentModifier.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java27
3 files changed, 28 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index c6f0785d..f7f0049f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -1150,6 +1150,8 @@ public class NEUOverlay extends Gui {
} else if (keyPressed == manager.keybindViewRecipe.getKeyCode()) {
manager.showRecipe(item);
return true;
+ } else if (keyPressed == NotEnoughUpdates.INSTANCE.config.misc.keybindWaypoint && NotEnoughUpdates.INSTANCE.navigation.isValidWaypoint(item)) {
+ NotEnoughUpdates.INSTANCE.navigation.trackWaypoint(item);
} else if (keyPressed == manager.keybindGive.getKeyCode()) {
if (Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) {
Minecraft.getMinecraft().thePlayer.inventory.addItemStackToInventory(
@@ -2222,12 +2224,16 @@ public class NEUOverlay extends Gui {
(json.has("clickcommand") && !json.get("clickcommand").getAsString().isEmpty())
|| !manager.getAvailableRecipesFor(internalname).isEmpty();
boolean hasInfo = json.has("info") && json.get("info").getAsJsonArray().size() > 0;
+ boolean hasWaypoint = NotEnoughUpdates.INSTANCE.navigation.isValidWaypoint(json);
if (hasClick || hasInfo) text.add("");
if (hasClick)
text.add(EnumChatFormatting.YELLOW.toString() + EnumChatFormatting.BOLD + "LMB/R : View recipe!");
if (hasInfo)
text.add(EnumChatFormatting.YELLOW.toString() + EnumChatFormatting.BOLD + "RMB : View additional information!");
+ if (hasWaypoint)
+ text.add(EnumChatFormatting.YELLOW.toString() + EnumChatFormatting.BOLD +
+ Keyboard.getKeyName(NotEnoughUpdates.INSTANCE.config.misc.keybindWaypoint) + " : Set waypoint!");
textToDisplay = text;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EquipmentModifier.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EquipmentModifier.java
index 685e161a..6f0d7b93 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EquipmentModifier.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EquipmentModifier.java
@@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures.entityviewer;
import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NEUManager;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@@ -35,6 +36,8 @@ public class EquipmentModifier extends EntityViewerModifier {
String[] split = item.split("#");
if (split.length == 2) {
switch (split[0].intern()) {
+ case "SKULL":
+ return Utils.createSkull("Placeholder Skull", "00000000-0000-0000-0000-000000000000", split[1]);
case "LEATHER_LEGGINGS":
return coloredLeatherArmor(Items.leather_leggings, split[1]);
case "LEATHER_HELMET":
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java
index 9aaf65a4..2695f8d0 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java
@@ -40,11 +40,13 @@ import org.apache.commons.lang3.tuple.Pair;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Optional;
import static io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer.pv_elements;
@@ -210,21 +212,23 @@ public class TrophyFishPage extends GuiProfileViewerPage {
RenderHelper.enableGUIStandardItemLighting();
Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements);
Map<TrophyFish.TrophyFishRarity, Integer> trophyFishRarityIntegerMap = value.getTrophyFishRarityIntegerMap();
- if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.BRONZE)) {
+ TrophyFish.TrophyFishRarity highestRarity = getHighestRarity(trophyFishRarityIntegerMap).orElse(null);
+
+ if (highestRarity == TrophyFish.TrophyFishRarity.BRONZE) {
GlStateManager.color(255 / 255f, 130 / 255f, 0 / 255f, 1);
}
- if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.SILVER)) {
+ if (highestRarity == TrophyFish.TrophyFishRarity.SILVER) {
GlStateManager.color(192 / 255f, 192 / 255f, 192 / 255f, 1);
}
- if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.GOLD)) {
+ if (highestRarity == TrophyFish.TrophyFishRarity.GOLD) {
GlStateManager.color(1, 0.82F, 0, 1);
}
- if (trophyFishRarityIntegerMap.containsKey(TrophyFish.TrophyFishRarity.DIAMOND)) {
+ if (highestRarity == TrophyFish.TrophyFishRarity.DIAMOND) {
GlStateManager.color(31 / 255f, 216 / 255f, 241 / 255f, 1);
}
Utils.drawTexturedRect(x - 2, y - 2, 20, 20, 0, 20 / 256f, 0, 20 / 256f, GL11.GL_NEAREST);
GlStateManager.color(1, 1, 1, 1);
- Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(getItem(value.getName()), x, y);
+ Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(getItem(value.getName(), highestRarity), x, y);
if (mouseX >= x && mouseX < x + 24) {
if (mouseY >= y && mouseY <= y + 24) {
@@ -357,14 +361,21 @@ public class TrophyFishPage extends GuiProfileViewerPage {
}
if (trophyFishRarityIntegerMap.containsKey(rarity)) {
- return color + name + ": " + EnumChatFormatting.GOLD + StringUtils.formatNumber(trophyFishRarityIntegerMap.get(rarity));
+ return color + name + ": " + EnumChatFormatting.GOLD + StringUtils.formatNumber(trophyFishRarityIntegerMap.get(
+ rarity));
} else {
return color + name + ": " + checkX;
}
}
- private ItemStack getItem(String name) {
- String repoName = name.toUpperCase(Locale.US).replace(" ", "_") + "_BRONZE";
+ private Optional<TrophyFish.TrophyFishRarity> getHighestRarity(Map<TrophyFish.TrophyFishRarity, Integer> trophyFishRarityMap) {
+ if (trophyFishRarityMap == null) return Optional.empty();
+ return trophyFishRarityMap.keySet().stream().max(Comparator.comparing(Enum::ordinal));
+ }
+
+ private ItemStack getItem(String name, TrophyFish.TrophyFishRarity highestCaughtRarity) {
+ String repoName = name.toUpperCase(Locale.US).replace(" ", "_") + "_" +
+ (highestCaughtRarity == null ? "BRONZE" : highestCaughtRarity.name());
JsonObject jsonItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(repoName);
return NotEnoughUpdates.INSTANCE.manager.jsonToStack(jsonItem);
}