(update) disable the use of /time and /weather

This commit is contained in:
iceBear67 committed 2024-10-03 09:51:50 +08:00
1 parent 4e457b530b
commit 93a497d6cb
4 files changed
+14 -11

No files matched your search

@@ -13,10 +13,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(World.class)
public abstract class WorldMixin {
@Shadow public abstract boolean isClient();
@Shadow @Final private RegistryKey<World> registryKey;
@Shadow
public abstract boolean isClient();
@Unique private GameRules sfcraft$customGameRule;
@Shadow
@Final
private RegistryKey<World> registryKey;
@Unique
private GameRules sfcraft$customGameRule;
@Inject(method = "getGameRules", at = @At("HEAD"), cancellable = true)
private void beforeGetGameRules(CallbackInfoReturnable<GameRules> cir) {
@@ -1,4 +1,4 @@
package io.ib67.sfcraft.mixin.server.subserver;
package io.ib67.sfcraft.mixin.server.subserver.command;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.MinecraftServer;
@@ -39,8 +39,6 @@ import java.util.Set;
public class CreativeRoomModule extends ServerModule {
private static final Set<String> BYPASS_PERMISSIONS = Set.of(
"minecraft.command.weather",
"minecraft.command.time",
"minecraft.command.gamerule",
"carpet.command.player",
"carpet.command.track",
@@ -120,7 +118,7 @@ public class CreativeRoomModule extends ServerModule {
public void onPlayerJoin(ServerPlayerEntity player) {
player.sendMessage(Text.of("你现在正在创造游乐园中,使用 //schem list 查看可用投影。"));
player.sendMessage(Text.literal("以下功能现在可用:").withColor(Colors.WHITE)
.append(Text.literal("/player /track /summon /setblock /time /gamerule /weather 及 WorldEdit 的所有命令").withColor(Color.MAGENTA.getRGB()).append("。")));
.append(Text.literal("/player /track /summon /setblock /gamerule 及 WorldEdit 的所有命令").withColor(Color.MAGENTA.getRGB()).append("。")));
player.sendMessage(Text.of(" "));
player.sendMessage(Text.literal("如何上传投影到游乐场: ").withColor(Colors.GRAY)
.append(Text.literal("https://github.com/saltedfishclub/sfcraft-schematics").withColor(Colors.GRAY).styled(it -> it.withUnderline(true))) );
+4 -4
View File
@@ -5,9 +5,9 @@
"compatibilityLevel": "JAVA_21",
"mixins": [
"common.bridge.EntityBridge",
"common.bridge.ItemBridge",
"common.bridge.ServerPlayerBridge",
"common.bridge.ServerWorldBridge",
"common.bridge.ItemBridge"
"common.bridge.ServerWorldBridge"
],
"client": [
],
@@ -34,13 +34,13 @@
"server.item.PlayerEntityMixin",
"server.optimize.LivingEntityMixin",
"server.subserver.EntityMixin",
"server.subserver.GameRuleCommandMixin",
"server.subserver.PlayerListS2CPacket$EntryMixin",
"server.subserver.PlayerManagerMixin",
"server.subserver.PlayerSaveHandlerMixin",
"server.subserver.ServerLoginNetworkHandlerMixin",
"server.subserver.ServerPlayerEntityMixin",
"server.subserver.WorldMixin"
"server.subserver.WorldMixin",
"server.subserver.command.GameRuleCommandMixin"
],
"injectors": {
"defaultRequire": 1