diff --git a/DuneRealmsGUI/build.gradle.kts b/DuneRealmsGUI/build.gradle.kts index 2593fab9..773e89f4 100644 --- a/DuneRealmsGUI/build.gradle.kts +++ b/DuneRealmsGUI/build.gradle.kts @@ -1,6 +1,6 @@ plugins { java } group = "com.dunerealms" -version = "1.1.20" +version = "1.1.21" repositories { mavenCentral(); maven("https://repo.papermc.io/repository/maven-public/"); maven("https://repo.opencollab.dev/main/") } dependencies { compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT") diff --git a/DuneRealmsGUI/ecology/README.md b/DuneRealmsGUI/ecology/README.md new file mode 100644 index 00000000..310e9d25 --- /dev/null +++ b/DuneRealmsGUI/ecology/README.md @@ -0,0 +1,32 @@ +# Arrakis artwork + +Original artwork generated with the built-in image tool on 2026-11-23, then +resized with nearest-neighbour sampling to native Minecraft texture sizes. +No third-party rat pack is redistributed. Entity UV references are the native +Minecraft 1.21.8 rabbit and wolf atlases. These are texture replacements on +native geometry, not custom entity models or an OptiFine dependency. + +`jerboa.png` recolours the rabbit atlas into sandy tan/cream with dark eyes and +pink ears. `worm_pet.png` recolours the wolf atlas into sandy segmented chitin +with amber eyes. The five 32px item sprites depict raw meat, cooked meat, hide, +spice-enriched stew and a corked water vial in the same pixel-art palette. + +Build the two packs with `tools/build-ecology-packs.py OUTPUT_DIRECTORY`. +Item definitions use `dunerealms:ecology/ITEM_ID`, leaving ordinary vanilla +items unchanged. Creature textures are a separate pack: the GUI removes that +exact layer outside Arrakis, including after a proxy transfer. Both layers +coexist with the existing House and MCGUI packs. `/drgui pack` requests them. + +The connector applies item models in the shared metadata stamp, including +recipe prototypes and drops, so item art does not create inconsistent furnace +results. Existing executable item identity, grade, effects and recipes remain +authoritative. + +Approved release pack hashes (SHA-256): + +- Items v1: `33985ae1bf35fc549095f5ee0ed95c9e9ba753707bb5030223394141a7c87947` +- Creatures v1: `46799e05abff6ed61ab3ab03e4ce1d128d0102fdb60609533a0f7eaaee668ee8` + +Rebuilding with another ZIP implementation may change compression bytes. +Publish an immutable version and update both SHA-1 pins in EcologyArtwork +when rebuilding; never replace a public ZIP under an existing pinned URL. diff --git a/DuneRealmsGUI/ecology/jerboa.png b/DuneRealmsGUI/ecology/jerboa.png new file mode 100644 index 00000000..79845002 Binary files /dev/null and b/DuneRealmsGUI/ecology/jerboa.png differ diff --git a/DuneRealmsGUI/ecology/jerboa_cooked_meat.png b/DuneRealmsGUI/ecology/jerboa_cooked_meat.png new file mode 100644 index 00000000..16094e5c Binary files /dev/null and b/DuneRealmsGUI/ecology/jerboa_cooked_meat.png differ diff --git a/DuneRealmsGUI/ecology/jerboa_hide.png b/DuneRealmsGUI/ecology/jerboa_hide.png new file mode 100644 index 00000000..6014aa9f Binary files /dev/null and b/DuneRealmsGUI/ecology/jerboa_hide.png differ diff --git a/DuneRealmsGUI/ecology/jerboa_raw_meat.png b/DuneRealmsGUI/ecology/jerboa_raw_meat.png new file mode 100644 index 00000000..e16a426a Binary files /dev/null and b/DuneRealmsGUI/ecology/jerboa_raw_meat.png differ diff --git a/DuneRealmsGUI/ecology/jerboa_stew.png b/DuneRealmsGUI/ecology/jerboa_stew.png new file mode 100644 index 00000000..bef60f38 Binary files /dev/null and b/DuneRealmsGUI/ecology/jerboa_stew.png differ diff --git a/DuneRealmsGUI/ecology/jerboa_water_vial.png b/DuneRealmsGUI/ecology/jerboa_water_vial.png new file mode 100644 index 00000000..865fc2fb Binary files /dev/null and b/DuneRealmsGUI/ecology/jerboa_water_vial.png differ diff --git a/DuneRealmsGUI/ecology/worm_pet.png b/DuneRealmsGUI/ecology/worm_pet.png new file mode 100644 index 00000000..f0cd464e Binary files /dev/null and b/DuneRealmsGUI/ecology/worm_pet.png differ diff --git a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/DuneGUI.java b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/DuneGUI.java index 7bfdcd24..737bdeba 100644 --- a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/DuneGUI.java +++ b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/DuneGUI.java @@ -25,6 +25,7 @@ public final class DuneGUI extends JavaPlugin implements Listener,CommandExecuto private HouseBridge bridge; private OrganisationMenus organisations; private MCGUIMenus modernMenus; + private EcologyArtwork ecologyArtwork; private QuestMenus quests; private ExchangeMenus exchange; private ItemPreviewMenu itemPreviews; @@ -65,6 +66,7 @@ public final class DuneGUI extends JavaPlugin implements Listener,CommandExecuto organisations=new OrganisationMenus(this,bridge,p->fetch(p,null,0,null,data->mentat(p,data)),p->openGuild(p,null),p->fetch(p,null,0,null,data->select(p,data,null)),p->quests.open(p),p->exchange.open(p),p->guiPackLoaded.contains(p.getUniqueId())); registrar=new NamespacedKey(this,"house_registrar"); modernMenus=new MCGUIMenus(this); + ecologyArtwork=new EcologyArtwork(this); sidebar=new PersonalSidebar(this);nameplates=new PublicNameplates(this); for(String command:List.of("exchange","house","mentat","drgui","drscoreboard","guildtravel","clan","company","polgui"))Objects.requireNonNull(getCommand(command)).setExecutor(this); @@ -171,12 +173,14 @@ public final class DuneGUI extends JavaPlugin implements Listener,CommandExecuto guiPackLoaded.remove(p.getUniqueId()); var pack=guiPack();p.addResourcePack(pack.id(),pack.url(),java.util.HexFormat.of().parseHex(pack.hash()),"DuneRealms menus and item artwork",false); MCGUIMenus.offerPack(p); + ecologyArtwork.offer(p); } @EventHandler public void join(PlayerJoinEvent e){Bukkit.getScheduler().runTaskLater(this,()->{ Player p=e.getPlayer();if(!p.isOnline())return; // Offer once in the play phase too: configuration-phase pack loading may finish // before the ordinary Bukkit player status event is available. The hash reuses cache. if(!BedrockForms.isBedrock(p)&&!guiPackLoaded.contains(p.getUniqueId()))offerGuiPack(p); + else ecologyArtwork.offer(p); giveCodex(p,false); if(sidebar.enabled(p))refreshSidebar(p); },40L);} diff --git a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/EcologyArtwork.java b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/EcologyArtwork.java new file mode 100644 index 00000000..432e700b --- /dev/null +++ b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/EcologyArtwork.java @@ -0,0 +1,30 @@ +package com.dunerealms.gui; + +import java.util.HexFormat; +import java.util.UUID; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerChangedWorldEvent; +import org.bukkit.plugin.Plugin; + +/** Independent pack layers: carried items are global; creature skins are Arrakis-only. */ +final class EcologyArtwork implements Listener { + private static final UUID ITEMS=UUID.fromString("d41ca73d-9fa0-51f1-8a71-74b2cf3ea001"),CREATURES=UUID.fromString("d41ca73d-9fa0-51f1-8a71-74b2cf3ea002"); + private final Plugin plugin; + EcologyArtwork(Plugin plugin){this.plugin=plugin;Bukkit.getPluginManager().registerEvents(this,plugin);Bukkit.getScheduler().runTaskLater(plugin,()->Bukkit.getOnlinePlayers().forEach(this::offer),40L);} + void offer(Player player){ + if(!player.isOnline()||BedrockForms.isBedrock(player))return; + player.addResourcePack(ITEMS,"https://www.dunerealms.com/downloads/DuneRealms-Ecology-Items-v1.zip",HexFormat.of().parseHex("b1d6a41ad016319f891d750857487bdc7976b648"),"DuneRealms Jerboa item artwork",false); + creatures(player); + } + private void creatures(Player player){ + if(!player.isOnline()||BedrockForms.isBedrock(player))return; + // Resource packs survive proxy transfers. Remove this exact layer on every + // other planet; never clear the GUI, MCGUI or carried-item packs. + if(!player.getWorld().getName().equalsIgnoreCase("arrakis")){player.removeResourcePack(CREATURES);return;} + player.addResourcePack(CREATURES,"https://www.dunerealms.com/downloads/DuneRealms-Arrakis-Creatures-v1.zip",HexFormat.of().parseHex("2e2fee75f75fe03e660df8889ddc8e60362e4831"),"Arrakis Jerboa and worm-pet skins",false); + } + @EventHandler public void world(PlayerChangedWorldEvent event){creatures(event.getPlayer());} +} diff --git a/DuneRealmsGUI/src/main/resources/plugin.yml b/DuneRealmsGUI/src/main/resources/plugin.yml index b19139fc..73e2eae4 100644 --- a/DuneRealmsGUI/src/main/resources/plugin.yml +++ b/DuneRealmsGUI/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: DunerealmsGUI main: com.dunerealms.gui.DuneGUI -version: 1.1.20 +version: 1.1.21 api-version: '1.21.8' depend: [JarvisTranslator] softdepend: [MCGUI, DecentHolograms, DuneLobby, DuneCore, DuneEss, DuneNPC, Vault, floodgate, ViaVersion] diff --git a/JarvisConnector/build.gradle.kts b/JarvisConnector/build.gradle.kts index 5e2077aa..ac7abdf9 100644 --- a/JarvisConnector/build.gradle.kts +++ b/JarvisConnector/build.gradle.kts @@ -1,6 +1,6 @@ plugins { java } group = "com.dunerealms" -version = "0.5.25" +version = "0.5.26" repositories { mavenCentral(); maven("https://repo.papermc.io/repository/maven-public/") } dependencies { compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT") diff --git a/JarvisConnector/src/main/java/com/dunerealms/jarvis/ItemMetadataOverlay.java b/JarvisConnector/src/main/java/com/dunerealms/jarvis/ItemMetadataOverlay.java index 93284f9d..8da92efd 100644 --- a/JarvisConnector/src/main/java/com/dunerealms/jarvis/ItemMetadataOverlay.java +++ b/JarvisConnector/src/main/java/com/dunerealms/jarvis/ItemMetadataOverlay.java @@ -45,6 +45,9 @@ final class ItemMetadataOverlay implements Listener { var meta=item.getItemMeta();if(meta==null)return false;var data=meta.getPersistentDataContainer(); if(item.getType()==Material.BLAZE_ROD&&data.has(new NamespacedKey("dunecore","admin_rod"),PersistentDataType.BYTE)){item.setAmount(0);return true;} String engine=data.get(ENGINE_ID,PersistentDataType.STRING),legacy=data.get(LEGACY_ID,PersistentDataType.STRING); + // Bind custom art to registered native definitions, never to every vanilla + // rabbit/potion. Apply during recipe stamping too so furnace outputs stack. + if(engine!=null){String expected=switch(engine){case "jerboa_raw_meat"->"RABBIT";case "jerboa_cooked_meat"->"COOKED_RABBIT";case "jerboa_hide"->"RABBIT_HIDE";case "jerboa_stew"->"RABBIT_STEW";case "jerboa_water_vial"->"POTION";default->null;};if(item.getType().name().equals(expected))meta.setItemModel(new NamespacedKey("dunerealms","ecology/"+engine));} boolean converted="dr_imperial_codex".equals(engine)&&item.getType()==Material.COMPASS; if(converted){item.setType(Material.PAPER);meta=item.getItemMeta();data=meta.getPersistentDataContainer();} if("dr_imperial_codex".equals(engine))data.set(LEGACY_ID,PersistentDataType.STRING,"menu_opener"); diff --git a/JarvisConnector/src/main/resources/plugin.yml b/JarvisConnector/src/main/resources/plugin.yml index 1ff0baed..726e59f9 100644 --- a/JarvisConnector/src/main/resources/plugin.yml +++ b/JarvisConnector/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: JarvisTranslator main: com.dunerealms.jarvis.JarvisTranslator -version: 0.5.25 +version: 0.5.26 api-version: '1.21.8' description: Shared J.A.R.V.I.S. website API and native server action translator. softdepend: [SCore, ExecutableItems, ExecutableCrafting, DuneEss, ImageFrame, DecentHolograms, MedievalFactions, Towny, WorldGuard] diff --git a/tools/build-ecology-packs.py b/tools/build-ecology-packs.py new file mode 100644 index 00000000..b1b57d1e --- /dev/null +++ b/tools/build-ecology-packs.py @@ -0,0 +1,45 @@ +"""Package original artwork without changing vanilla items or other planets' mobs.""" +import hashlib, json, pathlib, struct, sys, zipfile + +ROOT = pathlib.Path(__file__).resolve().parents[1] +ART = ROOT / 'DuneRealmsGUI/ecology' +ITEMS = ('jerboa_raw_meat', 'jerboa_cooked_meat', 'jerboa_hide', 'jerboa_stew', 'jerboa_water_vial') +RABBITS = ('salt', 'white_splotched', 'brown', 'toast', 'gold', 'caerbannog', 'black', 'white') +WOLVES = ('wolf', 'wolf_ashen', 'wolf_black', 'wolf_chestnut', 'wolf_rusty', 'wolf_snowy', 'wolf_spotted', 'wolf_striped', 'wolf_woods') + +def png(name, size): + data = (ART / (name + '.png')).read_bytes() + assert data[:8] == b'\x89PNG\r\n\x1a\n' + assert struct.unpack('>II', data[16:24]) == size, name + assert data[25] == 6, 'RGBA transparency required: ' + name + return data + +def build(output): + output.mkdir(parents=True, exist_ok=True) + metadata = {'pack': {'pack_format': 64, 'supported_formats': [64, 75], 'min_format': 64, 'max_format': 75, 'description': 'DuneRealms original Arrakis ecology artwork'}} + common = {'pack.mcmeta': json.dumps(metadata).encode()} + items = dict(common) + for item in ITEMS: + items[f'assets/dunerealms/textures/item/ecology/{item}.png'] = png(item, (32, 32)) + items[f'assets/dunerealms/models/item/ecology/{item}.json'] = json.dumps({'parent': 'minecraft:item/generated', 'textures': {'layer0': f'dunerealms:item/ecology/{item}'}}).encode() + items[f'assets/dunerealms/items/ecology/{item}.json'] = json.dumps({'model': {'type': 'minecraft:model', 'model': f'dunerealms:item/ecology/{item}'}}).encode() + entities = dict(common) + for rabbit in RABBITS: + entities[f'assets/minecraft/textures/entity/rabbit/{rabbit}.png'] = png('jerboa', (64, 32)) + for wolf in WOLVES: + for state in ('', '_tame', '_angry'): + entities[f'assets/minecraft/textures/entity/wolf/{wolf}{state}.png'] = png('worm_pet', (64, 32)) + result = {} + for name, entries in [('DuneRealms-Ecology-Items-v1.zip', items), ('DuneRealms-Arrakis-Creatures-v1.zip', entities)]: + path = output / name + with zipfile.ZipFile(path, 'w', zipfile.ZIP_DEFLATED) as archive: + for key, value in sorted(entries.items()): + info = zipfile.ZipInfo(key, (2026, 11, 23, 0, 0, 0)) + info.compress_type = zipfile.ZIP_DEFLATED + archive.writestr(info, value) + data = path.read_bytes() + result[name] = {'sha1': hashlib.sha1(data).hexdigest(), 'sha256': hashlib.sha256(data).hexdigest(), 'bytes': len(data), 'entries': len(entries)} + return result + +if __name__ == '__main__': + print(json.dumps(build(pathlib.Path(sys.argv[1]))))