diff --git a/build.gradle b/build.gradle index 631f623..4397120 100644 --- a/build.gradle +++ b/build.gradle @@ -39,12 +39,6 @@ dependencies { // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" - - compileOnly 'org.projectlombok:lombok:1.18.24' - annotationProcessor 'org.projectlombok:lombok:1.18.24' - - testCompileOnly 'org.projectlombok:lombok:1.18.24' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.24' } processResources { diff --git a/gradle.properties b/gradle.properties index 6b01b90..0399033 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.20.1 - yarn_mappings=1.20.1+build.2 + yarn_mappings=1.20.1+build.9 loader_version=0.14.21 # Mod Properties @@ -14,6 +14,6 @@ org.gradle.parallel=true archives_base_name = chipmunkmod # Dependencies - fabric_version=0.83.1+1.20.1 + fabric_version=0.84.0+1.20.1 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33..a363877 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/lombok.config b/lombok.config deleted file mode 100644 index 347c825..0000000 --- a/lombok.config +++ /dev/null @@ -1,2 +0,0 @@ -config.stopBubbling = true -lombok.accessors.fluent = true \ No newline at end of file diff --git a/src/main/java/land/chipmunk/chipmunkmod/Configuration.java b/src/main/java/land/chipmunk/chipmunkmod/Configuration.java index 830673b..546cca5 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/Configuration.java +++ b/src/main/java/land/chipmunk/chipmunkmod/Configuration.java @@ -3,7 +3,7 @@ package land.chipmunk.chipmunkmod; import com.google.gson.JsonObject; import land.chipmunk.chipmunkmod.data.BlockArea; import net.minecraft.util.math.BlockPos; -import lombok.AllArgsConstructor; + public class Configuration { public CommandManager commands = new CommandManager(); @@ -30,16 +30,24 @@ public class Configuration { public TestBotInfo testbot = new TestBotInfo("-", null); } - @AllArgsConstructor public static class TestBotInfo { public String prefix; public String webhookUrl; + + public TestBotInfo (String prefix, String webhookUrl) { + this.prefix = prefix; + this.webhookUrl = webhookUrl; + } } - @AllArgsConstructor public static class BotInfo { public String prefix; public String key; + + public BotInfo (String prefix, String key) { + this.prefix = prefix; + this.key = key; + } } public static class CustomChat { diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/AutoSkinCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/AutoSkinCommand.java index c860ec3..50de716 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/AutoSkinCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/AutoSkinCommand.java @@ -28,11 +28,11 @@ public class AutoSkinCommand { final String username = getString(context, "username"); - SelfCare.INSTANCE.skin(username); + SelfCare.INSTANCE.skin = username; if (username.equals("off")) source.sendFeedback(Text.literal("Successfully disabled auto skin")); else { - SelfCare.INSTANCE.hasSkin(false); + SelfCare.INSTANCE.hasSkin = false; source.sendFeedback(Text.literal("Set your auto skin username to: " + username)); } diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/CloopCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/CloopCommand.java index 6ba5aac..5db68b9 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/CloopCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/CloopCommand.java @@ -68,7 +68,7 @@ public class CloopCommand { final CommandLoopManager manager = CommandLoopManager.INSTANCE; final int id = getInteger(context, "id"); - if (id < 0 || id >= manager.commandLoops().size()) throw INVALID_CLOOP_ID_EXCEPTION.create(id); + if (id < 0 || id >= manager.commandLoops.size()) throw INVALID_CLOOP_ID_EXCEPTION.create(id); manager.removeAndStop(id); @@ -88,11 +88,11 @@ public class CloopCommand { public static int listCloops (CommandContext context) { final FabricClientCommandSource source = context.getSource(); - final List loops = CommandLoopManager.INSTANCE.commandLoops(); + final List loops = CommandLoopManager.INSTANCE.commandLoops; int id = 0; for (CommandLoopManager.CommandLoop loop : loops) { - source.sendFeedback(Text.translatable("%s: %s (%s)", Text.literal(String.valueOf(id)), Text.literal(loop.command()), Text.literal(String.valueOf(loop.interval())))); + source.sendFeedback(Text.translatable("%s: %s (%s)", Text.literal(String.valueOf(id)), Text.literal(loop.command), Text.literal(String.valueOf(loop.interval)))); id++; } diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/CustomChatCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/CustomChatCommand.java index 4a419b0..bb1696c 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/CustomChatCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/CustomChatCommand.java @@ -38,7 +38,7 @@ public class CustomChatCommand { public static int enabled (CommandContext context) { final FabricClientCommandSource source = context.getSource(); final boolean bool = getBool(context, "boolean"); - CustomChat.INSTANCE.enabled(bool); + CustomChat.INSTANCE.enabled = bool; source.sendFeedback(Text.literal("Custom chat is now " + (bool ? "on" : "off"))); return Command.SINGLE_SUCCESS; @@ -47,7 +47,7 @@ public class CustomChatCommand { public static int setFormat (CommandContext context) { final FabricClientCommandSource source = context.getSource(); final String format = getString(context, "format"); - CustomChat.INSTANCE.format(format); + CustomChat.INSTANCE.format = format; source.sendFeedback(Text.literal("Set the custom chat format to: " + format)); return Command.SINGLE_SUCCESS; diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/FullBrightCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/FullBrightCommand.java index a67f44f..5f76436 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/FullBrightCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/FullBrightCommand.java @@ -28,7 +28,7 @@ public class FullBrightCommand { final boolean bool = getBool(context, "boolean"); - FullBright.enabled(bool); + FullBright.enabled = bool; source.sendFeedback(Text.literal("Fullbright is now " + (bool ? "enabled" : "disabled"))); diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/LoopCrouchCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/LoopCrouchCommand.java index d13f441..4e33156 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/LoopCrouchCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/LoopCrouchCommand.java @@ -28,7 +28,7 @@ public class LoopCrouchCommand { final boolean enabled = getBool(context, "enabled"); - LoopCrouch.INSTANCE.enabled(enabled); + LoopCrouch.INSTANCE.enabled = enabled; source.sendFeedback(Text.literal("Loop crouch is now " + (enabled ? "enabled" : "disabled"))); diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/MusicCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/MusicCommand.java index 0e34a42..40deb98 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/MusicCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/MusicCommand.java @@ -125,10 +125,10 @@ public class MusicCommand { final FabricClientCommandSource source = context.getSource(); final SongPlayer songPlayer = SongPlayer.INSTANCE; - if (songPlayer.currentSong() == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); + if (songPlayer.currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); songPlayer.stopPlaying(); - songPlayer.songQueue().clear(); + songPlayer.songQueue.clear(); source.sendFeedback(Text.literal("Stopped music playback").formatted(Formatting.GREEN)); return 1; @@ -138,7 +138,7 @@ public class MusicCommand { final FabricClientCommandSource source = context.getSource(); final SongPlayer songPlayer = SongPlayer.INSTANCE; - if (songPlayer.currentSong() == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); + if (songPlayer.currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); songPlayer.stopPlaying(); source.sendFeedback(Text.literal("Skipped the current song").formatted(Formatting.GREEN)); @@ -149,7 +149,7 @@ public class MusicCommand { public int pause (CommandContext context) throws CommandSyntaxException { final FabricClientCommandSource source = context.getSource(); final SongPlayer songPlayer = SongPlayer.INSTANCE; - final Song currentSong = songPlayer.currentSong(); + final Song currentSong = songPlayer.currentSong; if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); @@ -240,7 +240,7 @@ public class MusicCommand { public int toggleLoop (CommandContext context) throws CommandSyntaxException { final FabricClientCommandSource source = context.getSource(); final SongPlayer songPlayer = SongPlayer.INSTANCE; - final Song currentSong = songPlayer.currentSong(); + final Song currentSong = songPlayer.currentSong; if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); @@ -255,7 +255,7 @@ public class MusicCommand { public int loop (CommandContext context) throws CommandSyntaxException { final FabricClientCommandSource source = context.getSource(); final SongPlayer songPlayer = SongPlayer.INSTANCE; - final Song currentSong = songPlayer.currentSong(); + final Song currentSong = songPlayer.currentSong; final int count = getInteger(context, "count"); if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); @@ -271,7 +271,7 @@ public class MusicCommand { public int gotoCommand (CommandContext context) throws CommandSyntaxException { final FabricClientCommandSource source = context.getSource(); final SongPlayer songPlayer = SongPlayer.INSTANCE; - final Song currentSong = songPlayer.currentSong(); + final Song currentSong = songPlayer.currentSong; final long millis = getLong(context, "timestamp"); if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); @@ -290,7 +290,7 @@ public class MusicCommand { final boolean enabled = getBool(context, "boolean"); - SongPlayer.INSTANCE.useCore(enabled); + SongPlayer.INSTANCE.useCore = enabled; source.sendFeedback(Text.literal("Playing music using core is now " + (enabled ? "enabled" : "disabled"))); @@ -302,7 +302,7 @@ public class MusicCommand { final boolean enabled = getBool(context, "boolean"); - SongPlayer.INSTANCE.actionbar(enabled); + SongPlayer.INSTANCE.actionbar = enabled; source.sendFeedback(Text.literal("Showing actionbar is now " + (enabled ? "enabled" : "disabled"))); @@ -314,7 +314,7 @@ public class MusicCommand { final float pitch = getFloat(context, "pitch"); - SongPlayer.INSTANCE.pitch(pitch); + SongPlayer.INSTANCE.pitch = pitch; source.sendFeedback( Text.translatable( diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/RainbowNameCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/RainbowNameCommand.java index 65ff64c..24a4a54 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/RainbowNameCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/RainbowNameCommand.java @@ -56,7 +56,7 @@ public class RainbowNameCommand { final String name = getString(context, "name"); - RainbowName.INSTANCE.displayName(name); + RainbowName.INSTANCE.displayName = name; source.sendFeedback(Text.literal("Set the display name to: " + name)); diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/SelfCareCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/SelfCareCommand.java index 0ef9be1..d80e00f 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/SelfCareCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/SelfCareCommand.java @@ -47,15 +47,15 @@ public class SelfCareCommand { switch (type) { case "op" -> { - SelfCare.INSTANCE.opEnabled(bool); + SelfCare.INSTANCE.opEnabled = bool; source.sendFeedback(Text.literal("The op self care is now " + (bool ? "enabled" : "disabled"))); } case "gamemode" -> { - SelfCare.INSTANCE.gamemodeEnabled(bool); + SelfCare.INSTANCE.gamemodeEnabled = bool; source.sendFeedback(Text.literal("The gamemode self care is now " + (bool ? "enabled" : "disabled"))); } case "cspy" -> { - SelfCare.INSTANCE.cspyEnabled(bool); + SelfCare.INSTANCE.cspyEnabled = bool; source.sendFeedback(Text.literal("The CommandSpy self care is now " + (bool ? "enabled" : "disabled"))); } } diff --git a/src/main/java/land/chipmunk/chipmunkmod/data/BlockArea.java b/src/main/java/land/chipmunk/chipmunkmod/data/BlockArea.java index 29093d3..f671ac9 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/data/BlockArea.java +++ b/src/main/java/land/chipmunk/chipmunkmod/data/BlockArea.java @@ -1,13 +1,14 @@ package land.chipmunk.chipmunkmod.data; import net.minecraft.util.math.BlockPos; -import lombok.AllArgsConstructor; -import lombok.Data; // ? Am I reinventing the wheel here? -@AllArgsConstructor -@Data public class BlockArea { - private BlockPos start; - private BlockPos end; + public BlockPos start; + public BlockPos end; + + public BlockArea (BlockPos start, BlockPos end) { + this.start = start; + this.end = end; + } } diff --git a/src/main/java/land/chipmunk/chipmunkmod/data/CommandLoop.java b/src/main/java/land/chipmunk/chipmunkmod/data/CommandLoop.java deleted file mode 100644 index b2fdc22..0000000 --- a/src/main/java/land/chipmunk/chipmunkmod/data/CommandLoop.java +++ /dev/null @@ -1,15 +0,0 @@ -package land.chipmunk.chipmunkmod.data; - -import lombok.Getter; - -public class CommandLoop { - @Getter - private String command; - @Getter - private long interval; - - public CommandLoop (String command, long interval) { - this.command = command; - this.interval = interval; - } -} diff --git a/src/main/java/land/chipmunk/chipmunkmod/data/MutablePlayerListEntry.java b/src/main/java/land/chipmunk/chipmunkmod/data/MutablePlayerListEntry.java index 4e62570..6b5a966 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/data/MutablePlayerListEntry.java +++ b/src/main/java/land/chipmunk/chipmunkmod/data/MutablePlayerListEntry.java @@ -1,19 +1,22 @@ package land.chipmunk.chipmunkmod.data; import com.mojang.authlib.GameProfile; -import lombok.AllArgsConstructor; -import lombok.Data; import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket; import net.minecraft.text.Text; import net.minecraft.world.GameMode; -@Data -@AllArgsConstructor public class MutablePlayerListEntry { - private GameProfile profile; - private GameMode gamemode; - private int latency; - private Text displayName; + public GameProfile profile; + public GameMode gamemode; + public int latency; + public Text displayName; + + public MutablePlayerListEntry(GameProfile profile, GameMode gamemode, int latency, Text displayName) { + this.profile = profile; + this.gamemode = gamemode; + this.latency = latency; + this.displayName = displayName; + } public MutablePlayerListEntry (PlayerListS2CPacket.Entry entry) { this(entry.profile(), entry.gameMode(), entry.latency(), entry.displayName()); diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java index 690b930..831a236 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java @@ -17,7 +17,7 @@ public class ChatHudMixin { @Inject(at = @At("HEAD"), method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V", cancellable = true) public void addMessage(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci) { try { - if (RainbowName.INSTANCE.enabled()) { + if (RainbowName.INSTANCE.enabled) { if (message.getString().contains("Your nickname is now ") || message.getString().contains("Nickname changed.")) { ci.cancel(); return; diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientPlayerEntityMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientPlayerEntityMixin.java index abdb4b3..443030a 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ClientPlayerEntityMixin.java @@ -26,7 +26,7 @@ public class ClientPlayerEntityMixin { final ClientWorld world = CLIENT.getNetworkHandler().getWorld(); - final BlockPos origin = CommandCore.INSTANCE.origin(); + final BlockPos origin = CommandCore.INSTANCE.origin; if (origin == null) { CommandCore.INSTANCE.move(position); return; } final int distance = (int) Math.sqrt(new Vec2f(origin.getX() / 16, origin.getZ() / 16).distanceSquared(new Vec2f((int) position.getX() / 16, (int) position.getZ() / 16))); if (distance > world.getSimulationDistance()) CommandCore.INSTANCE.move(position); diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardInputMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardInputMixin.java index a0bb60f..5465b1d 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardInputMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/KeyboardInputMixin.java @@ -34,10 +34,10 @@ public class KeyboardInputMixin extends Input { this.jumping = this.settings.jumpKey.isPressed(); // ohio code - this.sneaking = LoopCrouch.INSTANCE.enabled() ? - !LoopCrouch.INSTANCE.sneaking() : + this.sneaking = LoopCrouch.INSTANCE.enabled ? + !LoopCrouch.INSTANCE.sneaking : this.settings.sneakKey.isPressed(); - LoopCrouch.INSTANCE.sneaking(!LoopCrouch.INSTANCE.sneaking()); + LoopCrouch.INSTANCE.sneaking = !LoopCrouch.INSTANCE.sneaking; if (slowDown) { this.movementSideways *= f; diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/LightmapTextureManagerMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/LightmapTextureManagerMixin.java index 848e865..9512c7c 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/LightmapTextureManagerMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/LightmapTextureManagerMixin.java @@ -11,6 +11,6 @@ import org.spongepowered.asm.mixin.injection.invoke.arg.Args; public class LightmapTextureManagerMixin { @ModifyArgs(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/NativeImage;setColor(III)V")) private void update (Args args) { - if (FullBright.enabled()) args.set(2, 0xFFFFFFFF); + if (FullBright.enabled) args.set(2, 0xFFFFFFFF); } } diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index 2c141c9..0b77372 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -2,8 +2,8 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.data.BlockArea; -import lombok.Getter; -import lombok.Setter; + + import net.minecraft.block.entity.CommandBlockBlockEntity; import net.minecraft.client.MinecraftClient; import net.minecraft.nbt.NbtCompound; @@ -18,10 +18,10 @@ import java.util.concurrent.CompletableFuture; public class CommandCore { private final MinecraftClient client; - @Getter @Setter private boolean ready = false; - @Getter @Setter private BlockPos origin; - @Getter private BlockArea relativeArea; - @Getter @Setter private BlockPos currentBlockRelative; + public boolean ready = false; + public BlockPos origin; + public BlockArea relativeArea; + public BlockPos currentBlockRelative; public static CommandCore INSTANCE = new CommandCore(MinecraftClient.getInstance(), ChipmunkMod.CONFIG.core.relativeArea); @@ -46,17 +46,17 @@ public class CommandCore { ((int) position.getZ() / 16) * 16 ); - if (currentBlockRelative == null) currentBlockRelative = new BlockPos(relativeArea.start()); + if (currentBlockRelative == null) currentBlockRelative = new BlockPos(relativeArea.start); refill(); } public void refill () { // final PositionManager position = client.position(); - final BlockPos relStart = relativeArea.start(); - final BlockPos relEnd = relativeArea.end(); + final BlockPos relStart = relativeArea.start; + final BlockPos relEnd = relativeArea.end; final String command = String.format( - KaboomCheck.INSTANCE.isKaboom() ? + KaboomCheck.INSTANCE.isKaboom ? "fill %s %s %s %s %s %s repeating_command_block replace" : "fill %s %s %s %s %s %s command_block", relStart.getX() + origin.getX(), @@ -72,8 +72,8 @@ public class CommandCore { } public void incrementCurrentBlock () { - final BlockPos start = relativeArea.start(); - final BlockPos end = relativeArea.end(); + final BlockPos start = relativeArea.start; + final BlockPos end = relativeArea.end; int x = currentBlockRelative.getX(); int y = currentBlockRelative.getY(); diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandLoopManager.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandLoopManager.java index 9917f05..8587c9b 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandLoopManager.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandLoopManager.java @@ -1,7 +1,7 @@ package land.chipmunk.chipmunkmod.modules; -import lombok.Getter; -import lombok.Setter; + + import java.util.List; import java.util.ArrayList; import java.util.Timer; @@ -9,7 +9,7 @@ import java.util.TimerTask; public class CommandLoopManager { private final CommandCore core; - @Getter @Setter private List commandLoops = new ArrayList<>(); + public List commandLoops = new ArrayList<>(); public CommandLoopManager (CommandCore core) { this.core = core; @@ -40,9 +40,9 @@ public class CommandLoopManager { public void cleanup () { this.clearLoops(); } public static class CommandLoop { - @Getter @Setter private CommandCore core; - @Getter @Setter private String command; - @Getter private long interval; + public CommandCore core; + public String command; + public long interval; private Timer timer; public CommandLoop (CommandCore core, String command, long interval) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java index 298ab21..1aba8da 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java @@ -2,8 +2,8 @@ package land.chipmunk.chipmunkmod.modules; import com.google.gson.JsonElement; import land.chipmunk.chipmunkmod.ChipmunkMod; -import lombok.Getter; -import lombok.Setter; + + import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; @@ -17,9 +17,9 @@ public class CustomChat { public static final CustomChat INSTANCE = new CustomChat(MinecraftClient.getInstance()); - @Getter @Setter private boolean enabled = true; + public boolean enabled = true; - @Getter @Setter private String format; + public String format; public CustomChat (MinecraftClient client) { this.client = client; diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/FullBright.java b/src/main/java/land/chipmunk/chipmunkmod/modules/FullBright.java index 23eda1d..6448dbe 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/FullBright.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/FullBright.java @@ -1,9 +1,9 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.ChipmunkMod; -import lombok.Getter; -import lombok.Setter; + + public class FullBright { - @Getter @Setter private static boolean enabled = ChipmunkMod.CONFIG.fullbright; + public static boolean enabled = ChipmunkMod.CONFIG.fullbright; } diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/KaboomCheck.java b/src/main/java/land/chipmunk/chipmunkmod/modules/KaboomCheck.java index 1eebfc4..8bbdb12 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/KaboomCheck.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/KaboomCheck.java @@ -2,7 +2,7 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; -import lombok.Getter; + import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.network.packet.Packet; @@ -18,7 +18,7 @@ public class KaboomCheck extends Listener { public static final String SUBTITLE_START_TEXT = "Free OP"; - @Getter private boolean isKaboom = false; + public boolean isKaboom = false; private boolean hasKaboomTitle = false; private boolean hasKaboomSubtitle = false; diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/LoopCrouch.java b/src/main/java/land/chipmunk/chipmunkmod/modules/LoopCrouch.java index 58ec004..bf6f6b2 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/LoopCrouch.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/LoopCrouch.java @@ -1,14 +1,14 @@ package land.chipmunk.chipmunkmod.modules; -import lombok.Getter; -import lombok.Setter; + + public class LoopCrouch { public static final LoopCrouch INSTANCE = new LoopCrouch(); - @Getter @Setter private boolean enabled = false; + public boolean enabled = false; - @Getter @Setter private boolean sneaking = false; + public boolean sneaking = false; public LoopCrouch () { } diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java b/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java index e79f3f2..e162342 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/Players.java @@ -75,7 +75,7 @@ public class Players extends Listener { public final MutablePlayerListEntry getEntry (UUID uuid) { try { for (MutablePlayerListEntry candidate : list) { - if (candidate.profile().getId().equals(uuid)) { + if (candidate.profile.getId().equals(uuid)) { return candidate; } } @@ -88,7 +88,7 @@ public class Players extends Listener { public final MutablePlayerListEntry getEntry (String username) { for (MutablePlayerListEntry candidate : list) { - if (candidate.profile().getName().equals(username)) { + if (candidate.profile.getName().equals(username)) { return candidate; } } @@ -98,7 +98,7 @@ public class Players extends Listener { public final MutablePlayerListEntry getEntry (Text displayName) { for (MutablePlayerListEntry candidate : list) { - if (candidate.displayName() != null && candidate.displayName().equals(displayName)) { + if (candidate.displayName != null && candidate.displayName.equals(displayName)) { return candidate; } } @@ -114,7 +114,7 @@ public class Players extends Listener { try { final MutablePlayerListEntry duplicate = getEntry(newEntry); if (duplicate != null) { - removeFromPlayerList(duplicate.profile().getId()); + removeFromPlayerList(duplicate.profile.getId()); list.remove(duplicate); } @@ -129,7 +129,7 @@ public class Players extends Listener { final MutablePlayerListEntry target = getEntry(newEntry); if (target == null) return; - target.gamemode(newEntry.gameMode()); + target.gamemode = newEntry.gameMode(); } catch (Exception e) { e.printStackTrace(); } @@ -139,14 +139,14 @@ public class Players extends Listener { final MutablePlayerListEntry target = getEntry(newEntry); if (target == null) return; - target.latency(newEntry.latency()); + target.latency = newEntry.latency(); } private void updateDisplayName (PlayerListS2CPacket.Entry newEntry) { final MutablePlayerListEntry target = getEntry(newEntry); if (target == null) return; - target.displayName(newEntry.displayName()); + target.displayName = newEntry.displayName(); } private void removePlayer (UUID uuid) { @@ -166,7 +166,7 @@ public class Players extends Listener { future.thenApply(packet -> { final Suggestions matches = packet.getSuggestions(); - final String username = target.profile().getName(); + final String username = target.profile.getName(); for (int i = 0; i < matches.getList().size(); i++) { final Suggestion suggestion = matches.getList().get(i); diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java b/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java index 87348c8..25a2c1b 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/RainbowName.java @@ -1,8 +1,8 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.util.ColorUtilities; -import lombok.Getter; -import lombok.Setter; + + import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.TextColor; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; @@ -23,11 +23,11 @@ public class RainbowName { private Timer timer = null; - @Getter @Setter private boolean enabled = false; + public boolean enabled = false; private String[] team; - @Getter @Setter private String displayName; + public String displayName; private int startHue = 0; diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java b/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java index e9da51b..256a458 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/SelfCare.java @@ -3,11 +3,11 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; -import lombok.Setter; + import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayerEntity; -import lombok.Getter; + import net.minecraft.text.Text; import java.util.Timer; @@ -17,17 +17,17 @@ import static land.chipmunk.chipmunkmod.util.ServerUtilities.serverHasCommand; public class SelfCare extends Listener { private final MinecraftClient client; - @Getter private final long interval; - @Getter private final long chatInterval; + public final long interval; + public final long chatInterval; - @Getter @Setter private boolean opEnabled = true; - @Getter @Setter private boolean gamemodeEnabled = true; - @Getter @Setter private boolean cspyEnabled = true; + public boolean opEnabled = true; + public boolean gamemodeEnabled = true; + public boolean cspyEnabled = true; - @Getter @Setter private String skin; + public String skin; private boolean cspy = false; - @Getter @Setter private boolean hasSkin = false; + public boolean hasSkin = false; private Timer timer = null; private Timer chatTimer = null; diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java b/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java index 1bcb73b..dcb644f 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/SongPlayer.java @@ -8,8 +8,8 @@ import land.chipmunk.chipmunkmod.song.Song; import land.chipmunk.chipmunkmod.song.SongLoaderException; import land.chipmunk.chipmunkmod.song.SongLoaderThread; import land.chipmunk.chipmunkmod.util.MathUtilities; -import lombok.Getter; -import lombok.Setter; + + import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; @@ -42,16 +42,16 @@ public class SongPlayer { public static final SongPlayer INSTANCE = new SongPlayer(MinecraftClient.getInstance()); - @Getter @Setter private Song currentSong; - @Getter @Setter private LinkedList songQueue = new LinkedList<>(); - @Getter @Setter private Timer playTimer; - @Getter @Setter private SongLoaderThread loaderThread; + public Song currentSong; + public LinkedList songQueue = new LinkedList<>(); + public Timer playTimer; + public SongLoaderThread loaderThread; private int ticksUntilPausedActionbar = 20; - @Getter @Setter private boolean useCore = true; - @Getter @Setter private boolean actionbar = true; + public boolean useCore = true; + public boolean actionbar = true; - @Getter @Setter private float pitch = 0; + public float pitch = 0; private final MinecraftClient client; @@ -73,7 +73,7 @@ public class SongPlayer { _loaderThread.start(); loaderThread = _loaderThread; } catch (SongLoaderException e) { - client.player.sendMessage(Component.translatable("Failed to load song: %s", e.message()).color(NamedTextColor.RED)); + client.player.sendMessage(Component.translatable("Failed to load song: %s", e.message).color(NamedTextColor.RED)); loaderThread = null; } } @@ -90,7 +90,7 @@ public class SongPlayer { _loaderThread.start(); loaderThread = _loaderThread; } catch (SongLoaderException e) { - client.player.sendMessage(Component.translatable("Failed to load song: %s", e.message()).color(NamedTextColor.RED)); + client.player.sendMessage(Component.translatable("Failed to load song: %s", e.message).color(NamedTextColor.RED)); loaderThread = null; } } @@ -110,7 +110,7 @@ public class SongPlayer { if (loaderThread != null && !loaderThread.isAlive()) { if (loaderThread.exception != null) { - client.player.sendMessage(Component.translatable("Failed to load song: %s", loaderThread.exception.message()).color(NamedTextColor.RED)); + client.player.sendMessage(Component.translatable("Failed to load song: %s", loaderThread.exception.message).color(NamedTextColor.RED)); } else { songQueue.add(loaderThread.song); client.player.sendMessage(Component.translatable("Added %s to the song queue", Component.empty().append(loaderThread.song.name).color(NamedTextColor.DARK_GREEN)).color(NamedTextColor.GREEN)); diff --git a/src/main/java/land/chipmunk/chipmunkmod/song/Note.java b/src/main/java/land/chipmunk/chipmunkmod/song/Note.java index 94e5b09..f50496d 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/song/Note.java +++ b/src/main/java/land/chipmunk/chipmunkmod/song/Note.java @@ -1,14 +1,19 @@ package land.chipmunk.chipmunkmod.song; -import lombok.AllArgsConstructor; -@AllArgsConstructor public class Note implements Comparable { public Instrument instrument; public int pitch; public float volume; public long time; + public Note (Instrument instrument, int pitch, float volume, long time) { + this.instrument = instrument; + this.pitch = pitch; + this.volume = volume; + this.time = time; + } + @Override public int compareTo(Note other) { if (time < other.time) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/song/SongLoaderException.java b/src/main/java/land/chipmunk/chipmunkmod/song/SongLoaderException.java index dd5dc37..ea0bb7f 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/song/SongLoaderException.java +++ b/src/main/java/land/chipmunk/chipmunkmod/song/SongLoaderException.java @@ -1,10 +1,9 @@ package land.chipmunk.chipmunkmod.song; -import lombok.Getter; import net.minecraft.text.Text; public class SongLoaderException extends Exception { - @Getter private final Text message; + public final Text message; public SongLoaderException (Text message) { super(); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 49c1f0e..9ff25d5 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,7 +31,7 @@ "depends": { "fabricloader": ">=0.14.11", "fabric-api": "*", - "minecraft": ">1.19.3", + "minecraft": ">1.20", "java": ">=17" }, "suggests": {