16
16
*/
17
17
package me .eccentric_nz .TARDIS .commands ;
18
18
19
- import java .util .*;
20
19
import me .eccentric_nz .TARDIS .TARDIS ;
21
20
import me .eccentric_nz .TARDIS .blueprints .TARDISPermission ;
22
21
import me .eccentric_nz .TARDIS .customblocks .TARDISDisplayItem ;
23
- import me .eccentric_nz .TARDIS .enumeration .Consoles ;
24
- import me .eccentric_nz .TARDIS .enumeration .RecipeCategory ;
25
- import me .eccentric_nz .TARDIS .enumeration .RecipeItem ;
26
- import me .eccentric_nz .TARDIS .enumeration .Schematic ;
27
- import me .eccentric_nz .TARDIS .enumeration .TardisModule ;
22
+ import me .eccentric_nz .TARDIS .enumeration .*;
28
23
import me .eccentric_nz .TARDIS .messaging .TARDISRecipeLister ;
29
24
import me .eccentric_nz .TARDIS .recipes .TARDISRecipeCategoryInventory ;
30
25
import net .md_5 .bungee .api .ChatColor ;
38
33
import org .bukkit .persistence .PersistentDataType ;
39
34
import org .jetbrains .annotations .NotNull ;
40
35
36
+ import java .util .*;
37
+
41
38
/**
42
- * A Time Control Unit is a golden sphere about the size of a Cricket ball. It
43
- * is stored in the Secondary Control Room. All TARDISes have one of these
44
- * devices, which can be used to remotely control a TARDIS by broadcasting
45
- * Stattenheim signals that travel along the time contours in the Space/Time
46
- * Vortex.
39
+ * A Time Control Unit is a golden sphere about the size of a Cricket ball. It is stored in the Secondary Control Room.
40
+ * All TARDISes have one of these devices, which can be used to remotely control a TARDIS by broadcasting Stattenheim
41
+ * signals that travel along the time contours in the Space/Time Vortex.
47
42
*
48
43
* @author eccentric_nz
49
44
*/
@@ -58,7 +53,22 @@ public TARDISRecipeCommands(TARDIS plugin) {
58
53
recipeItems .put ("seed" , "" );
59
54
recipeItems .put ("tardis" , "" );
60
55
for (RecipeItem recipeItem : RecipeItem .values ()) {
61
- recipeItems .put (recipeItem .toTabCompletionString (), recipeItem .toRecipeString ());
56
+ if (recipeItem .getCategory () != RecipeCategory .UNCRAFTABLE && recipeItem .getCategory () != RecipeCategory .UNUSED ) {
57
+ recipeItems .put (recipeItem .toTabCompletionString (), recipeItem .toRecipeString ());
58
+ }
59
+ }
60
+ // remove recipes form modules that are not enabled
61
+ if (!plugin .getConfig ().getBoolean ("modules.vortex_manipulator" )) {
62
+ recipeItems .remove ("vortex-manipulator" );
63
+ }
64
+ if (!plugin .getConfig ().getBoolean ("modules.sonic_blaster" )) {
65
+ recipeItems .remove ("sonic-blaster" );
66
+ recipeItems .remove ("blaster-battery" );
67
+ recipeItems .remove ("landing-pad" );
68
+ }
69
+ if (!plugin .getConfig ().getBoolean ("modules.weeping_angels" )) {
70
+ recipeItems .remove ("judoon-ammunition" );
71
+ recipeItems .remove ("k9" );
62
72
}
63
73
// DELUXE, ELEVENTH, TWELFTH, ARS & REDSTONE schematics designed by Lord_Rahl and killeratnight at mcnovus.net
64
74
t .put ("ANCIENT" , Material .SCULK ); // ancient
@@ -129,7 +139,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N
129
139
player .openInventory (categories );
130
140
return true ;
131
141
}
132
- if (!recipeItems .containsKey (args [0 ].toLowerCase (Locale .ENGLISH ))) {
142
+ String which = args [0 ].toLowerCase ();
143
+ if (!recipeItems .containsKey (which )) {
133
144
if (args [0 ].equalsIgnoreCase ("list_more" )) {
134
145
new TARDISRecipeLister (plugin , sender ).listMore ();
135
146
} else {
@@ -149,9 +160,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N
149
160
showTARDISRecipe (player , args [1 ].toUpperCase (Locale .ENGLISH ));
150
161
return true ;
151
162
}
152
- String which = args [0 ].toLowerCase ();
153
163
switch (which ) {
154
- case "bowl-of-custard" , "jelly-baby" , "biome-storage-disk" , "player-storage-disk" , "preset-storage-disk" , "save-storage-disk" , "schematic-wand" , "admin-upgrade" , "bio-scanner-upgrade" , "redstone-upgrade" , "diamond-upgrade" , "emerald-upgrade" , "painter-upgrade" , "ignite-upgrade" , "pickup-arrows-upgrade" , "knockback-upgrade" -> {
164
+ case "bowl-of-custard" , "jelly-baby" , "biome-storage-disk" , "player-storage-disk" , "preset-storage-disk" , "save-storage-disk" , "schematic-wand" , "admin-upgrade" , "bio-scanner-upgrade" , "redstone-upgrade" , "diamond-upgrade" , "emerald-upgrade" , "painter-upgrade" , "ignite-upgrade" , "pickup-arrows-upgrade" , "knockback-upgrade" , "brush-upgrade" , "judoon-ammunition" -> {
155
165
showShapelessRecipe (player , recipeItems .get (which ));
156
166
return true ;
157
167
}
0 commit comments