removed testrules
This commit is contained in:
parent
627cdbda97
commit
1b023932db
5 changed files with 0 additions and 127 deletions
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"_fv": 47,
|
|
||||||
"_type": "command",
|
|
||||||
"definition": {
|
|
||||||
"commandName": "testrules",
|
|
||||||
"permissionLevel": "4",
|
|
||||||
"argsxml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"args_start\" deletable=\"false\" x=\"40\" y=\"40\"><next><block type=\"logic\"><field name=\"name\">enable</field><statement name=\"args\"><block type=\"call_procedure\"><field name=\"procedure\">TestRulesP</field></block></statement></block></next></block></xml>"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"_fv": 47,
|
|
||||||
"_type": "procedure",
|
|
||||||
"definition": {
|
|
||||||
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"65\" y=\"68\"><field name=\"trigger\">no_ext_trigger</field><next><block type=\"controls_if\"><mutation else=\"1\"></mutation><value name=\"IF0\"><block type=\"get_command_parameter_logic\"><field name=\"param\">enabled</field></block></value><statement name=\"DO0\"><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">KEEP_INVENTORY</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">DO_MOB_SPAWNING</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">DO_DAYLIGHT_CYCLE</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">DO_WEATHER_CYCLE</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"entity_send_chat\"><value name=\"text\"><block type=\"text\"><field name=\"TEXT\">Test rules enabled!</field></block></value><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"actbar\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></next></block></next></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">KEEP_INVENTORY</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value><next><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">DO_MOB_SPAWNING</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">DO_DAYLIGHT_CYCLE</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"world_data_logic_setgamerule\"><field name=\"gamerulesboolean\">DO_WEATHER_CYCLE</field><value name=\"gameruleValue\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><next><block type=\"entity_send_chat\"><value name=\"text\"><block type=\"text\"><field name=\"TEXT\">Test rules disabled!</field></block></value><value name=\"entity\"><block type=\"entity_from_deps\"></block></value><value name=\"actbar\"><block type=\"logic_boolean\"><field name=\"BOOL\">FALSE</field></block></value></block></next></block></next></block></next></block></next></block></statement></block></next></block></xml>"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -61,46 +61,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "TestRules",
|
|
||||||
"type": "command",
|
|
||||||
"sortid": 6,
|
|
||||||
"compiles": true,
|
|
||||||
"locked_code": false,
|
|
||||||
"registry_name": "test_rules",
|
|
||||||
"metadata": {
|
|
||||||
"files": [
|
|
||||||
"src/main/java/net/seaswimmerthefsh/heartgeodes/command/TestRulesCommand.java"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "TestRulesP",
|
|
||||||
"type": "procedure",
|
|
||||||
"sortid": 7,
|
|
||||||
"compiles": true,
|
|
||||||
"locked_code": false,
|
|
||||||
"registry_name": "test_rules_p",
|
|
||||||
"metadata": {
|
|
||||||
"files": [
|
|
||||||
"src/main/java/net/seaswimmerthefsh/heartgeodes/procedures/TestRulesPProcedure.java"
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
{
|
|
||||||
"name": "arguments",
|
|
||||||
"type": "cmdcontext"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "entity",
|
|
||||||
"type": "entity"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "world",
|
|
||||||
"type": "world"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "LargeHeartBud",
|
"name": "LargeHeartBud",
|
||||||
"type": "block",
|
"type": "block",
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
|
|
||||||
package net.seaswimmerthefsh.heartgeodes.command;
|
|
||||||
|
|
||||||
import org.checkerframework.checker.units.qual.s;
|
|
||||||
|
|
||||||
import net.seaswimmerthefsh.heartgeodes.procedures.TestRulesPProcedure;
|
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.Mod;
|
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
||||||
import net.minecraftforge.event.RegisterCommandsEvent;
|
|
||||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
|
||||||
|
|
||||||
import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.server.level.ServerLevel;
|
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.commands.Commands;
|
|
||||||
|
|
||||||
import com.mojang.brigadier.arguments.BoolArgumentType;
|
|
||||||
|
|
||||||
@Mod.EventBusSubscriber
|
|
||||||
public class TestRulesCommand {
|
|
||||||
@SubscribeEvent
|
|
||||||
public static void registerCommand(RegisterCommandsEvent event) {
|
|
||||||
event.getDispatcher().register(Commands.literal("testrules").requires(s -> s.hasPermission(4)).then(Commands.argument("enable", BoolArgumentType.bool()).executes(arguments -> {
|
|
||||||
ServerLevel world = arguments.getSource().getLevel();
|
|
||||||
double x = arguments.getSource().getPosition().x();
|
|
||||||
double y = arguments.getSource().getPosition().y();
|
|
||||||
double z = arguments.getSource().getPosition().z();
|
|
||||||
Entity entity = arguments.getSource().getEntity();
|
|
||||||
if (entity == null)
|
|
||||||
entity = FakePlayerFactory.getMinecraft(world);
|
|
||||||
Direction direction = entity.getDirection();
|
|
||||||
|
|
||||||
TestRulesPProcedure.execute(world, arguments, entity);
|
|
||||||
return 0;
|
|
||||||
})));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
package net.seaswimmerthefsh.heartgeodes.procedures;
|
|
||||||
|
|
||||||
import net.minecraft.world.level.LevelAccessor;
|
|
||||||
import net.minecraft.world.level.GameRules;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
|
||||||
|
|
||||||
import com.mojang.brigadier.context.CommandContext;
|
|
||||||
import com.mojang.brigadier.arguments.BoolArgumentType;
|
|
||||||
|
|
||||||
public class TestRulesPProcedure {
|
|
||||||
public static void execute(LevelAccessor world, CommandContext<CommandSourceStack> arguments, Entity entity) {
|
|
||||||
if (entity == null)
|
|
||||||
return;
|
|
||||||
if (BoolArgumentType.getBool(arguments, "enabled")) {
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_KEEPINVENTORY).set(true, world.getServer());
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_DOMOBSPAWNING).set(false, world.getServer());
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_DAYLIGHT).set(false, world.getServer());
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_WEATHER_CYCLE).set(false, world.getServer());
|
|
||||||
if (entity instanceof Player _player && !_player.level().isClientSide())
|
|
||||||
_player.displayClientMessage(Component.literal("Test rules enabled!"), false);
|
|
||||||
} else {
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_KEEPINVENTORY).set(false, world.getServer());
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_DOMOBSPAWNING).set(true, world.getServer());
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_DAYLIGHT).set(true, world.getServer());
|
|
||||||
world.getLevelData().getGameRules().getRule(GameRules.RULE_WEATHER_CYCLE).set(true, world.getServer());
|
|
||||||
if (entity instanceof Player _player && !_player.level().isClientSide())
|
|
||||||
_player.displayClientMessage(Component.literal("Test rules disabled!"), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue