aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-11-19 15:53:26 +0000
committerGitHub <noreply@github.com>2023-11-19 16:53:26 +0100
commit45cabaf6bf781b028c17593d7983cf8128dd50f0 (patch)
treea4c4d97d4be7eb7945a7302b946abd812bedc9d5
parentafc3b2958dd6d4078021da3f54607006403690b3 (diff)
downloadNotEnoughUpdates-45cabaf6bf781b028c17593d7983cf8128dd50f0.tar.gz
NotEnoughUpdates-45cabaf6bf781b028c17593d7983cf8128dd50f0.tar.bz2
NotEnoughUpdates-45cabaf6bf781b028c17593d7983cf8128dd50f0.zip
Add Dessert Secret (#933)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WarpDessert.kt37
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java4
2 files changed, 41 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WarpDessert.kt b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WarpDessert.kt
new file mode 100644
index 00000000..f6f272b9
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/WarpDessert.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2023 NotEnoughUpdates contributors
+ *
+ * This file is part of NotEnoughUpdates.
+ *
+ * NotEnoughUpdates is free software: you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * NotEnoughUpdates is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package io.github.moulberry.notenoughupdates.miscfeatures
+
+import io.github.moulberry.notenoughupdates.util.Utils
+import net.minecraft.client.Minecraft
+import net.minecraft.network.play.client.C01PacketChatMessage
+
+object WarpDessert {
+ @JvmStatic
+ fun onPacketChatMessage(packet: C01PacketChatMessage): Boolean {
+ val message = packet.message.lowercase()
+ if (message == "/warp dessert") {
+ Minecraft.getMinecraft().thePlayer.sendChatMessage("/warp desert")
+ Utils.addChatMessage("§eDid someone say §d§lDessert§e? Sand is yummy!")
+ return true
+ }
+ return false
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
index 5245d604..f6bb6a20 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
@@ -26,6 +26,7 @@ import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers;
import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns;
import io.github.moulberry.notenoughupdates.miscfeatures.MiningStuff;
import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager;
+import io.github.moulberry.notenoughupdates.miscfeatures.WarpDessert;
import io.github.moulberry.notenoughupdates.miscfeatures.world.CrystalHollowChestHighlighter;
import io.github.moulberry.notenoughupdates.util.SBInfo;
import net.minecraft.client.multiplayer.WorldClient;
@@ -138,6 +139,9 @@ public class MixinNetHandlerPlayClient {
if (AntiCoopAdd.getInstance().onPacketChatMessage((C01PacketChatMessage) packet)) {
ci.cancel();
}
+ if (WarpDessert.onPacketChatMessage((C01PacketChatMessage) packet)) {
+ ci.cancel();
+ }
}
}