diff options
27 files changed, 88 insertions, 71 deletions
diff --git a/build.gradle b/build.gradle index 475c32c..f94acd4 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,9 @@ version = project.mod_version group = project.maven_group repositories { + maven { url 'https://maven.terraformersmc.com/releases' } + maven { url "https://maven.shedaniel.me/" } + // Add repositories to retrieve artifacts from in here. // You should only use this when depending on other mods because // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. @@ -19,10 +22,14 @@ dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - // Fabric API. This is technically optional, but you probably want it anyway. + modImplementation 'com.terraformersmc:modmenu:7.2.2' + //https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/7.2.2/modmenu-7.2.2.pom + // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modApi("me.shedaniel.cloth:cloth-config-fabric:11.1.106") { + exclude(group: "net.fabricmc.fabric-api") } +} processResources { inputs.property "version", project.version @@ -63,7 +70,7 @@ java { jar { from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} + rename { "${it}_${project.archivesBaseName}" } } manifest { attributes 'Fabric-MixinConfigs': 'modid.mixin.json', diff --git a/run/fabricloader.log b/run/fabricloader.log index bc3bde4..99ccf96 100644 --- a/run/fabricloader.log +++ b/run/fabricloader.log @@ -1,8 +1 @@ -[21:56:35] [ERROR] [FabricLoader/GameProvider]: Minecraft game provider couldn't locate the game! The game may be absent from the class path, lacks some expected files, suffers from jar corruption or is of an unsupported variety/version. -[21:56:35] [ERROR] [FabricLoader/]: Uncaught exception in thread "main" -java.lang.RuntimeException: Minecraft game provider couldn't locate the game! The game may be absent from the class path, lacks some expected files, suffers from jar corruption or is of an unsupported variety/version. - at net.fabricmc.loader.impl.launch.knot.Knot.createGameProvider(Knot.java:214) - at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:130) - at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) - at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) - at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) +[13:18:31] [INFO] [FabricLoader/GameProvider]: Loading Minecraft 1.20.1 with Fabric Loader 0.14.21 diff --git a/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java new file mode 100644 index 0000000..82a5155 --- /dev/null +++ b/src/main/java/de/hype/bbsentials/client/BBsentialsConfigScreemFactory.java @@ -0,0 +1,9 @@ +package de.hype.bbsentials.client; + +import net.minecraft.client.gui.screen.Screen; + +public class BBsentialsConfigScreemFactory { + public static Screen create(Screen parent) { + return parent; + } +} diff --git a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java index e1f3141..3cb139b 100644 --- a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java +++ b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java @@ -166,7 +166,7 @@ public class CommandsOLD { int z = IntegerArgumentType.getInteger(context, "Z"); String contactWay = StringArgumentType.getString(context, "ContactWay"); - bbserver.sendPacket(new ChChestPackage("", ChChestItems.getItem(item.split(";")), x + "" + y + "" + z, contactWay, "")); + bbserver.sendPacket(new ChChestPacket("", ChChestItems.getItem(item.split(";")), x + "" + y + "" + z, contactWay, "")); return 1; } ) diff --git a/src/main/java/de/hype/bbsentials/client/ModMenueScreen.java b/src/main/java/de/hype/bbsentials/client/ModMenueScreen.java new file mode 100644 index 0000000..64de624 --- /dev/null +++ b/src/main/java/de/hype/bbsentials/client/ModMenueScreen.java @@ -0,0 +1,20 @@ +package de.hype.bbsentials.client; + +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.NoticeScreen; +import net.minecraft.text.Text; + +public class ModMenueScreen implements ModMenuApi { + public class CITResewnModMenu implements ModMenuApi { + @Override + public ConfigScreenFactory<?> getModConfigScreenFactory() { + if (FabricLoader.getInstance().isModLoaded("cloth-config2")) + return BBsentialsConfigScreemFactory::create; + + return parent -> new NoticeScreen(() -> MinecraftClient.getInstance().setScreen(parent), Text.of("CIT Resewn"), Text.of("CIT Resewn requires Cloth Config to be able to show the config.")); + } + } +} diff --git a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java index c5f896e..c5ca6b8 100644 --- a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java +++ b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java @@ -50,7 +50,7 @@ public class BBsentialConnection { } } - public void onChChestPackage(ChChestPackage packet) { + public void onChChestPackage(ChChestPacket packet) { if (isCommandSafe(packet.bbcommand)) { String tellrawText = ("{\"text\":\"BB: @username found @item in a chest at (@coords). Click here to get a party invite @extramessage\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"@inviteCommand\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"On clicking you will get invited to a party. Command executed: @inviteCommand\"]}}"); tellrawText = tellrawText.replace("@username", packet.announcerUsername).replace("@item", Arrays.stream(packet.items).map(ChChestItem::getDisplayName).toList().toString()).replace("@coords", packet.locationCoords).replace("@inviteCommand", packet.bbcommand); diff --git a/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableChChestPingRole.java b/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableChChestPingRole.java deleted file mode 100644 index 35d7470..0000000 --- a/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableChChestPingRole.java +++ /dev/null @@ -1,11 +0,0 @@ -package de.hype.bbsentials.constants.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface BBSelectableChChestPingRole { -} diff --git a/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableMiningEventPingRole.java b/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableMiningEventPingRole.java deleted file mode 100644 index 8e2e503..0000000 --- a/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableMiningEventPingRole.java +++ /dev/null @@ -1,11 +0,0 @@ -package de.hype.bbsentials.constants.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface BBSelectableMiningEventPingRole { -} diff --git a/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableRole.java b/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableRole.java deleted file mode 100644 index 8597cbc..0000000 --- a/src/main/java/de/hype/bbsentials/constants/annotations/BBSelectableRole.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.hype.bbsentials.constants.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.FIELD) -public @interface BBSelectableRole { - -} diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java index 8407774..fba8ff2 100644 --- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java +++ b/src/main/java/de/hype/bbsentials/constants/enviromentShared/EnumUtils.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.constants.enviromentShared; - import de.hype.bbsentials.constants.BBDisplayNameProvider; import de.hype.bbsentials.constants.BBDisplayNameProviderWithCustom; diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java index f03c8ae..105e0c2 100644 --- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java +++ b/src/main/java/de/hype/bbsentials/constants/enviromentShared/Islands.java @@ -34,6 +34,4 @@ public enum Islands implements BBDisplayNameProvider { public String getDisplayName() { return displayName; } - - } diff --git a/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java b/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java index 1dc72d1..7ef4289 100644 --- a/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java +++ b/src/main/java/de/hype/bbsentials/constants/enviromentShared/MiningEvents.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.constants.enviromentShared; - import de.hype.bbsentials.constants.BBDisplayNameProvider; // Mining Events diff --git a/src/main/java/de/hype/bbsentials/packets/PacketManager.java b/src/main/java/de/hype/bbsentials/packets/PacketManager.java index a6d94d4..03d25ed 100644 --- a/src/main/java/de/hype/bbsentials/packets/PacketManager.java +++ b/src/main/java/de/hype/bbsentials/packets/PacketManager.java @@ -25,7 +25,7 @@ public class PacketManager { public static void initializePacketActions(BBsentialConnection connection) { packets.add(new Packet<>(SplashNotifyPacket.class, connection::onSplashNotify)); packets.add(new Packet<>(BingoChatMessagePacket.class, connection::onBingoChatMessagePacket)); - packets.add(new Packet<>(ChChestPackage.class, connection::onChChestPackage)); + packets.add(new Packet<>(ChChestPacket.class, connection::onChChestPackage)); // packets.add(new Packet<>(DisconnectPacket.class, connection::dummy)); // packets.add(new Packet<>(InternalCommandPacket.class, connection::dummy)); packets.add(new Packet<>(MiningEventPacket.class, connection::onMiningEventPacket)); diff --git a/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java index 2e507c7..aa0cb89 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/BroadcastMessagePacket.java @@ -1,5 +1,6 @@ package de.hype.bbsentials.packets.packets; + import de.hype.bbsentials.packets.AbstractPacket; public class BroadcastMessagePacket extends AbstractPacket { diff --git a/src/main/java/de/hype/bbsentials/packets/packets/ChChestPackage.java b/src/main/java/de/hype/bbsentials/packets/packets/ChChestPacket.java index e2252e8..4519b66 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/ChChestPackage.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/ChChestPacket.java @@ -1,12 +1,11 @@ package de.hype.bbsentials.packets.packets; - -import de.hype.bbsentials.constants.enviromentShared.ChChestItem; import de.hype.bbsentials.packets.AbstractPacket; +import de.hype.bbsentials.constants.enviromentShared.ChChestItem; -public class ChChestPackage extends AbstractPacket { +public class ChChestPacket extends AbstractPacket { - public ChChestPackage(String announcerUsername, ChChestItem[] items, String locationCoords, String bbcommand, String extraMessage) { + public ChChestPacket(String announcerUsername, ChChestItem[] items, String locationCoords, String bbcommand, String extraMessage) { super(1, 1); //Min and Max supported Version this.announcerUsername = announcerUsername; this.locationCoords = locationCoords; diff --git a/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java index 4a37693..ab04d1a 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java @@ -1,18 +1,19 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; +import de.hype.bbsentials.constants.enviromentShared.InternalReasonConstants; public class DisconnectPacket extends AbstractPacket { - public DisconnectPacket(String internalReason, int[] waitBeforeReconnect, String displayReason, String displayMessage) { + public DisconnectPacket(InternalReasonConstants internalReason, int[] waitBeforeReconnect, String displayReason, String displayMessage) { super(1, 1); //Min and Max supportet Version this.internalReason = internalReason; this.waitBeforeReconnect = waitBeforeReconnect; this.displayReason = displayReason; this.displayMessage = displayMessage; } - public final String internalReason; + + public final InternalReasonConstants internalReason; public final int[] waitBeforeReconnect; public final String displayReason; public final String displayMessage; diff --git a/src/main/java/de/hype/bbsentials/packets/packets/DisplayMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/DisplayMessagePacket.java index da99a99..9774f38 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/DisplayMessagePacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/DisplayMessagePacket.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; public class DisplayMessagePacket extends AbstractPacket { diff --git a/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java index 9329878..b0580e5 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/DisplayTellrawMessagePacket.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; public class DisplayTellrawMessagePacket extends AbstractPacket { diff --git a/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java index cf8c8f7..077e3d4 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/InternalCommandPacket.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; //Only used for small things which don't really need an own Packet. diff --git a/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java index b57be4a..d1173ea 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/InvalidCommandFeedbackPacket.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; public class InvalidCommandFeedbackPacket extends AbstractPacket { diff --git a/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java index 5dd383f..ae2f436 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/MiningEventPacket.java @@ -1,9 +1,8 @@ package de.hype.bbsentials.packets.packets; - +import de.hype.bbsentials.packets.AbstractPacket; import de.hype.bbsentials.constants.enviromentShared.Islands; import de.hype.bbsentials.constants.enviromentShared.MiningEvents; -import de.hype.bbsentials.packets.AbstractPacket; public class MiningEventPacket extends AbstractPacket { diff --git a/src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java new file mode 100644 index 0000000..23325d9 --- /dev/null +++ b/src/main/java/de/hype/bbsentials/packets/packets/PartyPacket.java @@ -0,0 +1,16 @@ +package de.hype.bbsentials.packets.packets; + +import de.hype.bbsentials.packets.AbstractPacket; + +public class PartyPacket extends AbstractPacket { + + public PartyPacket(String type, String[] users) { + super(1, 1); //Min and Max supportet Version + this.type = type; + this.users = users; + } + + public final String type; + public final String[] users; + +} diff --git a/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java index 62bac83..6009de5 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/RequestConnectPacket.java @@ -1,12 +1,11 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; public class RequestConnectPacket extends AbstractPacket { - public RequestConnectPacket(String mcuuid, String key, int clientApiVersion, String authType ) { + public RequestConnectPacket(String mcuuid, String key, int clientApiVersion, String authType) { super(1, 1); //Min and Max supported Version this.mcuuid = mcuuid; this.key = key; diff --git a/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java index bfdc275..ab0076e 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/SplashNotifyPacket.java @@ -1,8 +1,7 @@ package de.hype.bbsentials.packets.packets; - -import de.hype.bbsentials.constants.enviromentShared.Islands; import de.hype.bbsentials.packets.AbstractPacket; +import de.hype.bbsentials.constants.enviromentShared.Islands; public class SplashNotifyPacket extends AbstractPacket { diff --git a/src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java b/src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java new file mode 100644 index 0000000..c8ba534 --- /dev/null +++ b/src/main/java/de/hype/bbsentials/packets/packets/SystemMessagePacket.java @@ -0,0 +1,16 @@ +package de.hype.bbsentials.packets.packets; + +import de.hype.bbsentials.packets.AbstractPacket; + +public class SystemMessagePacket extends AbstractPacket { + public final String message; + public final boolean important; + public final boolean ping; + + public SystemMessagePacket(String message, boolean important, boolean ping) { + super(1, 1); //Min and Max supported Version + this.message = message; + this.important = important; + this.ping = ping; + } +} diff --git a/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java index 4b2f7c3..f1c80b3 100644 --- a/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java +++ b/src/main/java/de/hype/bbsentials/packets/packets/WelcomeClientPacket.java @@ -1,6 +1,5 @@ package de.hype.bbsentials.packets.packets; - import de.hype.bbsentials.packets.AbstractPacket; public class WelcomeClientPacket extends AbstractPacket { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 8e3db40..cd5d125 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -18,7 +18,8 @@ "entrypoints": { "client": [ "de.hype.bbsentials.client.BBsentials" - ] + ], + "modmenu": [ "de.hype.bbsentials.client.ModMenueScreen" ] }, "depends": { "fabricloader": ">=${loader_version}", |