stuff stuff stuff

yea yea yea yea yeayea yea yeay ay aey yea y eay eayae yey ae yeaye ayea yea
This commit is contained in:
Chayapak 2023-07-02 08:04:40 +07:00
parent 1547326a54
commit e55b9e51b4
35 changed files with 140 additions and 146 deletions

View file

@ -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. // 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}" // 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 { processResources {

View file

@ -5,7 +5,7 @@ org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.20.1 minecraft_version=1.20.1
yarn_mappings=1.20.1+build.2 yarn_mappings=1.20.1+build.9
loader_version=0.14.21 loader_version=0.14.21
# Mod Properties # Mod Properties
@ -14,6 +14,6 @@ org.gradle.parallel=true
archives_base_name = chipmunkmod archives_base_name = chipmunkmod
# Dependencies # Dependencies
fabric_version=0.83.1+1.20.1 fabric_version=0.84.0+1.20.1

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

11
gradlew vendored
View file

@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 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. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # 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 ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # 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" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done done
fi 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; # Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in # shell script including quotes and variable substitutions, so put them in

View file

@ -1,2 +0,0 @@
config.stopBubbling = true
lombok.accessors.fluent = true

View file

@ -3,7 +3,7 @@ package land.chipmunk.chipmunkmod;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import land.chipmunk.chipmunkmod.data.BlockArea; import land.chipmunk.chipmunkmod.data.BlockArea;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import lombok.AllArgsConstructor;
public class Configuration { public class Configuration {
public CommandManager commands = new CommandManager(); public CommandManager commands = new CommandManager();
@ -30,16 +30,24 @@ public class Configuration {
public TestBotInfo testbot = new TestBotInfo("-", null); public TestBotInfo testbot = new TestBotInfo("-", null);
} }
@AllArgsConstructor
public static class TestBotInfo { public static class TestBotInfo {
public String prefix; public String prefix;
public String webhookUrl; public String webhookUrl;
public TestBotInfo (String prefix, String webhookUrl) {
this.prefix = prefix;
this.webhookUrl = webhookUrl;
}
} }
@AllArgsConstructor
public static class BotInfo { public static class BotInfo {
public String prefix; public String prefix;
public String key; public String key;
public BotInfo (String prefix, String key) {
this.prefix = prefix;
this.key = key;
}
} }
public static class CustomChat { public static class CustomChat {

View file

@ -28,11 +28,11 @@ public class AutoSkinCommand {
final String username = getString(context, "username"); 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")); if (username.equals("off")) source.sendFeedback(Text.literal("Successfully disabled auto skin"));
else { else {
SelfCare.INSTANCE.hasSkin(false); SelfCare.INSTANCE.hasSkin = false;
source.sendFeedback(Text.literal("Set your auto skin username to: " + username)); source.sendFeedback(Text.literal("Set your auto skin username to: " + username));
} }

View file

@ -68,7 +68,7 @@ public class CloopCommand {
final CommandLoopManager manager = CommandLoopManager.INSTANCE; final CommandLoopManager manager = CommandLoopManager.INSTANCE;
final int id = getInteger(context, "id"); 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); manager.removeAndStop(id);
@ -88,11 +88,11 @@ public class CloopCommand {
public static int listCloops (CommandContext<FabricClientCommandSource> context) { public static int listCloops (CommandContext<FabricClientCommandSource> context) {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final List<CommandLoopManager.CommandLoop> loops = CommandLoopManager.INSTANCE.commandLoops(); final List<CommandLoopManager.CommandLoop> loops = CommandLoopManager.INSTANCE.commandLoops;
int id = 0; int id = 0;
for (CommandLoopManager.CommandLoop loop : loops) { 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++; id++;
} }

View file

@ -38,7 +38,7 @@ public class CustomChatCommand {
public static int enabled (CommandContext<FabricClientCommandSource> context) { public static int enabled (CommandContext<FabricClientCommandSource> context) {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final boolean bool = getBool(context, "boolean"); 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"))); source.sendFeedback(Text.literal("Custom chat is now " + (bool ? "on" : "off")));
return Command.SINGLE_SUCCESS; return Command.SINGLE_SUCCESS;
@ -47,7 +47,7 @@ public class CustomChatCommand {
public static int setFormat (CommandContext<FabricClientCommandSource> context) { public static int setFormat (CommandContext<FabricClientCommandSource> context) {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final String format = getString(context, "format"); 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)); source.sendFeedback(Text.literal("Set the custom chat format to: " + format));
return Command.SINGLE_SUCCESS; return Command.SINGLE_SUCCESS;

View file

@ -28,7 +28,7 @@ public class FullBrightCommand {
final boolean bool = getBool(context, "boolean"); final boolean bool = getBool(context, "boolean");
FullBright.enabled(bool); FullBright.enabled = bool;
source.sendFeedback(Text.literal("Fullbright is now " + (bool ? "enabled" : "disabled"))); source.sendFeedback(Text.literal("Fullbright is now " + (bool ? "enabled" : "disabled")));

View file

@ -28,7 +28,7 @@ public class LoopCrouchCommand {
final boolean enabled = getBool(context, "enabled"); 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"))); source.sendFeedback(Text.literal("Loop crouch is now " + (enabled ? "enabled" : "disabled")));

View file

@ -125,10 +125,10 @@ public class MusicCommand {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final SongPlayer songPlayer = SongPlayer.INSTANCE; 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.stopPlaying();
songPlayer.songQueue().clear(); songPlayer.songQueue.clear();
source.sendFeedback(Text.literal("Stopped music playback").formatted(Formatting.GREEN)); source.sendFeedback(Text.literal("Stopped music playback").formatted(Formatting.GREEN));
return 1; return 1;
@ -138,7 +138,7 @@ public class MusicCommand {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final SongPlayer songPlayer = SongPlayer.INSTANCE; 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.stopPlaying();
source.sendFeedback(Text.literal("Skipped the current song").formatted(Formatting.GREEN)); source.sendFeedback(Text.literal("Skipped the current song").formatted(Formatting.GREEN));
@ -149,7 +149,7 @@ public class MusicCommand {
public int pause (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException { public int pause (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final SongPlayer songPlayer = SongPlayer.INSTANCE; 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(); if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create();
@ -240,7 +240,7 @@ public class MusicCommand {
public int toggleLoop (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException { public int toggleLoop (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final SongPlayer songPlayer = SongPlayer.INSTANCE; 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(); if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create();
@ -255,7 +255,7 @@ public class MusicCommand {
public int loop (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException { public int loop (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final SongPlayer songPlayer = SongPlayer.INSTANCE; final SongPlayer songPlayer = SongPlayer.INSTANCE;
final Song currentSong = songPlayer.currentSong(); final Song currentSong = songPlayer.currentSong;
final int count = getInteger(context, "count"); final int count = getInteger(context, "count");
if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create();
@ -271,7 +271,7 @@ public class MusicCommand {
public int gotoCommand (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException { public int gotoCommand (CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException {
final FabricClientCommandSource source = context.getSource(); final FabricClientCommandSource source = context.getSource();
final SongPlayer songPlayer = SongPlayer.INSTANCE; final SongPlayer songPlayer = SongPlayer.INSTANCE;
final Song currentSong = songPlayer.currentSong(); final Song currentSong = songPlayer.currentSong;
final long millis = getLong(context, "timestamp"); final long millis = getLong(context, "timestamp");
if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create(); if (currentSong == null) throw NO_SONG_IS_CURRENTLY_PLAYING.create();
@ -290,7 +290,7 @@ public class MusicCommand {
final boolean enabled = getBool(context, "boolean"); 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"))); 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"); 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"))); source.sendFeedback(Text.literal("Showing actionbar is now " + (enabled ? "enabled" : "disabled")));
@ -314,7 +314,7 @@ public class MusicCommand {
final float pitch = getFloat(context, "pitch"); final float pitch = getFloat(context, "pitch");
SongPlayer.INSTANCE.pitch(pitch); SongPlayer.INSTANCE.pitch = pitch;
source.sendFeedback( source.sendFeedback(
Text.translatable( Text.translatable(

View file

@ -56,7 +56,7 @@ public class RainbowNameCommand {
final String name = getString(context, "name"); final String name = getString(context, "name");
RainbowName.INSTANCE.displayName(name); RainbowName.INSTANCE.displayName = name;
source.sendFeedback(Text.literal("Set the display name to: " + name)); source.sendFeedback(Text.literal("Set the display name to: " + name));

View file

@ -47,15 +47,15 @@ public class SelfCareCommand {
switch (type) { switch (type) {
case "op" -> { case "op" -> {
SelfCare.INSTANCE.opEnabled(bool); SelfCare.INSTANCE.opEnabled = bool;
source.sendFeedback(Text.literal("The op self care is now " + (bool ? "enabled" : "disabled"))); source.sendFeedback(Text.literal("The op self care is now " + (bool ? "enabled" : "disabled")));
} }
case "gamemode" -> { case "gamemode" -> {
SelfCare.INSTANCE.gamemodeEnabled(bool); SelfCare.INSTANCE.gamemodeEnabled = bool;
source.sendFeedback(Text.literal("The gamemode self care is now " + (bool ? "enabled" : "disabled"))); source.sendFeedback(Text.literal("The gamemode self care is now " + (bool ? "enabled" : "disabled")));
} }
case "cspy" -> { case "cspy" -> {
SelfCare.INSTANCE.cspyEnabled(bool); SelfCare.INSTANCE.cspyEnabled = bool;
source.sendFeedback(Text.literal("The CommandSpy self care is now " + (bool ? "enabled" : "disabled"))); source.sendFeedback(Text.literal("The CommandSpy self care is now " + (bool ? "enabled" : "disabled")));
} }
} }

View file

@ -1,13 +1,14 @@
package land.chipmunk.chipmunkmod.data; package land.chipmunk.chipmunkmod.data;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import lombok.AllArgsConstructor;
import lombok.Data;
// ? Am I reinventing the wheel here? // ? Am I reinventing the wheel here?
@AllArgsConstructor
@Data
public class BlockArea { public class BlockArea {
private BlockPos start; public BlockPos start;
private BlockPos end; public BlockPos end;
public BlockArea (BlockPos start, BlockPos end) {
this.start = start;
this.end = end;
}
} }

View file

@ -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;
}
}

View file

@ -1,19 +1,22 @@
package land.chipmunk.chipmunkmod.data; package land.chipmunk.chipmunkmod.data;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import lombok.AllArgsConstructor;
import lombok.Data;
import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerListS2CPacket;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.world.GameMode; import net.minecraft.world.GameMode;
@Data
@AllArgsConstructor
public class MutablePlayerListEntry { public class MutablePlayerListEntry {
private GameProfile profile; public GameProfile profile;
private GameMode gamemode; public GameMode gamemode;
private int latency; public int latency;
private Text displayName; 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) { public MutablePlayerListEntry (PlayerListS2CPacket.Entry entry) {
this(entry.profile(), entry.gameMode(), entry.latency(), entry.displayName()); this(entry.profile(), entry.gameMode(), entry.latency(), entry.displayName());

View file

@ -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) @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) { public void addMessage(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci) {
try { try {
if (RainbowName.INSTANCE.enabled()) { if (RainbowName.INSTANCE.enabled) {
if (message.getString().contains("Your nickname is now ") || message.getString().contains("Nickname changed.")) { if (message.getString().contains("Your nickname is now ") || message.getString().contains("Nickname changed.")) {
ci.cancel(); ci.cancel();
return; return;

View file

@ -26,7 +26,7 @@ public class ClientPlayerEntityMixin {
final ClientWorld world = CLIENT.getNetworkHandler().getWorld(); 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; } 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))); 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); if (distance > world.getSimulationDistance()) CommandCore.INSTANCE.move(position);

View file

@ -34,10 +34,10 @@ public class KeyboardInputMixin extends Input {
this.jumping = this.settings.jumpKey.isPressed(); this.jumping = this.settings.jumpKey.isPressed();
// ohio code // ohio code
this.sneaking = LoopCrouch.INSTANCE.enabled() ? this.sneaking = LoopCrouch.INSTANCE.enabled ?
!LoopCrouch.INSTANCE.sneaking() : !LoopCrouch.INSTANCE.sneaking :
this.settings.sneakKey.isPressed(); this.settings.sneakKey.isPressed();
LoopCrouch.INSTANCE.sneaking(!LoopCrouch.INSTANCE.sneaking()); LoopCrouch.INSTANCE.sneaking = !LoopCrouch.INSTANCE.sneaking;
if (slowDown) { if (slowDown) {
this.movementSideways *= f; this.movementSideways *= f;

View file

@ -11,6 +11,6 @@ import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
public class LightmapTextureManagerMixin { public class LightmapTextureManagerMixin {
@ModifyArgs(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/NativeImage;setColor(III)V")) @ModifyArgs(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/NativeImage;setColor(III)V"))
private void update (Args args) { private void update (Args args) {
if (FullBright.enabled()) args.set(2, 0xFFFFFFFF); if (FullBright.enabled) args.set(2, 0xFFFFFFFF);
} }
} }

View file

@ -2,8 +2,8 @@ package land.chipmunk.chipmunkmod.modules;
import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.ChipmunkMod;
import land.chipmunk.chipmunkmod.data.BlockArea; import land.chipmunk.chipmunkmod.data.BlockArea;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.block.entity.CommandBlockBlockEntity; import net.minecraft.block.entity.CommandBlockBlockEntity;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtCompound;
@ -18,10 +18,10 @@ import java.util.concurrent.CompletableFuture;
public class CommandCore { public class CommandCore {
private final MinecraftClient client; private final MinecraftClient client;
@Getter @Setter private boolean ready = false; public boolean ready = false;
@Getter @Setter private BlockPos origin; public BlockPos origin;
@Getter private BlockArea relativeArea; public BlockArea relativeArea;
@Getter @Setter private BlockPos currentBlockRelative; public BlockPos currentBlockRelative;
public static CommandCore INSTANCE = new CommandCore(MinecraftClient.getInstance(), ChipmunkMod.CONFIG.core.relativeArea); public static CommandCore INSTANCE = new CommandCore(MinecraftClient.getInstance(), ChipmunkMod.CONFIG.core.relativeArea);
@ -46,17 +46,17 @@ public class CommandCore {
((int) position.getZ() / 16) * 16 ((int) position.getZ() / 16) * 16
); );
if (currentBlockRelative == null) currentBlockRelative = new BlockPos(relativeArea.start()); if (currentBlockRelative == null) currentBlockRelative = new BlockPos(relativeArea.start);
refill(); refill();
} }
public void refill () { public void refill () {
// final PositionManager position = client.position(); // final PositionManager position = client.position();
final BlockPos relStart = relativeArea.start(); final BlockPos relStart = relativeArea.start;
final BlockPos relEnd = relativeArea.end(); final BlockPos relEnd = relativeArea.end;
final String command = String.format( 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 repeating_command_block replace" :
"fill %s %s %s %s %s %s command_block", "fill %s %s %s %s %s %s command_block",
relStart.getX() + origin.getX(), relStart.getX() + origin.getX(),
@ -72,8 +72,8 @@ public class CommandCore {
} }
public void incrementCurrentBlock () { public void incrementCurrentBlock () {
final BlockPos start = relativeArea.start(); final BlockPos start = relativeArea.start;
final BlockPos end = relativeArea.end(); final BlockPos end = relativeArea.end;
int x = currentBlockRelative.getX(); int x = currentBlockRelative.getX();
int y = currentBlockRelative.getY(); int y = currentBlockRelative.getY();

View file

@ -1,7 +1,7 @@
package land.chipmunk.chipmunkmod.modules; package land.chipmunk.chipmunkmod.modules;
import lombok.Getter;
import lombok.Setter;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Timer; import java.util.Timer;
@ -9,7 +9,7 @@ import java.util.TimerTask;
public class CommandLoopManager { public class CommandLoopManager {
private final CommandCore core; private final CommandCore core;
@Getter @Setter private List<CommandLoop> commandLoops = new ArrayList<>(); public List<CommandLoop> commandLoops = new ArrayList<>();
public CommandLoopManager (CommandCore core) { public CommandLoopManager (CommandCore core) {
this.core = core; this.core = core;
@ -40,9 +40,9 @@ public class CommandLoopManager {
public void cleanup () { this.clearLoops(); } public void cleanup () { this.clearLoops(); }
public static class CommandLoop { public static class CommandLoop {
@Getter @Setter private CommandCore core; public CommandCore core;
@Getter @Setter private String command; public String command;
@Getter private long interval; public long interval;
private Timer timer; private Timer timer;
public CommandLoop (CommandCore core, String command, long interval) { public CommandLoop (CommandCore core, String command, long interval) {

View file

@ -2,8 +2,8 @@ package land.chipmunk.chipmunkmod.modules;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.ChipmunkMod;
import lombok.Getter;
import lombok.Setter;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
@ -17,9 +17,9 @@ public class CustomChat {
public static final CustomChat INSTANCE = new CustomChat(MinecraftClient.getInstance()); 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) { public CustomChat (MinecraftClient client) {
this.client = client; this.client = client;

View file

@ -1,9 +1,9 @@
package land.chipmunk.chipmunkmod.modules; package land.chipmunk.chipmunkmod.modules;
import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.ChipmunkMod;
import lombok.Getter;
import lombok.Setter;
public class FullBright { public class FullBright {
@Getter @Setter private static boolean enabled = ChipmunkMod.CONFIG.fullbright; public static boolean enabled = ChipmunkMod.CONFIG.fullbright;
} }

View file

@ -2,7 +2,7 @@ package land.chipmunk.chipmunkmod.modules;
import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.Listener;
import land.chipmunk.chipmunkmod.listeners.ListenerManager; import land.chipmunk.chipmunkmod.listeners.ListenerManager;
import lombok.Getter;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet;
@ -18,7 +18,7 @@ public class KaboomCheck extends Listener {
public static final String SUBTITLE_START_TEXT = "Free OP"; public static final String SUBTITLE_START_TEXT = "Free OP";
@Getter private boolean isKaboom = false; public boolean isKaboom = false;
private boolean hasKaboomTitle = false; private boolean hasKaboomTitle = false;
private boolean hasKaboomSubtitle = false; private boolean hasKaboomSubtitle = false;

View file

@ -1,14 +1,14 @@
package land.chipmunk.chipmunkmod.modules; package land.chipmunk.chipmunkmod.modules;
import lombok.Getter;
import lombok.Setter;
public class LoopCrouch { public class LoopCrouch {
public static final LoopCrouch INSTANCE = new 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 () { public LoopCrouch () {
} }

View file

@ -75,7 +75,7 @@ public class Players extends Listener {
public final MutablePlayerListEntry getEntry (UUID uuid) { public final MutablePlayerListEntry getEntry (UUID uuid) {
try { try {
for (MutablePlayerListEntry candidate : list) { for (MutablePlayerListEntry candidate : list) {
if (candidate.profile().getId().equals(uuid)) { if (candidate.profile.getId().equals(uuid)) {
return candidate; return candidate;
} }
} }
@ -88,7 +88,7 @@ public class Players extends Listener {
public final MutablePlayerListEntry getEntry (String username) { public final MutablePlayerListEntry getEntry (String username) {
for (MutablePlayerListEntry candidate : list) { for (MutablePlayerListEntry candidate : list) {
if (candidate.profile().getName().equals(username)) { if (candidate.profile.getName().equals(username)) {
return candidate; return candidate;
} }
} }
@ -98,7 +98,7 @@ public class Players extends Listener {
public final MutablePlayerListEntry getEntry (Text displayName) { public final MutablePlayerListEntry getEntry (Text displayName) {
for (MutablePlayerListEntry candidate : list) { for (MutablePlayerListEntry candidate : list) {
if (candidate.displayName() != null && candidate.displayName().equals(displayName)) { if (candidate.displayName != null && candidate.displayName.equals(displayName)) {
return candidate; return candidate;
} }
} }
@ -114,7 +114,7 @@ public class Players extends Listener {
try { try {
final MutablePlayerListEntry duplicate = getEntry(newEntry); final MutablePlayerListEntry duplicate = getEntry(newEntry);
if (duplicate != null) { if (duplicate != null) {
removeFromPlayerList(duplicate.profile().getId()); removeFromPlayerList(duplicate.profile.getId());
list.remove(duplicate); list.remove(duplicate);
} }
@ -129,7 +129,7 @@ public class Players extends Listener {
final MutablePlayerListEntry target = getEntry(newEntry); final MutablePlayerListEntry target = getEntry(newEntry);
if (target == null) return; if (target == null) return;
target.gamemode(newEntry.gameMode()); target.gamemode = newEntry.gameMode();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -139,14 +139,14 @@ public class Players extends Listener {
final MutablePlayerListEntry target = getEntry(newEntry); final MutablePlayerListEntry target = getEntry(newEntry);
if (target == null) return; if (target == null) return;
target.latency(newEntry.latency()); target.latency = newEntry.latency();
} }
private void updateDisplayName (PlayerListS2CPacket.Entry newEntry) { private void updateDisplayName (PlayerListS2CPacket.Entry newEntry) {
final MutablePlayerListEntry target = getEntry(newEntry); final MutablePlayerListEntry target = getEntry(newEntry);
if (target == null) return; if (target == null) return;
target.displayName(newEntry.displayName()); target.displayName = newEntry.displayName();
} }
private void removePlayer (UUID uuid) { private void removePlayer (UUID uuid) {
@ -166,7 +166,7 @@ public class Players extends Listener {
future.thenApply(packet -> { future.thenApply(packet -> {
final Suggestions matches = packet.getSuggestions(); 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++) { for (int i = 0; i < matches.getList().size(); i++) {
final Suggestion suggestion = matches.getList().get(i); final Suggestion suggestion = matches.getList().get(i);

View file

@ -1,8 +1,8 @@
package land.chipmunk.chipmunkmod.modules; package land.chipmunk.chipmunkmod.modules;
import land.chipmunk.chipmunkmod.util.ColorUtilities; import land.chipmunk.chipmunkmod.util.ColorUtilities;
import lombok.Getter;
import lombok.Setter;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor; import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
@ -23,11 +23,11 @@ public class RainbowName {
private Timer timer = null; private Timer timer = null;
@Getter @Setter private boolean enabled = false; public boolean enabled = false;
private String[] team; private String[] team;
@Getter @Setter private String displayName; public String displayName;
private int startHue = 0; private int startHue = 0;

View file

@ -3,11 +3,11 @@ package land.chipmunk.chipmunkmod.modules;
import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.ChipmunkMod;
import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.Listener;
import land.chipmunk.chipmunkmod.listeners.ListenerManager; import land.chipmunk.chipmunkmod.listeners.ListenerManager;
import lombok.Setter;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.network.ClientPlayerEntity;
import lombok.Getter;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import java.util.Timer; import java.util.Timer;
@ -17,17 +17,17 @@ import static land.chipmunk.chipmunkmod.util.ServerUtilities.serverHasCommand;
public class SelfCare extends Listener { public class SelfCare extends Listener {
private final MinecraftClient client; private final MinecraftClient client;
@Getter private final long interval; public final long interval;
@Getter private final long chatInterval; public final long chatInterval;
@Getter @Setter private boolean opEnabled = true; public boolean opEnabled = true;
@Getter @Setter private boolean gamemodeEnabled = true; public boolean gamemodeEnabled = true;
@Getter @Setter private boolean cspyEnabled = true; public boolean cspyEnabled = true;
@Getter @Setter private String skin; public String skin;
private boolean cspy = false; private boolean cspy = false;
@Getter @Setter private boolean hasSkin = false; public boolean hasSkin = false;
private Timer timer = null; private Timer timer = null;
private Timer chatTimer = null; private Timer chatTimer = null;

View file

@ -8,8 +8,8 @@ import land.chipmunk.chipmunkmod.song.Song;
import land.chipmunk.chipmunkmod.song.SongLoaderException; import land.chipmunk.chipmunkmod.song.SongLoaderException;
import land.chipmunk.chipmunkmod.song.SongLoaderThread; import land.chipmunk.chipmunkmod.song.SongLoaderThread;
import land.chipmunk.chipmunkmod.util.MathUtilities; import land.chipmunk.chipmunkmod.util.MathUtilities;
import lombok.Getter;
import lombok.Setter;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
@ -42,16 +42,16 @@ public class SongPlayer {
public static final SongPlayer INSTANCE = new SongPlayer(MinecraftClient.getInstance()); public static final SongPlayer INSTANCE = new SongPlayer(MinecraftClient.getInstance());
@Getter @Setter private Song currentSong; public Song currentSong;
@Getter @Setter private LinkedList<Song> songQueue = new LinkedList<>(); public LinkedList<Song> songQueue = new LinkedList<>();
@Getter @Setter private Timer playTimer; public Timer playTimer;
@Getter @Setter private SongLoaderThread loaderThread; public SongLoaderThread loaderThread;
private int ticksUntilPausedActionbar = 20; private int ticksUntilPausedActionbar = 20;
@Getter @Setter private boolean useCore = true; public boolean useCore = true;
@Getter @Setter private boolean actionbar = true; public boolean actionbar = true;
@Getter @Setter private float pitch = 0; public float pitch = 0;
private final MinecraftClient client; private final MinecraftClient client;
@ -73,7 +73,7 @@ public class SongPlayer {
_loaderThread.start(); _loaderThread.start();
loaderThread = _loaderThread; loaderThread = _loaderThread;
} catch (SongLoaderException e) { } 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; loaderThread = null;
} }
} }
@ -90,7 +90,7 @@ public class SongPlayer {
_loaderThread.start(); _loaderThread.start();
loaderThread = _loaderThread; loaderThread = _loaderThread;
} catch (SongLoaderException e) { } 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; loaderThread = null;
} }
} }
@ -110,7 +110,7 @@ public class SongPlayer {
if (loaderThread != null && !loaderThread.isAlive()) { if (loaderThread != null && !loaderThread.isAlive()) {
if (loaderThread.exception != null) { 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 { } else {
songQueue.add(loaderThread.song); 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)); client.player.sendMessage(Component.translatable("Added %s to the song queue", Component.empty().append(loaderThread.song.name).color(NamedTextColor.DARK_GREEN)).color(NamedTextColor.GREEN));

View file

@ -1,14 +1,19 @@
package land.chipmunk.chipmunkmod.song; package land.chipmunk.chipmunkmod.song;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public class Note implements Comparable<Note> { public class Note implements Comparable<Note> {
public Instrument instrument; public Instrument instrument;
public int pitch; public int pitch;
public float volume; public float volume;
public long time; 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 @Override
public int compareTo(Note other) { public int compareTo(Note other) {
if (time < other.time) { if (time < other.time) {

View file

@ -1,10 +1,9 @@
package land.chipmunk.chipmunkmod.song; package land.chipmunk.chipmunkmod.song;
import lombok.Getter;
import net.minecraft.text.Text; import net.minecraft.text.Text;
public class SongLoaderException extends Exception { public class SongLoaderException extends Exception {
@Getter private final Text message; public final Text message;
public SongLoaderException (Text message) { public SongLoaderException (Text message) {
super(); super();

View file

@ -31,7 +31,7 @@
"depends": { "depends": {
"fabricloader": ">=0.14.11", "fabricloader": ">=0.14.11",
"fabric-api": "*", "fabric-api": "*",
"minecraft": ">1.19.3", "minecraft": ">1.20",
"java": ">=17" "java": ">=17"
}, },
"suggests": { "suggests": {