Integrate patch 7 chest models and fix storage setup controls
This commit is contained in:
parent
deb0e2f161
commit
b47b0ece3a
12 changed files with 92 additions and 29 deletions
|
|
@ -1,6 +1,6 @@
|
|||
plugins { java }
|
||||
group = "com.example"
|
||||
version = "1.0.4"
|
||||
version = "1.0.5"
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public final class StorageItems {
|
|||
}
|
||||
|
||||
public ItemStack create(String id, int tierNumber) {
|
||||
Material base = switch (id) { case ENDER -> Material.BARREL; case HOPPER -> Material.HOPPER; case WRENCH -> Material.KNOWLEDGE_BOOK; default -> Material.CRAFTING_TABLE; };
|
||||
Material base = switch (id) { case ENDER -> Material.ENDER_CHEST; case HOPPER -> Material.HOPPER; case WRENCH -> Material.KNOWLEDGE_BOOK; default -> Material.CRAFTING_TABLE; };
|
||||
ItemStack item = new ItemStack(base); ItemMeta m = item.getItemMeta();
|
||||
var pdc = m.getPersistentDataContainer(); pdc.set(type, PersistentDataType.STRING, id);
|
||||
List<Component> lore = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import net.kyori.adventure.text.format.NamedTextColor;
|
|||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.*;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.type.Barrel;
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.entity.*;
|
||||
|
|
@ -34,6 +35,14 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
private final List<BukkitTask> tasks = new ArrayList<>();
|
||||
private final Map<String, List<UUID>> displays = new HashMap<>(); private final Map<String, String> signatures = new HashMap<>();
|
||||
private int counter;
|
||||
private final Map<UUID, RecipeSession> recipeSessions = new HashMap<>();
|
||||
private record RecipeSession(InventoryView view, Menu menu) {}
|
||||
|
||||
private Menu menuOf(InventoryView view) {
|
||||
if (view.getTopInventory().getHolder() instanceof Menu menu) return menu;
|
||||
RecipeSession session = recipeSessions.get(view.getPlayer().getUniqueId());
|
||||
return session != null && session.view() == view ? session.menu() : null;
|
||||
}
|
||||
|
||||
/** Menu holder: kind is tune, filter or recipe; blockKey names the tracked block. */
|
||||
private static final class Menu implements InventoryHolder {
|
||||
|
|
@ -74,7 +83,7 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
String[] a = key.split(";"); World w = Bukkit.getWorld(a[0]); if (w == null) return null;
|
||||
return p.loc = new Location(w, Integer.parseInt(a[1]), Integer.parseInt(a[2]), Integer.parseInt(a[3]));
|
||||
}
|
||||
private BlockFace front(Block b) { return b.getBlockData() instanceof Barrel bar ? bar.getFacing() : BlockFace.SOUTH; }
|
||||
private BlockFace front(Block b) { return b.getBlockData() instanceof Directional facing ? facing.getFacing() : BlockFace.SOUTH; }
|
||||
private String freq(StorageData.Placed p) { return StorageRules.frequency(p.colors, p.priv ? p.owner : null); }
|
||||
private boolean canUse(Player pl, StorageData.Placed p) { return !p.priv || p.owner == null || p.owner.equals(pl.getUniqueId()) || pl.hasPermission("dune.admin"); }
|
||||
|
||||
|
|
@ -86,6 +95,10 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
if (p.kind == StorageData.Kind.ENDER_CHEST && b.getBlockData() instanceof Barrel bar) {
|
||||
bar.setFacing(e.getPlayer().getFacing().getOppositeFace()); bar.setOpen(false); b.setBlockData(bar);
|
||||
}
|
||||
if (p.kind == StorageData.Kind.ENDER_CHEST && b.getBlockData() instanceof org.bukkit.block.data.type.EnderChest chest) {
|
||||
chest.setFacing(e.getPlayer().getFacing().getOppositeFace());
|
||||
b.setBlockData(chest);
|
||||
}
|
||||
data.blocks.put(StorageData.key(b), p); data.dirty = true;
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +153,10 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
String key = StorageData.key(b);
|
||||
switch (p.kind) {
|
||||
case ENDER_CHEST -> {
|
||||
if (sneak && !empty) return;
|
||||
if (sneak && !empty) {
|
||||
e.setUseInteractedBlock(Event.Result.DENY);
|
||||
return;
|
||||
}
|
||||
e.setCancelled(true);
|
||||
if (!canUse(pl, p)) { say(pl, "This Ender Chest is private."); return; }
|
||||
if (isDye(hand.getType()) && e.getBlockFace() == BlockFace.UP && e.getInteractionPoint() != null) {
|
||||
|
|
@ -231,11 +247,15 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
/** Vanilla crafting-table window: slot 0 is the result, slots 1-9 the 3x3 grid. */
|
||||
private static int gridSlot(int g) { return g + 1; }
|
||||
private void openRecipe(Player pl, String key, StorageData.Placed p) {
|
||||
pl.openInventory(recipePreview(key, p, pl.getWorld()));
|
||||
Menu holder = new Menu("recipe", key, p);
|
||||
InventoryView view = pl.openInventory(recipePreview(holder, pl.getWorld()));
|
||||
if (view != null && view.getType() == InventoryType.WORKBENCH) {
|
||||
recipeSessions.put(pl.getUniqueId(), new RecipeSession(view, holder));
|
||||
}
|
||||
}
|
||||
|
||||
private Inventory recipePreview(String key, StorageData.Placed placed, World world) {
|
||||
var holder = new Menu("recipe", key, placed);
|
||||
private Inventory recipePreview(Menu holder, World world) {
|
||||
StorageData.Placed placed = holder.recipeBlock;
|
||||
Inventory preview = Bukkit.createInventory(holder, InventoryType.WORKBENCH, Component.text("Auto Crafter Recipe"));
|
||||
holder.inventory = preview;
|
||||
for (int g = 0; g < placed.recipe.length; g++) {
|
||||
|
|
@ -254,16 +274,17 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
@EventHandler public void click(InventoryClickEvent e) {
|
||||
var top = e.getView().getTopInventory();
|
||||
if (top.getHolder() instanceof StorageData.FreqHolder) { data.dirty = true; return; }
|
||||
if (!(top.getHolder() instanceof Menu m)) return;
|
||||
Menu m = menuOf(e.getView());
|
||||
if (m == null) return;
|
||||
int rawSlot = e.getRawSlot();
|
||||
if (m.recipeBlock != null && rawSlot >= top.getSize()
|
||||
&& e.getClickedInventory() == e.getView().getBottomInventory()
|
||||
if (rawSlot >= top.getSize()
|
||||
&& e.getClickedInventory() != null
|
||||
&& StorageRules.canUseRecipeCursor(e.getClick(), e.getAction())) {
|
||||
return;
|
||||
}
|
||||
e.setCancelled(true);
|
||||
var p = data.blocks.get(m.blockKey); if (p == null || !(e.getWhoClicked() instanceof Player pl)) return;
|
||||
if (e.getClickedInventory() != top) return;
|
||||
if (rawSlot < 0 || rawSlot >= top.getSize()) return;
|
||||
int slot = e.getRawSlot(); ItemStack cursor = e.getCursor();
|
||||
switch (m.kind) {
|
||||
case "filter" -> {
|
||||
|
|
@ -277,11 +298,18 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
default -> { }
|
||||
}
|
||||
}
|
||||
@EventHandler public void drag(InventoryDragEvent e) { if (e.getView().getTopInventory().getHolder() instanceof Menu) e.setCancelled(true); }
|
||||
@EventHandler public void drag(InventoryDragEvent e) {
|
||||
if (menuOf(e.getView()) == null) return;
|
||||
int size = e.getView().getTopInventory().getSize();
|
||||
if (e.getRawSlots().stream().anyMatch(slot -> slot < size)) e.setCancelled(true);
|
||||
}
|
||||
@EventHandler public void close(InventoryCloseEvent e) {
|
||||
var inv = e.getInventory();
|
||||
if (inv.getHolder() instanceof StorageData.FreqHolder) { data.dirty = true; signatures.clear(); return; }
|
||||
if (!(inv.getHolder() instanceof Menu m)) return;
|
||||
Menu m = menuOf(e.getView());
|
||||
if (m == null) return;
|
||||
recipeSessions.computeIfPresent(e.getPlayer().getUniqueId(),
|
||||
(id, session) -> session.view() == e.getView() ? null : session);
|
||||
var p = data.blocks.get(m.blockKey);
|
||||
if (m.recipeBlock != null) {
|
||||
saveRecipeAndClearPreview(inv, m.recipeBlock == p ? p : null);
|
||||
|
|
@ -328,7 +356,7 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
switch (p.kind) {
|
||||
case SPEED_HOPPER -> { if (b.getType() != Material.HOPPER) { remove(en.getKey()); continue; } hopper(b, p); if (counter % 25 == 0) hopperDisplay(en.getKey(), b, p); }
|
||||
case AUTO_CRAFTER -> { if (b.getType() != Material.CRAFTING_TABLE) { remove(en.getKey()); continue; } if (counter % 10 == 0) crafter(b, p); }
|
||||
case ENDER_CHEST -> { if (b.getType() != Material.BARREL) { remove(en.getKey()); continue; } if (counter % 25 == 0) displays(en.getKey(), b, p); }
|
||||
case ENDER_CHEST -> { if (b.getType() != Material.BARREL && b.getType() != Material.ENDER_CHEST) { remove(en.getKey()); continue; } if (counter % 25 == 0) displays(en.getKey(), b, p); }
|
||||
}
|
||||
}
|
||||
if (counter % 300 == 0 && data.dirty) data.save();
|
||||
|
|
@ -436,6 +464,7 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
}
|
||||
|
||||
private void displays(String key, Block b, StorageData.Placed p) {
|
||||
boolean barrel = b.getType() == Material.BARREL;
|
||||
BlockFace f = front(b); Material common = StorageRules.mostCommon(Arrays.asList(data.inventory(freq(p)).getContents()));
|
||||
String sig = f + "|" + StorageRules.colorsToString(p.colors) + "|" + common;
|
||||
var ids = displays.get(key);
|
||||
|
|
@ -445,24 +474,34 @@ public final class StorageModule implements Listener, CommandExecutor {
|
|||
Location centre = b.getLocation().add(0.5, 0.5, 0.5);
|
||||
centre.setYaw(switch (f) { case WEST -> 90f; case NORTH -> 180f; case EAST -> -90f; default -> 0f; });
|
||||
var body = w.spawn(centre, ItemDisplay.class, id -> {
|
||||
id.setItemStack(items.create(StorageItems.ENDER, 1)); id.setPersistent(false); id.setBrightness(new Display.Brightness(15, 15)); id.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.NONE);
|
||||
ItemStack shell = items.create(StorageItems.ENDER, 1);
|
||||
if (barrel) {
|
||||
ItemMeta meta = shell.getItemMeta();
|
||||
meta.setItemModel(new NamespacedKey("dunerealms", "ender_chest_barrel_display"));
|
||||
shell.setItemMeta(meta);
|
||||
}
|
||||
id.setItemStack(shell); id.setPersistent(false); id.setBrightness(new Display.Brightness(15, 15)); id.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.NONE);
|
||||
id.setTransformation(new Transformation(new Vector3f(), new AxisAngle4f(), new Vector3f(1.01f, 1.01f, 1.01f), new AxisAngle4f()));
|
||||
});
|
||||
made.add(body.getUniqueId());
|
||||
for (int i = 0; i < 3; i++) {
|
||||
double[] c = StorageRules.padCentre(f, i); final int idx = i;
|
||||
float width = barrel ? 0.27f : 0.20f;
|
||||
float padY = barrel ? 1.012f : 0.879f;
|
||||
var d = w.spawn(b.getLocation(), BlockDisplay.class, bd -> {
|
||||
bd.setBlock(wool(p.colors[idx]).createBlockData()); bd.setPersistent(false); bd.setBrightness(new Display.Brightness(15, 15));
|
||||
bd.setTransformation(new Transformation(new Vector3f((float) (c[0] - 0.135), 1.012f, (float) (c[1] - 0.135)), new AxisAngle4f(), new Vector3f(0.27f, 0.05f, 0.27f), new AxisAngle4f()));
|
||||
bd.setTransformation(new Transformation(new Vector3f((float) (c[0] - width / 2), padY, (float) (c[1] - width / 2)),
|
||||
new AxisAngle4f(), new Vector3f(width, barrel ? 0.05f : 0.035f, width), new AxisAngle4f()));
|
||||
});
|
||||
made.add(d.getUniqueId());
|
||||
}
|
||||
if (common != null) {
|
||||
Location at = b.getLocation().add(0.5 + f.getModX() * 0.52, 0.55, 0.5 + f.getModZ() * 0.52);
|
||||
double depth = barrel ? 0.52 : 0.45;
|
||||
Location at = b.getLocation().add(0.5 + f.getModX() * depth, barrel ? 0.55 : 0.30, 0.5 + f.getModZ() * depth);
|
||||
at.setYaw(switch (f) { case WEST -> 90f; case NORTH -> 180f; case EAST -> -90f; default -> 0f; });
|
||||
var d = w.spawn(at, ItemDisplay.class, id -> {
|
||||
id.setItemStack(new ItemStack(common)); id.setPersistent(false); id.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.FIXED);
|
||||
id.setTransformation(new Transformation(new Vector3f(), new AxisAngle4f(), new Vector3f(0.45f, 0.45f, 0.45f), new AxisAngle4f()));
|
||||
id.setTransformation(new Transformation(new Vector3f(), new AxisAngle4f(), new Vector3f(barrel ? 0.45f : 0.32f), new AxisAngle4f()));
|
||||
});
|
||||
made.add(d.getUniqueId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
name: DuneChest
|
||||
version: 1.0.4
|
||||
version: 1.0.5
|
||||
main: com.example.dunechest.DuneChest
|
||||
api-version: '1.21.8'
|
||||
softdepend: [floodgate, DuneMenus, DuneEss]
|
||||
|
|
|
|||
|
|
@ -89,12 +89,16 @@ public final class DuneChestPaperValidation extends JavaPlugin implements Listen
|
|||
|
||||
private void validateRecipePreview(StorageModule module, World world, Class<?> placedType,
|
||||
Object placed, ItemStack mk1, ItemStack mk2) throws ReflectiveOperationException {
|
||||
Method open = module.getClass().getDeclaredMethod("recipePreview", String.class, placedType, World.class);
|
||||
Class<?> holderType = Class.forName("com.example.dunechest.StorageModule$Menu",
|
||||
true, module.getClass().getClassLoader());
|
||||
var holder = holderType.getDeclaredConstructor(String.class, String.class, placedType);
|
||||
holder.setAccessible(true);
|
||||
Method open = module.getClass().getDeclaredMethod("recipePreview", holderType, World.class);
|
||||
open.setAccessible(true);
|
||||
Method close = module.getClass().getDeclaredMethod("saveRecipeAndClearPreview", Inventory.class, placedType);
|
||||
close.setAccessible(true);
|
||||
|
||||
Inventory preview = (Inventory) open.invoke(module, "validation", placed, world);
|
||||
Inventory preview = (Inventory) open.invoke(module, holder.newInstance("recipe", "validation", placed), world);
|
||||
if (preview.getType() != InventoryType.WORKBENCH || preview.getSize() != 10 || preview.getHolder() == null
|
||||
|| !mk2.equals(preview.getItem(0)) || !mk1.equals(preview.getItem(5))) {
|
||||
throw new AssertionError("Recipe preview did not expose the expected workbench layout");
|
||||
|
|
@ -102,7 +106,7 @@ public final class DuneChestPaperValidation extends JavaPlugin implements Listen
|
|||
close.invoke(module, preview, placed);
|
||||
if (!preview.isEmpty()) throw new AssertionError("Recipe preview did not clear on normal close");
|
||||
|
||||
Inventory orphan = (Inventory) open.invoke(module, "validation", placed, world);
|
||||
Inventory orphan = (Inventory) open.invoke(module, holder.newInstance("recipe", "validation", placed), world);
|
||||
close.invoke(module, orphan, null);
|
||||
if (!orphan.isEmpty()) throw new AssertionError("Orphaned recipe preview did not clear");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,14 +69,29 @@ def w(rel, obj):
|
|||
p = os.path.join(root, rel); os.makedirs(os.path.dirname(p), exist_ok=True)
|
||||
open(p, "w").write(json.dumps(obj, separators=(",", ":")))
|
||||
|
||||
def face(tex, uv, cull=None):
|
||||
f = {"texture": "#" + tex, "uv": uv}
|
||||
if cull: f["cullface"] = cull
|
||||
return f
|
||||
# Chest-shaped model (14x14x14 footprint like the vanilla ender chest it is drawn over): base, lid, brass latch.
|
||||
w("models/block/ender_chest.json", {
|
||||
"parent": "minecraft:block/block",
|
||||
"textures": {"particle": "dunerealms:block/ender_chest_side", "side": "dunerealms:block/ender_chest_side", "front": "dunerealms:block/ender_chest_front",
|
||||
"top": "dunerealms:block/ender_chest_top", "bottom": "dunerealms:block/ender_chest_bottom"},
|
||||
"elements": [{"from": [0, 0, 0], "to": [16, 16, 16], "faces": {
|
||||
"down": {"texture": "#bottom", "cullface": "down"}, "up": {"texture": "#top", "cullface": "up"},
|
||||
"north": {"texture": "#side", "cullface": "north"}, "south": {"texture": "#front", "cullface": "south"},
|
||||
"west": {"texture": "#side", "cullface": "west"}, "east": {"texture": "#side", "cullface": "east"}}}]})
|
||||
"elements": [
|
||||
{"from": [1, 0, 1], "to": [15, 10, 15], "faces": {
|
||||
"down": face("bottom", [1, 1, 15, 15]), "up": face("side", [1, 1, 15, 15]),
|
||||
"north": face("side", [1, 6, 15, 16]), "south": face("front", [1, 6, 15, 16]),
|
||||
"west": face("side", [1, 6, 15, 16]), "east": face("side", [1, 6, 15, 16])}},
|
||||
{"from": [1, 10, 1], "to": [15, 14, 15], "faces": {
|
||||
"up": face("top", [1, 1, 15, 15]), "down": face("side", [1, 1, 15, 15]),
|
||||
"north": face("side", [1, 0, 15, 4]), "south": face("front", [1, 0, 15, 4]),
|
||||
"west": face("side", [1, 0, 15, 4]), "east": face("side", [1, 0, 15, 4])}},
|
||||
{"from": [7, 9, 15], "to": [9, 13, 16], "faces": {
|
||||
"south": face("front", [7, 3, 8.5, 5]), "north": face("front", [7, 3, 8.5, 5]), "up": face("front", [7, 3, 8.5, 5]),
|
||||
"down": face("front", [7, 3, 8.5, 5]), "west": face("front", [7, 3, 8.5, 5]), "east": face("front", [7, 3, 8.5, 5])}}]})
|
||||
w("models/item/ender_chest.json", {"parent": "dunerealms:block/ender_chest"})
|
||||
w("items/ender_chest.json", {"model": {"type": "minecraft:model", "model": "dunerealms:item/ender_chest"}})
|
||||
w("models/block/ender_chest_barrel_display.json", {'parent': 'minecraft:block/block', 'textures': {'particle': 'dunerealms:block/ender_chest_side', 'side': 'dunerealms:block/ender_chest_side', 'front': 'dunerealms:block/ender_chest_front', 'top': 'dunerealms:block/ender_chest_top', 'bottom': 'dunerealms:block/ender_chest_bottom'}, 'elements': [{'from': [0, 0, 0], 'to': [16, 16, 16], 'faces': {'down': {'texture': '#bottom', 'cullface': 'down'}, 'up': {'texture': '#top', 'cullface': 'up'}, 'north': {'texture': '#side', 'cullface': 'north'}, 'south': {'texture': '#front', 'cullface': 'south'}, 'west': {'texture': '#side', 'cullface': 'west'}, 'east': {'texture': '#side', 'cullface': 'east'}}}]})
|
||||
w("items/ender_chest_barrel_display.json", {"model": {"type": "minecraft:model", "model": "dunerealms:block/ender_chest_barrel_display"}})
|
||||
print("wrote ender chest art to", root)
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ tasks.processResources {
|
|||
"assets/dunerealms/textures/item/$item.png")
|
||||
}
|
||||
exclude("assets/dunerealms/items/ender_chest.json", "assets/dunerealms/models/item/ender_chest.json",
|
||||
"assets/dunerealms/models/block/ender_chest.json", "assets/dunerealms/textures/block/ender_chest_*.png")
|
||||
"assets/dunerealms/models/block/ender_chest.json", "assets/dunerealms/models/block/ender_chest_barrel_display.json",
|
||||
"assets/dunerealms/items/ender_chest_barrel_display.json", "assets/dunerealms/textures/block/ender_chest_*.png")
|
||||
for (tier in 1..3) {
|
||||
for (model in listOf("speed_hopper_$tier", "speed_hopper_${tier}_side")) {
|
||||
exclude("assets/dunerealms/items/$model.json", "assets/dunerealms/models/item/$model.json",
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{"model":{"type":"minecraft:model","model":"dunerealms:block/ender_chest_barrel_display"}}
|
||||
|
|
@ -1 +1 @@
|
|||
{"parent":"minecraft:block/block","textures":{"particle":"dunerealms:block/ender_chest_side","side":"dunerealms:block/ender_chest_side","front":"dunerealms:block/ender_chest_front","top":"dunerealms:block/ender_chest_top","bottom":"dunerealms:block/ender_chest_bottom"},"elements":[{"from":[0,0,0],"to":[16,16,16],"faces":{"down":{"texture":"#bottom","cullface":"down"},"up":{"texture":"#top","cullface":"up"},"north":{"texture":"#side","cullface":"north"},"south":{"texture":"#front","cullface":"south"},"west":{"texture":"#side","cullface":"west"},"east":{"texture":"#side","cullface":"east"}}}]}
|
||||
{"parent":"minecraft:block/block","textures":{"particle":"dunerealms:block/ender_chest_side","side":"dunerealms:block/ender_chest_side","front":"dunerealms:block/ender_chest_front","top":"dunerealms:block/ender_chest_top","bottom":"dunerealms:block/ender_chest_bottom"},"elements":[{"from":[1,0,1],"to":[15,10,15],"faces":{"down":{"texture":"#bottom","uv":[1,1,15,15]},"up":{"texture":"#side","uv":[1,1,15,15]},"north":{"texture":"#side","uv":[1,6,15,16]},"south":{"texture":"#front","uv":[1,6,15,16]},"west":{"texture":"#side","uv":[1,6,15,16]},"east":{"texture":"#side","uv":[1,6,15,16]}}},{"from":[1,10,1],"to":[15,14,15],"faces":{"up":{"texture":"#top","uv":[1,1,15,15]},"down":{"texture":"#side","uv":[1,1,15,15]},"north":{"texture":"#side","uv":[1,0,15,4]},"south":{"texture":"#front","uv":[1,0,15,4]},"west":{"texture":"#side","uv":[1,0,15,4]},"east":{"texture":"#side","uv":[1,0,15,4]}}},{"from":[7,9,15],"to":[9,13,16],"faces":{"south":{"texture":"#front","uv":[7,3,8.5,5]},"north":{"texture":"#front","uv":[7,3,8.5,5]},"up":{"texture":"#front","uv":[7,3,8.5,5]},"down":{"texture":"#front","uv":[7,3,8.5,5]},"west":{"texture":"#front","uv":[7,3,8.5,5]},"east":{"texture":"#front","uv":[7,3,8.5,5]}}}]}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"parent":"minecraft:block/block","textures":{"particle":"dunerealms:block/ender_chest_side","side":"dunerealms:block/ender_chest_side","front":"dunerealms:block/ender_chest_front","top":"dunerealms:block/ender_chest_top","bottom":"dunerealms:block/ender_chest_bottom"},"elements":[{"from":[0,0,0],"to":[16,16,16],"faces":{"down":{"texture":"#bottom","cullface":"down"},"up":{"texture":"#top","cullface":"up"},"north":{"texture":"#side","cullface":"north"},"south":{"texture":"#front","cullface":"south"},"west":{"texture":"#side","cullface":"west"},"east":{"texture":"#side","cullface":"east"}}}]}
|
||||
|
|
@ -277,7 +277,7 @@ def plan(artifacts, inventory, expected_source):
|
|||
installed=existing_paths.get('dunechest')
|
||||
approved_dunechest = {
|
||||
chosen[0]['sha256'],
|
||||
'49668bc342a4e15edec1a6e38e590378d2783d03c7af049b0b96bc92b210d9e9',
|
||||
'bd80ff028e58b24e4ee023827d9fa6dca3ae857dc867a27caca5ef399544ec85',
|
||||
}
|
||||
if installed is not None and digest(installed) not in approved_dunechest:
|
||||
raise ValueError('Existing DuneChest differs from the approved release or predecessor')
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ from plugin_resource_pack import read_zip
|
|||
PACK_BASELINE_SHA256 = '446c0b60fa6e6752ff5260bb22c9a76280b7b10ffa03c3cca4b08f4d9320105b'
|
||||
MODELS = ['ender_chest', *(f'speed_hopper_{tier}{facing}' for tier in range(1,4) for facing in ('','_side'))]
|
||||
ASSETS = {
|
||||
'assets/dunerealms/items/ender_chest_barrel_display.json',
|
||||
'assets/dunerealms/models/block/ender_chest_barrel_display.json',
|
||||
*(f'assets/dunerealms/{category}/{model}.json' for category in ('items','models/item','models/block') for model in MODELS),
|
||||
*(f'assets/dunerealms/textures/block/speed_hopper_{tier}.png' for tier in range(1,4)),
|
||||
*(f'assets/dunerealms/textures/block/ender_chest_{face}.png' for face in ('bottom','front','side','top')),
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff