From 5f0291595204c06be9c6462dce6b166b03c19f68 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 2 Nov 2022 19:04:30 +0000 Subject: Gui editor (#316) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * kinda working ig * gui editor kinda works. map and drill fuel doesnt show yet. weird overlapping issues. overlays that have itemstacks glitch out on the left side * POV: im making scuffed af code during business class * a * made it so you ""can"" move the map * works for everything but the map (AAAAAAAA) * remove options * everything working™️ besides the hollows overlay buggin * hearth 💀 * swap the thingies * Update Position.java * Change arbitrary if statement * Fixed dontRenderOverlay * Made code more sane * Add powder overlay and cleaned up NEUConfig * less work for new gui overlays in the future * its not a bug its a feature suggestion * Fixed map on f1 (thank soopy) * Fixed map on entrance and fixed interp for e and f1 * no more warning !! Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../commands/dungeon/MapCommand.java | 37 ++-------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/MapCommand.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/MapCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/MapCommand.java index 3967edb4..d52ed196 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/MapCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/MapCommand.java @@ -33,14 +33,10 @@ import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.storage.MapData; import java.awt.*; -import java.io.BufferedReader; import java.io.File; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; import java.util.Map; public class MapCommand extends ClientCommandBase { @@ -52,35 +48,8 @@ public class MapCommand extends ClientCommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (NotEnoughUpdates.INSTANCE.colourMap == null) { - try ( - BufferedReader reader = new BufferedReader(new InputStreamReader(Minecraft - .getMinecraft() - .getResourceManager() - .getResource( - new ResourceLocation("notenoughupdates:maps/F1Full.json")) - .getInputStream(), StandardCharsets.UTF_8)) - ) { - JsonObject json = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(reader, JsonObject.class); - - NotEnoughUpdates.INSTANCE.colourMap = new Color[128][128]; - for (int x = 0; x < 128; x++) { - for (int y = 0; y < 128; y++) { - NotEnoughUpdates.INSTANCE.colourMap[x][y] = new Color(0, 0, 0, 0); - } - } - for (Map.Entry entry : json.entrySet()) { - int x = Integer.parseInt(entry.getKey().split(":")[0]); - int y = Integer.parseInt(entry.getKey().split(":")[1]); - - NotEnoughUpdates.INSTANCE.colourMap[x][y] = new Color(entry.getValue().getAsInt(), true); - } - } catch (Exception ignored) { - } - } - if (!NotEnoughUpdates.INSTANCE.config.hidden.dev) { - NotEnoughUpdates.INSTANCE.openGui = new GuiDungeonMapEditor(); + NotEnoughUpdates.INSTANCE.openGui = new GuiDungeonMapEditor(null); return; } @@ -90,7 +59,7 @@ public class MapCommand extends ClientCommandBase { } if (args.length != 2) { - NotEnoughUpdates.INSTANCE.openGui = new GuiDungeonMapEditor(); + NotEnoughUpdates.INSTANCE.openGui = new GuiDungeonMapEditor(null); return; } @@ -157,6 +126,6 @@ public class MapCommand extends ClientCommandBase { return; } - NotEnoughUpdates.INSTANCE.openGui = new GuiDungeonMapEditor(); + NotEnoughUpdates.INSTANCE.openGui = new GuiDungeonMapEditor(null); } } -- cgit