Kajetan Johannes Hammerle 3 rokov pred
rodič
commit
4cdba5c508

+ 0 - 17
src/main/java/me/km/snuviscript/commands/WorldCommands.java

@@ -26,23 +26,6 @@ public class WorldCommands {
             Difficulty diffi = Difficulty.valueOf(in[1].getString(sc).toUpperCase());
             ((World) in[0].get(sc)).getWorldInfo().setDifficulty(diffi);
         });
-        sm.registerConsumer("world.setgamerule", (sc, in) -> {
-            Object o = ((World) in[0].get(sc)).getGameRules().get(Mapper.getGameRule(in[1].getString(sc)));
-            if(o instanceof GameRules.BooleanValue) {
-                ((GameRules.BooleanValue) o).set(in[2].getBoolean(sc), server);
-            } else if(o instanceof GameRules.IntegerValue) {
-                ReflectionUtils.setIntegerValue((GameRules.IntegerValue) o, in[2].getInt(sc));
-            }
-        });
-        sm.registerFunction("world.getgamerule", (sc, in) -> {
-            Object o = ((World) in[0].get(sc)).getGameRules().get(Mapper.getGameRule(in[1].getString(sc)));
-            if(o instanceof GameRules.BooleanValue) {
-                return ((GameRules.BooleanValue) o).get();
-            } else if(o instanceof GameRules.IntegerValue) {
-                return (double) ((GameRules.IntegerValue) o).get();
-            }
-            return null;
-        });
         sm.registerConsumer("world.setspawn", (sc, in) -> {
             Location l = ((Location) in[0].get(sc));
             l.getWorld().getWorldInfo().setSpawn(l.getBlockPos());

+ 0 - 58
src/main/java/me/km/utils/Mapper.java

@@ -48,64 +48,6 @@ public class Mapper {
         return ForgeRegistries.BLOCKS.getValue(new ResourceLocation(name));
     }
 
-    public static GameRules.RuleKey getGameRule(String name) {
-        switch(name) {
-            case "doFireTick":
-                return GameRules.DO_FIRE_TICK;
-            case "mobGriefing":
-                return GameRules.MOB_GRIEFING;
-            case "keepInventory":
-                return GameRules.KEEP_INVENTORY;
-            case "doMobSpawning":
-                return GameRules.DO_MOB_SPAWNING;
-            case "doMobLoot":
-                return GameRules.DO_MOB_LOOT;
-            case "doTileDrops":
-                return GameRules.DO_TILE_DROPS;
-            case "doEntityDrops":
-                return GameRules.DO_ENTITY_DROPS;
-            case "commandBlockOutput":
-                return GameRules.COMMAND_BLOCK_OUTPUT;
-            case "naturalRegeneration":
-                return GameRules.NATURAL_REGENERATION;
-            case "doDaylightCycle":
-                return GameRules.DO_DAYLIGHT_CYCLE;
-            case "logAdminCommands":
-                return GameRules.LOG_ADMIN_COMMANDS;
-            case "showDeathMessages":
-                return GameRules.SHOW_DEATH_MESSAGES;
-            case "randomTickSpeed":
-                return GameRules.RANDOM_TICK_SPEED;
-            case "sendCommandFeedback":
-                return GameRules.SEND_COMMAND_FEEDBACK;
-            case "reducedDebugInfo":
-                return GameRules.REDUCED_DEBUG_INFO;
-            case "spectatorsGenerateChunks":
-                return GameRules.SPECTATORS_GENERATE_CHUNKS;
-            case "spawnRadius":
-                return GameRules.SPAWN_RADIUS;
-            case "disableElytraMovementCheck":
-                return GameRules.DISABLE_ELYTRA_MOVEMENT_CHECK;
-            case "maxEntityCramming":
-                return GameRules.MAX_ENTITY_CRAMMING;
-            case "doWeatherCycle":
-                return GameRules.DO_WEATHER_CYCLE;
-            case "doLimitedCrafting":
-                return GameRules.DO_LIMITED_CRAFTING;
-            case "maxCommandChainLength":
-                return GameRules.MAX_COMMAND_CHAIN_LENGTH;
-            case "announceAdvancements":
-                return GameRules.ANNOUNCE_ADVANCEMENTS;
-            case "disableRaids":
-                return GameRules.DISABLE_RAIDS;
-            case "doInsomnia":
-                return GameRules.DO_INSOMNIA;
-            case "doImmediateRespawn":
-                return GameRules.DO_IMMEDIATE_RESPAWN;
-        }
-        return null;
-    }
-
     public static IProperty getProperty(String name) {
         switch(name) {
             case "attached":