Skip to content

Commit 22e8e31

Browse files
Add Battle TARDIS exterior
1 parent 837fccd commit 22e8e31

File tree

15 files changed

+57
-12
lines changed

15 files changed

+57
-12
lines changed

src/main/java/me/eccentric_nz/TARDIS/TARDISConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public class TARDISConstants {
257257
Material.CYAN_STAINED_GLASS_PANE, Material.GRAY_STAINED_GLASS_PANE, Material.WHITE_DYE, Material.ORANGE_DYE, Material.MAGENTA_DYE,
258258
Material.LIGHT_BLUE_DYE, Material.YELLOW_DYE, Material.LIME_DYE, Material.PINK_DYE, Material.GRAY_DYE, Material.LIGHT_GRAY_DYE,
259259
Material.CYAN_DYE, Material.PURPLE_DYE, Material.BLUE_DYE, Material.BROWN_DYE, Material.GREEN_DYE, Material.RED_DYE, Material.BLACK_DYE,
260-
Material.LEATHER_HORSE_ARMOR, Material.ENDER_PEARL, Material.GREEN_STAINED_GLASS_PANE
260+
Material.LEATHER_HORSE_ARMOR, Material.ENDER_PEARL, Material.GREEN_STAINED_GLASS_PANE, Material.RED_STAINED_GLASS_PANE
261261
);
262262
public static final UUID UUID_ZERO = new UUID(0, 0);
263263

src/main/java/me/eccentric_nz/TARDIS/blueprints/BlueprintPreset.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public enum BlueprintPreset {
2222
ANDESITE("tardis.preset.andesite"),
2323
ANGEL("tardis.preset.angel"),
2424
APPERTURE("tardis.preset.apperture"),
25+
BATTLE("tardis.preset.battle"),
2526
CAKE("tardis.preset.cake"),
2627
CANDY("tardis.preset.candy"),
2728
CHALICE("tardis.preset.chalice"),

src/main/java/me/eccentric_nz/TARDIS/builders/exterior/TARDISBuilderUtility.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public static Material getMaterialForArmourStand(ChameleonPreset preset, int id,
118118
case COLOURED -> { return Material.LEATHER_HORSE_ARMOR; }
119119
case PANDORICA -> { return Material.ENDER_PEARL; }
120120
case SIDRAT -> { return Material.GREEN_STAINED_GLASS_PANE; }
121+
case BATTLE -> { return Material.RED_STAINED_GLASS_PANE; }
121122
default -> {
122123
String split = preset.toString().replace("POLICE_BOX_", "");
123124
String dye = split + "_DYE";
@@ -153,6 +154,7 @@ public static void setPoliceBoxHelmet(TARDIS plugin, ChameleonPreset preset, Bui
153154
case ENDER_PEARL -> im.setItemModel(ChameleonVariant.PANDORICA_CLOSED.getKey());
154155
case GREEN_STAINED_GLASS_PANE -> im.setItemModel(ChameleonVariant.SIDRAT_CLOSED.getKey());
155156
case GRAY_STAINED_GLASS_PANE -> im.setItemModel(ChameleonVariant.WEEPING_ANGEL_CLOSED.getKey());
157+
case RED_STAINED_GLASS_PANE -> im.setItemModel(ChameleonVariant.BATTLE_CLOSED.getKey());
156158
// CUSTOM
157159
default -> im.setItemModel(new NamespacedKey(plugin, getCustomModelPath(dye.toString()) + "_closed"));
158160
}
@@ -162,6 +164,7 @@ public static void setPoliceBoxHelmet(TARDIS plugin, ChameleonPreset preset, Bui
162164
case WEEPING_ANGEL -> pb = "Weeping Angel";
163165
case PANDORICA -> pb = "Pandorica";
164166
case SIDRAT -> pb = "SIDRAT";
167+
case BATTLE -> pb = "Battle TARDIS";
165168
case ITEM -> {
166169
for (String k : plugin.getCustomModelConfig().getConfigurationSection("models").getKeys(false)) {
167170
if (plugin.getCustomModelConfig().getString("models." + k + ".item").equals(dye.toString())) {

src/main/java/me/eccentric_nz/TARDIS/builders/exterior/TARDISMaterialisePoliceBox.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public void run() {
103103
case CYAN_STAINED_GLASS_PANE -> ChameleonVariant.TENNANT_STAINED.getKey();
104104
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_STAINED.getKey();
105105
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_STAINED.getKey();
106+
case RED_STAINED_GLASS_PANE -> ChameleonVariant.BATTLE_STAINED.getKey();
106107
case ENDER_PEARL -> ChameleonVariant.PANDORICA_STAINED.getKey();
107108
case LEATHER_HORSE_ARMOR -> ColouredVariant.TINTED_STAINED.getKey();
108109
default -> new NamespacedKey(plugin, TARDISBuilderUtility.getCustomModelPath(dye.toString()) + "_stained");
@@ -115,9 +116,10 @@ public void run() {
115116
LIGHT_GRAY_DYE, LIME_DYE, MAGENTA_DYE, ORANGE_DYE,
116117
PINK_DYE, PURPLE_DYE, RED_DYE, WHITE_DYE,
117118
YELLOW_DYE, LEATHER_HORSE_ARMOR, CYAN_STAINED_GLASS_PANE -> ChameleonVariant.GLASS.getKey();
118-
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_STAINED.getKey();
119-
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_STAINED.getKey();
120-
case ENDER_PEARL -> ChameleonVariant.PANDORICA_STAINED.getKey();
119+
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_GLASS.getKey();
120+
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_GLASS.getKey();
121+
case RED_STAINED_GLASS_PANE -> ChameleonVariant.BATTLE_GLASS.getKey();
122+
case ENDER_PEARL -> ChameleonVariant.PANDORICA_GLASS.getKey();
121123
default -> new NamespacedKey(plugin, TARDISBuilderUtility.getCustomModelPath(dye.toString()) + "_glass");
122124
};
123125
light.setBlockData(TARDISConstants.AIR);
@@ -142,6 +144,7 @@ public void run() {
142144
case CYAN_STAINED_GLASS_PANE -> ChameleonVariant.TENNANT_CLOSED.getKey();
143145
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_CLOSED.getKey();
144146
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_CLOSED.getKey();
147+
case RED_STAINED_GLASS_PANE -> ChameleonVariant.BATTLE_CLOSED.getKey();
145148
case ENDER_PEARL -> ChameleonVariant.PANDORICA_CLOSED.getKey();
146149
case LEATHER_HORSE_ARMOR -> ColouredVariant.TINTED_CLOSED.getKey();
147150
default -> new NamespacedKey(plugin, TARDISBuilderUtility.getCustomModelPath(dye.toString()) + "_closed");
@@ -198,8 +201,7 @@ public void run() {
198201
sound = "junk_land";
199202
} else {
200203
sound = switch (bd.getThrottle()) {
201-
case WARP, RAPID, FASTER ->
202-
"tardis_land_" + bd.getThrottle().toString().toLowerCase(Locale.ROOT);
204+
case WARP, RAPID, FASTER -> "tardis_land_" + bd.getThrottle().toString().toLowerCase(Locale.ROOT);
203205
default -> "tardis_land"; // NORMAL
204206
};
205207
}
@@ -212,6 +214,7 @@ public void run() {
212214
case WEEPING_ANGEL -> pb = "Weeping Angel";
213215
case PANDORICA -> pb = "Pandorica";
214216
case SIDRAT -> pb = "SIDRAT";
217+
case BATTLE -> pb = "Battle TARDIS";
215218
case ITEM -> {
216219
for (String k : plugin.getCustomModelConfig().getConfigurationSection("models").getKeys(false)) {
217220
if (dye.toString().equals(plugin.getCustomModelConfig().getString("models." + k + ".item"))) {

src/main/java/me/eccentric_nz/TARDIS/chameleon/gui/TARDISPoliceBoxInventory.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ private ItemStack[] getItemStack() {
142142
boxes[i] = sid;
143143
i++;
144144
}
145+
// BATTLE
146+
if (TARDISPermission.hasPermission(player, "tardis.preset.battle")) {
147+
ItemStack bat = ItemStack.of(Material.RED_STAINED_GLASS_PANE, 1);
148+
ItemMeta tle = bat.getItemMeta();
149+
tle.displayName(Component.text("Battle TARDIS"));
150+
tle.setItemModel(ChameleonVariant.BATTLE_CLOSED.getKey());
151+
bat.setItemMeta(tle);
152+
boxes[i] = bat;
153+
i++;
154+
}
145155
if (TARDISPermission.hasPermission(player, "tardis.preset.police_box_tinted")) {
146156
ItemStack any = ItemStack.of(Material.LEATHER_HORSE_ARMOR, 1);
147157
ItemMeta colour = any.getItemMeta();

src/main/java/me/eccentric_nz/TARDIS/chameleon/gui/TARDISPoliceBoxListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void onChameleonPoliceBoxClick(InventoryClickEvent event) {
9898
// set the Chameleon Circuit sign(s)
9999
HashMap<String, Object> set = new HashMap<>();
100100
switch (slot) {
101-
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 -> {
101+
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 -> {
102102
// armour stand preset
103103
ChameleonPreset selected = ChameleonPreset.getItemFramePresetBySlot(slot);
104104
set.put("chameleon_preset", selected.toString());
@@ -109,7 +109,7 @@ public void onChameleonPoliceBoxClick(InventoryClickEvent event) {
109109
new TARDISChameleonFrame().updateChameleonFrame(selected, rsf.getLocation());
110110
}
111111
plugin.getMessenger().sendInsertedColour(player, "CHAM_SET", selected.getDisplayName(), plugin);
112-
if (slot == 20) {
112+
if (slot == 21) {
113113
// any colour - open the colour picker
114114
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () ->
115115
player.openInventory(new TARDISColourPickerGUI(plugin).getInventory()), 2L);

src/main/java/me/eccentric_nz/TARDIS/commands/dev/TARDISDevBoxCommand.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ public boolean setPreset(CommandSender sender, String[] args) {
269269
default -> model = ChameleonVariant.SIDRAT_CLOSED.getKey();
270270
}
271271
}
272+
case RED_STAINED_GLASS_PANE -> {
273+
switch (args[2]) {
274+
case "open" -> model = ChameleonVariant.BATTLE_OPEN.getKey();
275+
case "stained" -> model = ChameleonVariant.BATTLE_STAINED.getKey();
276+
case "glass" -> model = ChameleonVariant.BATTLE_GLASS.getKey();
277+
default -> model = ChameleonVariant.BATTLE_CLOSED.getKey();
278+
}
279+
}
272280
}
273281
}
274282
im.setItemModel(model);

src/main/java/me/eccentric_nz/TARDIS/commands/tardis/TARDISAbandonCommand.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ boolean doAbandon(CommandSender sender, boolean list) {
293293
case WEEPING_ANGEL -> pb = "Weeping Angel";
294294
case PANDORICA -> pb = "Pandorica";
295295
case SIDRAT -> pb = "SIDRAT";
296+
case BATTLE -> pb = "Battle TARDIS";
296297
case ITEM -> {
297298
for (String k : plugin.getCustomModelConfig().getConfigurationSection("models").getKeys(false)) {
298299
if (is.getType().toString().equals(plugin.getCustomModelConfig().getString("models." + k + ".item"))) {

src/main/java/me/eccentric_nz/TARDIS/custommodels/keys/ChameleonVariant.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ public enum ChameleonVariant {
9696
BAD_WOLF_STAINED(new NamespacedKey(TARDIS.plugin, "chameleon_blue_stained")),
9797
BAD_WOLF_SGLASS(new NamespacedKey(TARDIS.plugin, "chameleon_glass")),
9898
BAD_WOLF_CAMERA(new NamespacedKey(TARDIS.plugin, "chameleon_bad_wolf_camera")),
99+
BATTLE_CLOSED(new NamespacedKey(TARDIS.plugin, "battle_tardis_closed")),
100+
BATTLE_OPEN(new NamespacedKey(TARDIS.plugin, "battle_tardis_open")),
101+
BATTLE_STAINED(new NamespacedKey(TARDIS.plugin, "battle_tardis_stained")),
102+
BATTLE_GLASS(new NamespacedKey(TARDIS.plugin, "battle_tardis_glass")),
103+
BATTLE_CAMERA(new NamespacedKey(TARDIS.plugin, "battle_tardis_camera")),
99104
TYPE_40_CLOSED(new NamespacedKey(TARDIS.plugin, "type_40_closed")),
100105
TYPE_40_OPEN(new NamespacedKey(TARDIS.plugin, "type_40_open")),
101106
TYPE_40_STAINED(new NamespacedKey(TARDIS.plugin, "type_40_stained")),

src/main/java/me/eccentric_nz/TARDIS/destroyers/TARDISDematerialisePoliceBox.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void run() {
9090
case CYAN_STAINED_GLASS_PANE -> ChameleonVariant.TENNANT_STAINED.getKey();
9191
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_STAINED.getKey();
9292
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_STAINED.getKey();
93+
case RED_STAINED_GLASS_PANE -> ChameleonVariant.BATTLE_STAINED.getKey();
9394
case ENDER_PEARL -> ChameleonVariant.PANDORICA_STAINED.getKey();
9495
case LEATHER_HORSE_ARMOR -> ColouredVariant.TINTED_STAINED.getKey();
9596
default -> new NamespacedKey(plugin, TARDISBuilderUtility.getCustomModelPath(dye.toString()) + "_stained");
@@ -104,6 +105,7 @@ public void run() {
104105
YELLOW_DYE, LEATHER_HORSE_ARMOR, CYAN_STAINED_GLASS_PANE -> ChameleonVariant.GLASS.getKey();
105106
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_GLASS.getKey();
106107
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_GLASS.getKey();
108+
case RED_STAINED_GLASS_PANE -> ChameleonVariant.BATTLE_GLASS.getKey();
107109
case ENDER_PEARL -> ChameleonVariant.PANDORICA_GLASS.getKey();
108110
default -> new NamespacedKey(plugin, TARDISBuilderUtility.getCustomModelPath(dye.toString()) + "_glass");
109111
};
@@ -129,6 +131,7 @@ public void run() {
129131
case CYAN_STAINED_GLASS_PANE -> ChameleonVariant.TENNANT_CLOSED.getKey();
130132
case GRAY_STAINED_GLASS_PANE -> ChameleonVariant.WEEPING_ANGEL_CLOSED.getKey();
131133
case GREEN_STAINED_GLASS_PANE -> ChameleonVariant.SIDRAT_CLOSED.getKey();
134+
case RED_STAINED_GLASS_PANE -> ChameleonVariant.BATTLE_CLOSED.getKey();
132135
case ENDER_PEARL -> ChameleonVariant.PANDORICA_CLOSED.getKey();
133136
case LEATHER_HORSE_ARMOR -> ColouredVariant.TINTED_CLOSED.getKey();
134137
default -> new NamespacedKey(plugin, TARDISBuilderUtility.getCustomModelPath(dye.toString()) + "_closed");
@@ -179,8 +182,7 @@ public void run() {
179182
if (!minecart) {
180183
String sound = switch (spaceTimeThrottle) {
181184
case WARP, RAPID, FASTER -> "tardis_takeoff_" + spaceTimeThrottle.toString().toLowerCase(Locale.ROOT);
182-
default -> // NORMAL
183-
"tardis_takeoff";
185+
default -> "tardis_takeoff"; // NORMAL
184186
};
185187
TARDISSounds.playTARDISSound(dd.getLocation(), sound);
186188
} else {

0 commit comments

Comments
 (0)