diff options
author | nea <romangraef@gmail.com> | 2022-05-01 00:51:04 +0200 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-05-01 00:51:04 +0200 |
commit | b37133ac63da4bb983b96f3348ede9f3a2aa9e1c (patch) | |
tree | a5abce9075c715f1660a31922752f6bba89f56ac /src | |
parent | 4b679c2a55427c0f7945c51db46cede3e04b30b2 (diff) | |
download | NotEnoughUpdates-b37133ac63da4bb983b96f3348ede9f3a2aa9e1c.tar.gz NotEnoughUpdates-b37133ac63da4bb983b96f3348ede9f3a2aa9e1c.tar.bz2 NotEnoughUpdates-b37133ac63da4bb983b96f3348ede9f3a2aa9e1c.zip |
make pins dissapear if you not a waypoint
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java | 2 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/recipes/ItemShopRecipe.java | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java index 4baa9e6e..651270cb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java @@ -69,7 +69,7 @@ public class Navigation { private Teleporter nextTeleporter = null; - private boolean isValidWaypoint(JsonObject object) { + public boolean isValidWaypoint(JsonObject object) { return object.has("x") && object.has("y") && object.has("z") diff --git a/src/main/java/io/github/moulberry/notenoughupdates/recipes/ItemShopRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/recipes/ItemShopRecipe.java index 98ec0d8c..1b9bb248 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/recipes/ItemShopRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/recipes/ItemShopRecipe.java @@ -40,6 +40,7 @@ public class ItemShopRecipe implements NeuRecipe { private boolean selected; private final Ingredient npcIngredient; + private final boolean hasWaypoint; private final JsonObject npcObject; public ItemShopRecipe(Ingredient npcIngredient, List<Ingredient> cost, Ingredient result, JsonObject npcObject) { @@ -47,6 +48,7 @@ public class ItemShopRecipe implements NeuRecipe { this.cost = cost; this.result = result; this.npcObject = npcObject; + hasWaypoint = NotEnoughUpdates.INSTANCE.navigation.isValidWaypoint(npcObject); } @Override @@ -94,6 +96,7 @@ public class ItemShopRecipe implements NeuRecipe { SLOT_IMAGE_SIZE, SLOT_IMAGE_SIZE ); } + if (!hasWaypoint) return; Minecraft.getMinecraft().getTextureManager().bindTexture(GuiNavigation.BACKGROUND); selected = npcIngredient.getInternalItemId().equals(NotEnoughUpdates.INSTANCE.navigation.getInternalname()); gui.drawTexturedModalRect( @@ -108,7 +111,7 @@ public class ItemShopRecipe implements NeuRecipe { @Override public void mouseClicked(GuiItemRecipe gui, int mouseX, int mouseY, int mouseButton) { - if (Utils.isWithinRect( + if (hasWaypoint && Utils.isWithinRect( mouseX - gui.guiLeft, mouseY - gui.guiTop, BUTTON_X, |