Skip to content

Commit 162302a

Browse files
committed
Add more opt-in commands
1 parent 55eeca4 commit 162302a

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

docs/server_installation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ These commands are:
55
- We may consider re-allowing this command if a line-of-sight test is implemented before the result is printed to the user. If you are interested in contributing this feature, please join the Discord and discuss the implementation with us. We could then add an `--x-ray` flag to enable current behaviour with the opt-in.
66
- `/careastats` doesn't tell you where the blocks are but it does tell you the existence of blocks in an area, which could for example be used to effectively widen your branch mine tunnel.
77
- `/csignsearch` can search for signs hidden behind other blocks.
8-
- `/cfind` can search for entities hidden behind other blocks.
8+
- `/cfind` can search for entities hidden behind blocks.
9+
- `/cglow entities` can search for entities hidden behind blocks.
10+
- `/cgetdata entity` can search for and get data (including coordinates) from entities hidden behind blocks.
911
- `/cghostblock` has the side effect of enabling flight by walking on the created ghost blocks.
1012

1113
Other commands considered but not included in the list requiring the opt-in are:
1214
- `/cfinditem` only searches containers near the player by clicking on them, unless the player is opped.
1315
- In the near future we may implement a more powerful mode if clientcommands is installed on the server.
1416
- `/csnap` is a teleport but restricted to a maximum of one block distance, reflecting its intention of being used for precise alignment ("snapping") rather than longer-distance teleportation, speed hacks, or flying. It needs to be used with a script or macro to be at all an effective method to do these things, which is functionality that clientcommands doesn't provide.
17+
- `/cgetdata block` requires you to already know the coordinates of the block you want to get data from, making it an ineffective method to X-ray.
1518

1619
If you want to continue using these commands, ask your server admin to install Fabric Loader and place clientcommands and Fabric API in the mods folder. If there is enough demand for it, we may also implement a Paper plugin and a NeoForge mod which implements the same opt-in functionality.
1720

src/main/java/net/earthcomputer/clientcommands/command/GetDataCommand.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.mojang.brigadier.exceptions.CommandSyntaxException;
1010
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
1111
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
12+
import net.earthcomputer.clientcommands.server.ClientCommandsServer;
1213
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
1314
import net.minecraft.client.Minecraft;
1415
import net.minecraft.core.BlockPos;
@@ -43,6 +44,7 @@ public class GetDataCommand {
4344
private static final Function<String, AccessorType> CLIENT_ENTITY_DATA_ACCESSOR = argName -> new AccessorType() {
4445
@Override
4546
public DataAccessor getAccessor(CommandContext<FabricClientCommandSource> ctx) throws CommandSyntaxException {
47+
ClientCommandsServer.requirePrivileges();
4648
return new EntityDataAccessor(getEntity(ctx, argName));
4749
}
4850

src/main/java/net/earthcomputer/clientcommands/command/GlowCommand.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import dev.xpple.clientarguments.arguments.CEntitySelector;
88
import net.earthcomputer.clientcommands.interfaces.IEntity_Glowable;
99
import net.earthcomputer.clientcommands.render.RenderQueue;
10+
import net.earthcomputer.clientcommands.server.ClientCommandsServer;
1011
import net.earthcomputer.clientcommands.task.SimpleTask;
1112
import net.earthcomputer.clientcommands.task.TaskManager;
1213
import net.earthcomputer.clientcommands.util.CComponentUtil;
@@ -74,6 +75,7 @@ public static void register(CommandDispatcher<FabricClientCommandSource> dispatc
7475
}
7576

7677
private static int glowEntities(FabricClientCommandSource source, CEntitySelector entitySelector, int seconds, int color) throws CommandSyntaxException {
78+
ClientCommandsServer.requirePrivileges();
7779
boolean keepSearching = getFlag(source, FLAG_KEEP_SEARCHING);
7880
if (keepSearching) {
7981
String taskName = TaskManager.addTask("cglow", new SimpleTask() {

0 commit comments

Comments
 (0)