Skip to content

Commit 9fd5dac

Browse files
Fix not being able to update the modelled TARDIS double door
1 parent b953ecf commit 9fd5dac

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/main/java/me/eccentric_nz/TARDIS/commands/give/TARDISDisplayBlockCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public TARDISDisplayBlockCommand(TARDIS plugin) {
4141

4242
public ItemStack getStack(String arg) {
4343
String display = TARDISStringUtils.toEnumUppercase(arg);
44-
if (display.startsWith("DOOR_") || display.endsWith("_DOOR")) {
44+
if (display.startsWith("DOOR") || display.endsWith("_DOOR")) {
4545
Door door = Door.byName.get(display);
4646
ItemStack is = ItemStack.of(door.getMaterial(), 1);
4747
ItemMeta im = is.getItemMeta();

src/main/java/me/eccentric_nz/TARDIS/customblocks/TARDISDisplayItem.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,16 @@ public boolean isSeed() {
348348
}
349349
}
350350
}
351+
352+
public boolean isDoor() {
353+
switch (this) {
354+
case DOOR, DOOR_OPEN, DOOR_BOTH_OPEN, BONE_DOOR, BONE_DOOR_OPEN, CLASSIC_DOOR, CLASSIC_DOOR_OPEN,
355+
CUSTOM_DOOR -> {
356+
return true;
357+
}
358+
default -> {
359+
return false;
360+
}
361+
}
362+
}
351363
}

src/main/java/me/eccentric_nz/TARDIS/doors/TARDISCustomDoorLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public void addDoors() {
3838
Door bone = new Door("bone_door", Material.BIRCH_DOOR, new int[]{0,1,2,3,4}, 4, false, "classic_door", "classic_door", false);
3939
Door.byMaterial.put(Material.IRON_DOOR, police_box);
4040
Door.byName.put("POLICE_BOX_DOOR", police_box);
41+
Door.byName.put("DOOR", police_box);
42+
Door.byName.put("TARDIS_DOOR", police_box);
4143
Door.byMaterial.put(Material.CHERRY_DOOR, classic);
4244
Door.byName.put("CLASSIC_DOOR", classic);
4345
Door.byMaterial.put(Material.BIRCH_DOOR, bone);

src/main/java/me/eccentric_nz/TARDIS/recipes/TARDISDisplayItemRecipe.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public void addDisplayItemRecipes() {
5151
im.displayName(ComponentUtils.toWhite(tdi.getDisplayName()));
5252
if (tdi.getCustomModel() != null) {
5353
im.getPersistentDataContainer().set(TARDIS.plugin.getCustomBlockKey(), PersistentDataType.STRING, tdi.getCustomModel().getKey());
54+
if (tdi.isDoor()) {
55+
im.setItemModel(tdi.getCustomModel());
56+
}
5457
}
5558
is.setItemMeta(im);
5659
NamespacedKey key = new NamespacedKey(plugin, tdi.getName());

0 commit comments

Comments
 (0)