aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-09-14 22:30:25 +1000
committerGitHub <noreply@github.com>2022-09-14 14:30:25 +0200
commit18255a0e473092d0f389507a19944a7ddfc8078d (patch)
treed8e6548a8ecd46cb408e44829a8e5011c5df0211 /src/main/java/io
parent5e1cfdc20fa2d07f9448d0c0eee54cce9f1878f6 (diff)
downloadNotEnoughUpdates-18255a0e473092d0f389507a19944a7ddfc8078d.tar.gz
NotEnoughUpdates-18255a0e473092d0f389507a19944a7ddfc8078d.tar.bz2
NotEnoughUpdates-18255a0e473092d0f389507a19944a7ddfc8078d.zip
Added chat message to let players turn on the storage gui if they accidentally turned it off (#273)
* Added a chat message to turn the storage gui back on after turning it off in said storage gui * remove the skyclient mixin * map on by default
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java (renamed from src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java)30
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java14
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java2
4 files changed, 32 insertions, 16 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java
index fcb2aaf9..62981a30 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java
@@ -23,6 +23,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.commands.dev.DevTestCommand;
import io.github.moulberry.notenoughupdates.commands.dev.DiagCommand;
import io.github.moulberry.notenoughupdates.commands.dev.DungeonWinTestCommand;
+import io.github.moulberry.notenoughupdates.commands.dev.EnableStorageCommand;
import io.github.moulberry.notenoughupdates.commands.dev.NullzeeSphereCommand;
import io.github.moulberry.notenoughupdates.commands.dev.PackDevCommand;
import io.github.moulberry.notenoughupdates.commands.dev.ReloadRepoCommand;
@@ -74,6 +75,7 @@ public class Commands {
ClientCommandHandler.instance.registerCommand(new DiagCommand());
ClientCommandHandler.instance.registerCommand(new ReloadRepoCommand());
ClientCommandHandler.instance.registerCommand(new ResetRepoCommand());
+ ClientCommandHandler.instance.registerCommand(new EnableStorageCommand());
// Profile Commands
ClientCommandHandler.instance.registerCommand(new PeekCommand());
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java
index 32c9f418..3415b030 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java
@@ -17,23 +17,23 @@
* along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>.
*/
-package io.github.moulberry.notenoughupdates.mixins;
+package io.github.moulberry.notenoughupdates.commands.dev;
-import net.minecraftforge.event.world.WorldEvent;
-import org.spongepowered.asm.mixin.Dynamic;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Pseudo;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.commands.ClientCommandBase;
+import net.minecraft.command.CommandException;
+import net.minecraft.command.ICommandSender;
-@Pseudo
-@Mixin(targets = "co.skyclient.scc.SkyclientCosmetics")
-public class MixinSkyclientCosmetics {
+public class EnableStorageCommand extends ClientCommandBase {
- @Dynamic
- @Inject(method = "onWorldLoad", at = @At("HEAD"), cancellable = true, remap = false)
- public void onWorldLoad(WorldEvent.Load event, CallbackInfo ci) {
- ci.cancel();
+ public EnableStorageCommand() {
+ super("neuenablestorage");
}
+
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = true;
+ NotEnoughUpdates.INSTANCE.saveConfig();
+ }
+
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
index 27fea377..8878c284 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java
@@ -45,13 +45,17 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.shader.Framebuffer;
+import net.minecraft.event.ClickEvent;
+import net.minecraft.event.HoverEvent;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ClientCommandHandler;
import org.lwjgl.input.Keyboard;
@@ -1966,6 +1970,16 @@ public class StorageOverlay extends GuiElement {
switch (buttonIndex) {
case 0:
NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = false;
+ ChatComponentText storageMessage = new ChatComponentText(
+ EnumChatFormatting.YELLOW + "[NEU] " + EnumChatFormatting.YELLOW +
+ "You just disabled the custom storage gui, did you mean to do that? If not click this message to turn it back on.");
+ storageMessage.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/neuenablestorage"));
+ storageMessage.setChatStyle(storageMessage.getChatStyle().setChatHoverEvent(
+ new HoverEvent(HoverEvent.Action.SHOW_TEXT,
+ new ChatComponentText(EnumChatFormatting.YELLOW + "Click to enable the custom storage gui."))));
+ ChatComponentText storageChatMessage = new ChatComponentText("");
+ storageChatMessage.appendSibling(storageMessage);
+ Minecraft.getMinecraft().thePlayer.addChatMessage(storageChatMessage);
break;
case 1:
int size =
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java
index 4397c02e..8e211bd6 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java
@@ -73,7 +73,7 @@ public class DungeonMapConfig {
name = "Show Dungeon Map",
desc = "Show/hide the NEU dungeon map"
)
- public boolean dmEnable = false;
+ public boolean dmEnable = true;
@Expose
@ConfigOption(