forked from ChomeNS/chipmunkmod
remove some commands for some reason
This commit is contained in:
parent
2452f555ef
commit
9a92ccbfec
10 changed files with 0 additions and 241 deletions
|
@ -33,14 +33,11 @@ public class CommandManager {
|
|||
ItemCommand.register(this.dispatcher, commandRegistryAccess);
|
||||
CustomChatCommand.register(this.dispatcher);
|
||||
EvalCommand.register(this.dispatcher);
|
||||
FullBrightCommand.register(this.dispatcher);
|
||||
MusicCommand.register(this.dispatcher);
|
||||
RainbowNameCommand.register(this.dispatcher);
|
||||
SayCommand.register(this.dispatcher);
|
||||
SelfCareCommand.register(this.dispatcher);
|
||||
AutoSkinCommand.register(this.dispatcher);
|
||||
ReloadConfigCommand.register(this.dispatcher);
|
||||
LoopCrouchCommand.register(this.dispatcher);
|
||||
}
|
||||
|
||||
public void executeCommand (String command) {
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.commands;
|
||||
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import land.chipmunk.chipmunkmod.modules.FullBright;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import static com.mojang.brigadier.arguments.BoolArgumentType.bool;
|
||||
import static com.mojang.brigadier.arguments.BoolArgumentType.getBool;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.argument;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.literal;
|
||||
|
||||
public class FullBrightCommand {
|
||||
public static void register (CommandDispatcher<FabricClientCommandSource> dispatcher) {
|
||||
dispatcher.register(
|
||||
literal("fullbright")
|
||||
.then(
|
||||
argument("boolean", bool())
|
||||
.executes(FullBrightCommand::set)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public static int set (CommandContext<FabricClientCommandSource> context) {
|
||||
final FabricClientCommandSource source = context.getSource();
|
||||
|
||||
final boolean bool = getBool(context, "boolean");
|
||||
|
||||
FullBright.enabled = bool;
|
||||
|
||||
source.sendFeedback(Text.literal("Fullbright is now " + (bool ? "enabled" : "disabled")));
|
||||
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.commands;
|
||||
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import land.chipmunk.chipmunkmod.modules.LoopCrouch;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import static com.mojang.brigadier.arguments.BoolArgumentType.bool;
|
||||
import static com.mojang.brigadier.arguments.BoolArgumentType.getBool;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.argument;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.literal;
|
||||
|
||||
public class LoopCrouchCommand {
|
||||
public static void register (CommandDispatcher<FabricClientCommandSource> dispatcher) {
|
||||
dispatcher.register(
|
||||
literal("loopcrouch")
|
||||
.then(
|
||||
argument("enabled", bool())
|
||||
.executes(LoopCrouchCommand::run)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public static int run (CommandContext<FabricClientCommandSource> context) {
|
||||
final FabricClientCommandSource source = context.getSource();
|
||||
|
||||
final boolean enabled = getBool(context, "enabled");
|
||||
|
||||
LoopCrouch.INSTANCE.enabled = enabled;
|
||||
|
||||
source.sendFeedback(Text.literal("Loop crouch is now " + (enabled ? "enabled" : "disabled")));
|
||||
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.commands;
|
||||
|
||||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import land.chipmunk.chipmunkmod.modules.SelfCare;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import static com.mojang.brigadier.arguments.BoolArgumentType.bool;
|
||||
import static com.mojang.brigadier.arguments.BoolArgumentType.getBool;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.argument;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.literal;
|
||||
|
||||
public class SelfCareCommand {
|
||||
public static void register (CommandDispatcher<FabricClientCommandSource> dispatcher) {
|
||||
dispatcher.register(
|
||||
literal("selfcare")
|
||||
.then(
|
||||
literal("op")
|
||||
.then(
|
||||
argument("boolean", bool())
|
||||
.executes(m -> setSelfCare(m, "op"))
|
||||
)
|
||||
)
|
||||
.then(
|
||||
literal("gamemode")
|
||||
.then(
|
||||
argument("boolean", bool())
|
||||
.executes(m -> setSelfCare(m, "gamemode"))
|
||||
)
|
||||
)
|
||||
.then(
|
||||
literal("cspy")
|
||||
.then(
|
||||
argument("boolean", bool())
|
||||
.executes(m -> setSelfCare(m, "cspy"))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// setSelfCare is probably not a good name for this
|
||||
public static int setSelfCare (CommandContext<FabricClientCommandSource> context, String type) {
|
||||
final FabricClientCommandSource source = context.getSource();
|
||||
final boolean bool = getBool(context, "boolean");
|
||||
|
||||
switch (type) {
|
||||
case "op" -> {
|
||||
SelfCare.INSTANCE.opEnabled = bool;
|
||||
source.sendFeedback(Text.literal("The op self care is now " + (bool ? "enabled" : "disabled")));
|
||||
}
|
||||
case "gamemode" -> {
|
||||
SelfCare.INSTANCE.gamemodeEnabled = bool;
|
||||
source.sendFeedback(Text.literal("The gamemode self care is now " + (bool ? "enabled" : "disabled")));
|
||||
}
|
||||
case "cspy" -> {
|
||||
SelfCare.INSTANCE.cspyEnabled = bool;
|
||||
source.sendFeedback(Text.literal("The CommandSpy self care is now " + (bool ? "enabled" : "disabled")));
|
||||
}
|
||||
}
|
||||
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
}
|
|
@ -38,7 +38,6 @@ public class ClientPlayNetworkHandlerMixin {
|
|||
KaboomCheck.INSTANCE.onJoin();
|
||||
CommandManager.INSTANCE = new CommandManager(ChipmunkMod.CONFIG.commands.prefix, commandRegistryAccess);
|
||||
SelfCare.INSTANCE.onJoin();
|
||||
LoopCrouch.INSTANCE.init();
|
||||
SongPlayer.INSTANCE.coreReady();
|
||||
RainbowName.INSTANCE.init();
|
||||
}
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.modules.LoopCrouch;
|
||||
import net.minecraft.client.input.Input;
|
||||
import net.minecraft.client.input.KeyboardInput;
|
||||
import net.minecraft.client.option.GameOptions;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(KeyboardInput.class)
|
||||
public class KeyboardInputMixin extends Input {
|
||||
@Final
|
||||
@Mutable
|
||||
@Shadow
|
||||
private final GameOptions settings;
|
||||
|
||||
public KeyboardInputMixin (GameOptions settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("TAIL"))
|
||||
private void tick (boolean slowDown, float f, CallbackInfo ci) {
|
||||
this.pressingForward = this.settings.forwardKey.isPressed();
|
||||
this.pressingBack = this.settings.backKey.isPressed();
|
||||
this.pressingLeft = this.settings.leftKey.isPressed();
|
||||
this.pressingRight = this.settings.rightKey.isPressed();
|
||||
this.movementForward = getMovementMultiplier(this.pressingForward, this.pressingBack);
|
||||
this.movementSideways = getMovementMultiplier(this.pressingLeft, this.pressingRight);
|
||||
this.jumping = this.settings.jumpKey.isPressed();
|
||||
|
||||
// ohio code
|
||||
this.sneaking = LoopCrouch.INSTANCE.enabled ?
|
||||
!LoopCrouch.INSTANCE.sneaking :
|
||||
this.settings.sneakKey.isPressed();
|
||||
LoopCrouch.INSTANCE.sneaking = !LoopCrouch.INSTANCE.sneaking;
|
||||
|
||||
if (slowDown) {
|
||||
this.movementSideways *= f;
|
||||
this.movementForward *= f;
|
||||
}
|
||||
}
|
||||
|
||||
private float getMovementMultiplier(boolean positive, boolean negative) {
|
||||
if (positive == negative) {
|
||||
return 0.0f;
|
||||
}
|
||||
return positive ? 1.0f : -1.0f;
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.modules.FullBright;
|
||||
import net.minecraft.client.render.LightmapTextureManager;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
@Mixin(LightmapTextureManager.class)
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.modules;
|
||||
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
|
||||
|
||||
|
||||
public class FullBright {
|
||||
public static boolean enabled = ChipmunkMod.CONFIG.fullbright;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.modules;
|
||||
|
||||
|
||||
|
||||
|
||||
public class LoopCrouch {
|
||||
public static final LoopCrouch INSTANCE = new LoopCrouch();
|
||||
|
||||
public boolean enabled = false;
|
||||
|
||||
public boolean sneaking = false;
|
||||
|
||||
public LoopCrouch () {
|
||||
}
|
||||
|
||||
public void init () {}
|
||||
}
|
|
@ -14,11 +14,9 @@
|
|||
"ClientPlayNetworkHandlerAccessor",
|
||||
"ClientPlayNetworkHandlerMixin",
|
||||
"MinecraftClientAccessor",
|
||||
"LightmapTextureManagerMixin",
|
||||
"DecoderHandlerMixin",
|
||||
"StringHelperMixin",
|
||||
"NbtIoMixin",
|
||||
"KeyboardInputMixin",
|
||||
"ElderGuardianAppearanceParticleMixin",
|
||||
"IdentifierMixin",
|
||||
"DecoratedPotBlockEntitySherdsMixin",
|
||||
|
|
Loading…
Reference in a new issue