From f581e76057086d9f8ec8eeff7d727cd01eac7ff0 Mon Sep 17 00:00:00 2001 From: StrangeOne101 Date: Sat, 17 Jul 2021 17:26:12 +1200 Subject: [PATCH] Tweaks - Tweaked cards in map neater around the text - Fixed map coordinate inaccuracy when zoomed - Fixed too many commas when teleporting via the map - Fixed no message being sent to the player at all when a studio world is opened - Increased map zoom default to 400% - Fixed create command NPE when downloaded a fresh pack --- build.gradle | 1 + .../com/volmit/iris/core/ProjectManager.java | 3 ++- .../command/studio/CommandIrisStudioOpen.java | 1 + .../core/command/world/CommandIrisCreate.java | 7 ++++- .../com/volmit/iris/core/gui/IrisVision.java | 27 ++++++++++--------- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index fada92362..10d12a6b3 100644 --- a/build.gradle +++ b/build.gradle @@ -34,6 +34,7 @@ registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/s registerCustomOutputTask('Psycho', 'D://Dan/MinecraftDevelopment/server/plugins'); registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins'); registerCustomOutputTask('Coco', 'C:/Users/sjoer/Documents/MCServer/plugins'); +registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins'); // ============================================================== def registerCustomOutputTask(name, path) { diff --git a/src/main/java/com/volmit/iris/core/ProjectManager.java b/src/main/java/com/volmit/iris/core/ProjectManager.java index 98bd2b464..50b2d59f2 100644 --- a/src/main/java/com/volmit/iris/core/ProjectManager.java +++ b/src/main/java/com/volmit/iris/core/ProjectManager.java @@ -301,7 +301,8 @@ public class ProjectManager { KMap l = new KMap<>(); for (String i : a.keySet()) { - l.put(i, a.getString(i)); + if (a.get(i) instanceof String) + l.put(i, a.getString(i)); } return l; diff --git a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioOpen.java b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioOpen.java index 13cee14b2..a7067fbce 100644 --- a/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioOpen.java +++ b/src/main/java/com/volmit/iris/core/command/studio/CommandIrisStudioOpen.java @@ -49,6 +49,7 @@ public class CommandIrisStudioOpen extends MortarCommand { return true; } + sender.sendMessage("Opening studio world..."); Iris.proj.open(sender, args[0]); return true; } diff --git a/src/main/java/com/volmit/iris/core/command/world/CommandIrisCreate.java b/src/main/java/com/volmit/iris/core/command/world/CommandIrisCreate.java index a95c8d097..e63559b4b 100644 --- a/src/main/java/com/volmit/iris/core/command/world/CommandIrisCreate.java +++ b/src/main/java/com/volmit/iris/core/command/world/CommandIrisCreate.java @@ -52,7 +52,12 @@ public class CommandIrisCreate extends MortarCommand { @Override public void addTabOptions(VolmitSender sender, String[] args, KList list) { - if (args.length == 0 || args[args.length - 1].equals("")) { //They are about to type a new argument + if (args.length == 0) { + list.add("[worldname]"); + return; + } + + if (args.length >= 1 || args[args.length - 1].equals("")) { //They are about to type a new argument list.addAll(getBase(args)); return; } diff --git a/src/main/java/com/volmit/iris/core/gui/IrisVision.java b/src/main/java/com/volmit/iris/core/gui/IrisVision.java index df684bafd..d8dacadc7 100644 --- a/src/main/java/com/volmit/iris/core/gui/IrisVision.java +++ b/src/main/java/com/volmit/iris/core/gui/IrisVision.java @@ -75,7 +75,7 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene private int lowq = 12; private int posZ = 0; private double scale = 128; - private double mscale = 1D; + private double mscale = 4D; private int w = 0; private int h = 0; private double lx = 0; @@ -358,7 +358,8 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene } private double getWorldX(double screenX) { - return (mscale * screenX) + ((oxp / scale) * mscale); + //return (mscale * screenX) + ((oxp / scale) * mscale); + return (mscale * screenX) + ((oxp / scale)); } private double getWorldZ(double screenZ) { @@ -602,8 +603,8 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene KList l = new KList<>(); l.add("Biome: " + biome.getName()); l.add("Region: " + region.getName() + "(" + region.getLoadKey() + ")"); + l.add("Block " + (int) getWorldX(hx) + ", " + (int) getWorldZ(hz)); if (detailed) { - l.add("Block " + (int) getWorldX(hx) + ", " + (int) getWorldZ(hz)); l.add("Chunk " + ((int) getWorldX(hx) >> 4) + ", " + ((int) getWorldZ(hz) >> 4)); l.add("Region " + (((int) getWorldX(hx) >> 4) >> 5) + ", " + (((int) getWorldZ(hz) >> 4) >> 5)); l.add("Key: " + biome.getLoadKey()); @@ -676,9 +677,11 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene private void teleport() { J.s(() -> { if (player != null) { - double h = engine.getFramework().getComplex().getTrueHeightStream().get(getWorldX(hx), getWorldZ(hz)); - player.teleport(new Location(player.getWorld(), getWorldX(hx), h, getWorldZ(hz))); - notify("Teleporting to " + Form.f((int) getWorldX(hx)) + ", " + Form.f((int) h) + ", " + Form.f((int) getWorldZ(hz))); + int xx = (int) getWorldX(hx); + int zz = (int) getWorldZ(hz); + double h = engine.getFramework().getComplex().getTrueHeightStream().get(xx, zz); + player.teleport(new Location(player.getWorld(), xx, h, zz)); + notify("Teleporting to " + xx + ", " + (int) h + ", " + zz); } else { notify("No player in world, can't teleport."); } @@ -704,17 +707,17 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene } w += 28; - h += 28; + h += 14; int cw = (int) ((w + 26) * pushX); int ch = (int) ((h + 26) * pushZ); g.setColor(Color.darkGray); - g.fillRect((int) x + 7 + 2 - cw, (int) y + 7 + 2 - ch, w + 7, h + 7); // Shadow + g.fillRect((int) x + 7 + 2 - cw, (int) y + 12 + 2 - ch, w + 7, h); // Shadow g.setColor(Color.gray); - g.fillRect((int) x + 7 + 1 - cw, (int) y + 7 + 1 - ch, w + 7, h + 7); // Shadow + g.fillRect((int) x + 7 + 1 - cw, (int) y + 12 + 1 - ch, w + 7, h); // Shadow g.setColor(Color.white); - g.fillRect((int) x + 7 - cw, (int) y + 7 - ch, w + 7, h + 7); + g.fillRect((int) x + 7 - cw, (int) y + 12 - ch, w + 7, h); g.setColor(Color.black); int m = 0; @@ -756,10 +759,10 @@ public class IrisVision extends JPanel implements MouseWheelListener, KeyListene return; } - Iris.info("Blocks/Pixel: " + (mscale) + ", Blocks Wide: " + (w * mscale)); + //Iris.info("Blocks/Pixel: " + (mscale) + ", Blocks Wide: " + (w * mscale)); positions.clear(); fastpositions.clear(); - mscale = mscale + ((0.044 * mscale) * notches); + mscale = mscale + ((0.25 * mscale) * notches); mscale = Math.max(mscale, 0.00001); }