@@ -13,14 +13,55 @@ namespace coral_fans::commands {
13
13
void registerMineruleCommand (CommandPermissionLevel permission) {
14
14
using ll::i18n_literals::operator " " _tr;
15
15
16
- coral_fans::functions::DropHookManager::getInstance ().bedrockDrop =
17
- coral_fans::mod ().getConfigDb ()->get (" minerule.bedrockDrop" ) == " true" ;
18
- coral_fans::functions::DropHookManager::getInstance ().mbDrop =
19
- coral_fans::mod ().getConfigDb ()->get (" minerule.movingBlockDrop" ) == " true" ;
20
-
21
16
auto & mineruleCommand = ll::command::CommandRegistrar::getInstance ()
22
17
.getOrCreateCommand (" minerule" , " command.minerule.description" _tr (), permission);
23
18
19
+ // mineruleCommand.runtimeOverload()
20
+ // .text("fuck_bedrock_no_drop")
21
+ // .required("isopen", ll::command::ParamKind::Bool)
22
+ // .execute([](CommandOrigin const&, CommandOutput& output, ll::command::RuntimeCommand const& self) {
23
+ // bool isopen = self["isopen"].get<ll::command::ParamKind::Bool>();
24
+ // if (isopen) {
25
+ // if (coral_fans::mod().getConfigDb()->set("minerule.bedrockDrop", "true")) {
26
+ // output.success("command.minerule.bedrockDrop.success.true"_tr());
27
+ // coral_fans::functions::DropHookManager::getInstance().bedrockDrop = true;
28
+ // functions::dropHook();
29
+ // } else output.error("command.minerule.bedrockDrop.error"_tr());
30
+ // } else {
31
+ // if (coral_fans::mod().getConfigDb()->set("minerule.bedrockDrop", "false")) {
32
+ // output.success("command.minerule.bedrockDrop.success.false"_tr());
33
+ // coral_fans::functions::DropHookManager::getInstance().bedrockDrop = false;
34
+ // functions::dropHook();
35
+ // } else output.error("command.minerule.bedrockDrop.error"_tr());
36
+ // }
37
+ // });
38
+
39
+ // mineruleCommand.runtimeOverload()
40
+ // .text("fuck_movingBlock_no_drop")
41
+ // .required("isopen", ll::command::ParamKind::Bool)
42
+ // .execute([](CommandOrigin const&, CommandOutput& output, ll::command::RuntimeCommand const& self) {
43
+ // bool isopen = self["isopen"].get<ll::command::ParamKind::Bool>();
44
+ // if (isopen) {
45
+ // if (coral_fans::mod().getConfigDb()->set("minerule.movingBlockDrop", "true")) {
46
+ // output.success("command.minerule.movingBlockDrop.success.true"_tr());
47
+ // coral_fans::functions::DropHookManager::getInstance().mbDrop = true;
48
+ // functions::dropHook();
49
+ // } else output.error("command.minerule.movingBlockDrop.error"_tr());
50
+ // } else {
51
+ // if (coral_fans::mod().getConfigDb()->set("minerule.movingBlockDrop", "false")) {
52
+ // output.success("command.minerule.movingBlockDrop.success.false"_tr());
53
+ // coral_fans::functions::DropHookManager::getInstance().mbDrop = false;
54
+ // functions::dropHook();
55
+ // } else output.error("command.minerule.movingBlockDrop.error"_tr());
56
+ // }
57
+ // });
58
+
59
+ // coral_fans::functions::DropHookManager::getInstance().bedrockDrop =
60
+ // coral_fans::mod().getConfigDb()->get("minerule.bedrockDrop") == "true";
61
+ // coral_fans::functions::DropHookManager::getInstance().mbDrop =
62
+ // coral_fans::mod().getConfigDb()->get("minerule.movingBlockDrop") == "true";
63
+ // functions::dropHook();
64
+
24
65
mineruleCommand.runtimeOverload ()
25
66
.text (" fuck_bedrock_no_drop" )
26
67
.required (" isopen" , ll::command::ParamKind::Bool)
@@ -29,17 +70,16 @@ void registerMineruleCommand(CommandPermissionLevel permission) {
29
70
if (isopen) {
30
71
if (coral_fans::mod ().getConfigDb ()->set (" minerule.bedrockDrop" , " true" )) {
31
72
output.success (" command.minerule.bedrockDrop.success.true" _tr ());
32
- coral_fans::functions::DropHookManager::getInstance ().bedrockDrop = true ;
33
- functions::DropHookManager::getInstance ().dropHook ();
73
+ coral_fans::functions::bedrockDropHook (true );
34
74
} else output.error (" command.minerule.bedrockDrop.error" _tr ());
35
75
} else {
36
76
if (coral_fans::mod ().getConfigDb ()->set (" minerule.bedrockDrop" , " false" )) {
37
77
output.success (" command.minerule.bedrockDrop.success.false" _tr ());
38
- coral_fans::functions::DropHookManager::getInstance ().bedrockDrop = false ;
39
- functions::DropHookManager::getInstance ().dropHook ();
78
+ coral_fans::functions::bedrockDropHook (false );
40
79
} else output.error (" command.minerule.bedrockDrop.error" _tr ());
41
80
}
42
81
});
82
+ functions::bedrockDropHook (coral_fans::mod ().getConfigDb ()->get (" minerule.bedrockDrop" ) == " true" );
43
83
44
84
mineruleCommand.runtimeOverload ()
45
85
.text (" fuck_movingBlock_no_drop" )
@@ -49,19 +89,16 @@ void registerMineruleCommand(CommandPermissionLevel permission) {
49
89
if (isopen) {
50
90
if (coral_fans::mod ().getConfigDb ()->set (" minerule.movingBlockDrop" , " true" )) {
51
91
output.success (" command.minerule.movingBlockDrop.success.true" _tr ());
52
- coral_fans::functions::DropHookManager::getInstance ().mbDrop = true ;
53
- functions::DropHookManager::getInstance ().dropHook ();
92
+ coral_fans::functions::mbDropHook (true );
54
93
} else output.error (" command.minerule.movingBlockDrop.error" _tr ());
55
94
} else {
56
95
if (coral_fans::mod ().getConfigDb ()->set (" minerule.movingBlockDrop" , " false" )) {
57
96
output.success (" command.minerule.movingBlockDrop.success.false" _tr ());
58
- coral_fans::functions::DropHookManager::getInstance ().mbDrop = false ;
59
- functions::DropHookManager::getInstance ().dropHook ();
97
+ coral_fans::functions::mbDropHook (false );
60
98
} else output.error (" command.minerule.movingBlockDrop.error" _tr ());
61
99
}
62
100
});
63
-
64
- functions::DropHookManager::getInstance ().dropHook ();
101
+ functions::bedrockDropHook (coral_fans::mod ().getConfigDb ()->get (" minerule.movingBlockDrop" ) == " true" );
65
102
66
103
mineruleCommand.runtimeOverload ()
67
104
.text (" replicated_portal_sand_farm" )
@@ -77,9 +114,7 @@ void registerMineruleCommand(CommandPermissionLevel permission) {
77
114
} else output.error (" command.minerule.replicated_portal_sand_farm.error" _tr ());
78
115
});
79
116
80
- functions::hook_portal_sand_farm (
81
- coral_fans::mod ().getConfigDb ()->get (" minerule.replicated_portal_sand_farm" ) == " true"
82
- );
117
+ functions::hook_portal_sand_farm (mod ().getConfigDb ()->get (" minerule.replicated_portal_sand_farm" ) == " true" );
83
118
84
119
mineruleCommand.runtimeOverload ()
85
120
.text (" remove_portal_pigzombie_cd" )
@@ -94,5 +129,7 @@ void registerMineruleCommand(CommandPermissionLevel permission) {
94
129
functions::portal_spawn_hook (isopen);
95
130
} else output.error (" command.minerule.remove_portal_pigzombie_cd.error" _tr ());
96
131
});
132
+
133
+ functions::portal_spawn_hook (mod ().getConfigDb ()->get (" minerule.remove_portal_pigzombie_cd" ) == " true" );
97
134
}
98
135
} // namespace coral_fans::commands
0 commit comments