Roll out the redesigned Arrakis jerboa #44

Merged
unimatrix merged 3 commits from feat/arrakis-jerboa-redesign into main 2026-11-30 21:01:38 +01:00
18 changed files with 314 additions and 63 deletions

View file

@ -0,0 +1,48 @@
name: Arrakis Jerboa Redesign Build
on:
workflow_dispatch:
push:
branches: ['feat/arrakis-jerboa-*']
jobs:
jerboa:
runs-on: dune-ci
steps:
- name: Check out exact revision
shell: bash
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
git init .
git -c http.extraheader="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$REPO_TOKEN" | base64 -w0)" fetch --depth=1 https://www.dunerealms.com/git/unimatrix/plugins.git "$GITHUB_SHA"
git checkout --detach FETCH_HEAD
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: '9.2.1'
- name: Build Terrain and verify Arrakis jerboa art
shell: bash
run: |
set -euo pipefail
gradle --no-daemon -p DuneTerrain test jar
python3 tools/test_plugin_fleet_install.py -v
python3 tools/test_plugin_pack_properties.py -v
mkdir jerboa-artifacts
cp DuneTerrain/build/libs/DuneRealms-Terrain.jar jerboa-artifacts/
printf '%s\n' "$(git rev-parse HEAD)" > jerboa-artifacts/SOURCE_COMMIT
pack="jerboa-artifacts/DuneRealms-Resources-${GITHUB_SHA}.zip"
python3 tools/build-unified-resourcepack.py --source "$GITHUB_SHA" --output "$pack"
curl --fail --location --retry 2 https://www.dunerealms.com/downloads/DuneRealms-Resources-2faba139906da15741db2702b3bed3e92ad7ee26.zip -o arrakis-baseline.zip
python3 tools/plugin_arrakis_jerboa.py DuneTerrain/build/libs/DuneRealms-Terrain.jar arrakis-baseline.zip "$pack"
python3 tools/write-plugin-manifest.py jerboa-artifacts "$GITHUB_SHA"
cp tools/plugin_arrakis_jerboa.py tools/install-plugin-fleet.py tools/plugin_menu_pack.py tools/plugin_backend_abi.py tools/plugin_pillager_abi.py tools/plugin_fleet_rollback.py tools/plugin_pack_properties.py tools/publish-plugin-menu.py jerboa-artifacts/
(cd jerboa-artifacts && sha256sum -- *.jar *.zip *.json *.py SOURCE_COMMIT > SHA256SUMS)
- uses: actions/upload-artifact@v3
with:
name: DuneRealms-Arrakis-Jerboa
path: jerboa-artifacts/
if-no-files-found: error

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"ambientocclusion":false,"textures":{"fur":"dunerealms:entity/jerboa","particle":"#fur"},"elements":[{"from":[5.279999999999999,2.2100000000000004,3.699],"to":[10.72,4.862,5.943],"faces":{"west":{"uv":[0,6,1.5,7.5],"texture":"#fur"},"north":{"uv":[1.5,6,3.5,7.5],"texture":"#fur"},"east":{"uv":[3.5,6,5,7.5],"texture":"#fur"},"south":{"uv":[5,6,7,7.5],"texture":"#fur"},"up":{"uv":[1.5,4.5,3.5,6],"texture":"#fur"},"down":{"uv":[3.5,4.5,5.5,6],"texture":"#fur"}}},{"from":[6.98,2.2100000000000004,2.9509999999999987],"to":[9.02,3.0940000000000007,3.699],"faces":{"west":{"uv":[9,6,9.5,6.5],"texture":"#fur"},"north":{"uv":[9.5,6,10.25,6.5],"texture":"#fur"},"east":{"uv":[10.25,6,10.75,6.5],"texture":"#fur"},"south":{"uv":[10.75,6,11.5,6.5],"texture":"#fur"},"up":{"uv":[9.5,5.5,10.25,6],"texture":"#fur"},"down":{"uv":[10.25,5.5,11,6],"texture":"#fur"}}},{"from":[9.36,4.862,4.0729999999999995],"to":[10.72,5.746,4.446999999999999],"faces":{"west":{"uv":[7.25,6.25,7.5,6.75],"texture":"#fur"},"north":{"uv":[7.5,6.25,8,6.75],"texture":"#fur"},"east":{"uv":[8,6.25,8.25,6.75],"texture":"#fur"},"south":{"uv":[8.25,6.25,8.75,6.75],"texture":"#fur"},"up":{"uv":[7.5,6,8,6.25],"texture":"#fur"},"down":{"uv":[8,6,8.5,6.25],"texture":"#fur"}}},{"from":[5.279999999999999,4.862,4.0729999999999995],"to":[6.64,5.746,4.446999999999999],"faces":{"west":{"uv":[4.75,0.25,5,0.75],"texture":"#fur"},"north":{"uv":[5,0.25,5.5,0.75],"texture":"#fur"},"east":{"uv":[5.5,0.25,5.75,0.75],"texture":"#fur"},"south":{"uv":[5.75,0.25,6.25,0.75],"texture":"#fur"},"up":{"uv":[5,0,5.5,0.25],"texture":"#fur"},"down":{"uv":[5.5,0,6,0.25],"texture":"#fur"}}},{"from":[5.96,1.5470000000000004,5.943],"to":[10.04,3.757,10.057],"faces":{"west":{"uv":[0.25,1.5,1.5,4.25],"texture":"#fur"},"down":{"uv":[1.5,1.5,3,4.25],"texture":"#fur"},"east":{"uv":[3,1.5,4.25,4.25],"texture":"#fur"},"up":{"uv":[4.25,1.5,5.75,4.25],"texture":"#fur"},"north":{"uv":[1.5,0.25,3,1.5],"texture":"#fur"},"south":{"uv":[3,0.25,4.5,1.5],"texture":"#fur"}}},{"from":[8.68,0,6.13],"to":[10.72,2.2100000000000004,7.252],"faces":{"west":{"uv":[6.25,4.25,7,5.5],"texture":"#fur"},"north":{"uv":[7,4.25,7.75,5.5],"texture":"#fur"},"east":{"uv":[7.75,4.25,8.5,5.5],"texture":"#fur"},"south":{"uv":[8.5,4.25,9.25,5.5],"texture":"#fur"},"up":{"uv":[7,3.5,7.75,4.25],"texture":"#fur"},"down":{"uv":[7.75,3.5,8.5,4.25],"texture":"#fur"}}},{"from":[8.68,0,8.748],"to":[10.72,2.2100000000000004,9.870000000000001],"faces":{"west":{"uv":[0,8.5,0.75,9.75],"texture":"#fur"},"north":{"uv":[0.75,8.5,1.5,9.75],"texture":"#fur"},"east":{"uv":[1.5,8.5,2.25,9.75],"texture":"#fur"},"south":{"uv":[2.25,8.5,3,9.75],"texture":"#fur"},"up":{"uv":[0.75,7.75,1.5,8.5],"texture":"#fur"},"down":{"uv":[1.5,7.75,2.25,8.5],"texture":"#fur"}}},{"from":[5.279999999999999,0,6.13],"to":[7.32,2.2100000000000004,7.252],"faces":{"west":{"uv":[6.5,7.75,7.25,9],"texture":"#fur"},"north":{"uv":[7.25,7.75,8,9],"texture":"#fur"},"east":{"uv":[8,7.75,8.75,9],"texture":"#fur"},"south":{"uv":[8.75,7.75,9.5,9],"texture":"#fur"},"up":{"uv":[7.25,7,8,7.75],"texture":"#fur"},"down":{"uv":[8,7,8.75,7.75],"texture":"#fur"}}},{"from":[5.279999999999999,0,8.748],"to":[7.32,2.2100000000000004,9.870000000000001],"faces":{"west":{"uv":[3.25,8.5,4,9.75],"texture":"#fur"},"north":{"uv":[4,8.5,4.75,9.75],"texture":"#fur"},"east":{"uv":[4.75,8.5,5.5,9.75],"texture":"#fur"},"south":{"uv":[5.5,8.5,6.25,9.75],"texture":"#fur"},"up":{"uv":[4,7.75,4.75,8.5],"texture":"#fur"},"down":{"uv":[4.75,7.75,5.5,8.5],"texture":"#fur"}}},{"from":[7.32,1.7680000000000002,10.057],"to":[8.68,3.5360000000000005,13.423],"faces":{"west":{"uv":[6.25,1,7.25,3.25],"texture":"#fur"},"up":{"uv":[7.25,1,8.25,3.25],"texture":"#fur"},"east":{"uv":[8.25,1,9.25,3.25],"texture":"#fur"},"down":{"uv":[9.25,1,10.25,3.25],"texture":"#fur"},"south":{"uv":[7.25,0,8.25,1],"texture":"#fur"},"north":{"uv":[8.25,0,9.25,1],"texture":"#fur"}}}]}
{"ambientocclusion":false,"textures":{"fur":"dunerealms:entity/jerboa","particle":"#fur"},"elements":[{"from":[5.0,0.2,3.6],"to":[11.0,6.0,10.4],"faces":{"up":{"uv":[0,0,2,2],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[0,0,2,2],"texture":"#fur"},"south":{"uv":[0,0,2,2],"texture":"#fur"},"west":{"uv":[0,0,2,2],"texture":"#fur"},"east":{"uv":[0,0,2,2],"texture":"#fur"}}},{"from":[5.4,0.1,4.0],"to":[10.6,1.4,10.0],"faces":{"up":{"uv":[4,0,6,2],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[4,0,6,2],"texture":"#fur"},"south":{"uv":[4,0,6,2],"texture":"#fur"},"west":{"uv":[4,0,6,2],"texture":"#fur"},"east":{"uv":[4,0,6,2],"texture":"#fur"}}},{"from":[6.3,0.8,1.9],"to":[9.7,4.0,4.1],"faces":{"up":{"uv":[6,0,8,2],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[6,0,8,2],"texture":"#fur"},"south":{"uv":[6,0,8,2],"texture":"#fur"},"west":{"uv":[6,0,8,2],"texture":"#fur"},"east":{"uv":[6,0,8,2],"texture":"#fur"}}},{"from":[7.2,1.0,1.2],"to":[8.8,2.4,2.0],"faces":{"up":{"uv":[14,2,16,4],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[14,2,16,4],"texture":"#fur"},"south":{"uv":[14,2,16,4],"texture":"#fur"},"west":{"uv":[14,2,16,4],"texture":"#fur"},"east":{"uv":[14,2,16,4],"texture":"#fur"}}},{"from":[6.1,2.3,2.6],"to":[6.4,3.4,3.7],"faces":{"up":{"uv":[12,0,14,2],"texture":"#fur"},"down":{"uv":[12,0,14,2],"texture":"#fur"},"north":{"uv":[12,0,14,2],"texture":"#fur"},"south":{"uv":[12,0,14,2],"texture":"#fur"},"west":{"uv":[12,0,14,2],"texture":"#fur"},"east":{"uv":[12,0,14,2],"texture":"#fur"}}},{"from":[9.6,2.3,2.6],"to":[9.9,3.4,3.7],"faces":{"up":{"uv":[12,0,14,2],"texture":"#fur"},"down":{"uv":[12,0,14,2],"texture":"#fur"},"north":{"uv":[12,0,14,2],"texture":"#fur"},"south":{"uv":[12,0,14,2],"texture":"#fur"},"west":{"uv":[12,0,14,2],"texture":"#fur"},"east":{"uv":[12,0,14,2],"texture":"#fur"}}},{"from":[6.0,5.8,3.7],"to":[7.2,6.2,6.2],"faces":{"up":{"uv":[8,0,10,2],"texture":"#fur"},"down":{"uv":[10,0,12,2],"texture":"#fur"},"north":{"uv":[8,0,10,2],"texture":"#fur"},"south":{"uv":[8,0,10,2],"texture":"#fur"},"west":{"uv":[8,0,10,2],"texture":"#fur"},"east":{"uv":[8,0,10,2],"texture":"#fur"}}},{"from":[8.8,5.8,3.7],"to":[10.0,6.2,6.2],"faces":{"up":{"uv":[8,0,10,2],"texture":"#fur"},"down":{"uv":[10,0,12,2],"texture":"#fur"},"north":{"uv":[8,0,10,2],"texture":"#fur"},"south":{"uv":[8,0,10,2],"texture":"#fur"},"west":{"uv":[8,0,10,2],"texture":"#fur"},"east":{"uv":[8,0,10,2],"texture":"#fur"}}},{"from":[5.4,0.2,10.4],"to":[10.6,1.2,11.2],"faces":{"up":{"uv":[4,2,6,4],"texture":"#fur"},"down":{"uv":[4,2,6,4],"texture":"#fur"},"north":{"uv":[4,2,6,4],"texture":"#fur"},"south":{"uv":[4,2,6,4],"texture":"#fur"},"west":{"uv":[4,2,6,4],"texture":"#fur"},"east":{"uv":[4,2,6,4],"texture":"#fur"}}},{"from":[5.0,0.2,7.0],"to":[5.8,1.2,10.8],"faces":{"up":{"uv":[6,2,8,4],"texture":"#fur"},"down":{"uv":[6,2,8,4],"texture":"#fur"},"north":{"uv":[6,2,8,4],"texture":"#fur"},"south":{"uv":[6,2,8,4],"texture":"#fur"},"west":{"uv":[6,2,8,4],"texture":"#fur"},"east":{"uv":[6,2,8,4],"texture":"#fur"}}},{"from":[5.0,0.2,5.0],"to":[5.8,1.4,7.0],"faces":{"up":{"uv":[8,2,10,4],"texture":"#fur"},"down":{"uv":[8,2,10,4],"texture":"#fur"},"north":{"uv":[8,2,10,4],"texture":"#fur"},"south":{"uv":[8,2,10,4],"texture":"#fur"},"west":{"uv":[8,2,10,4],"texture":"#fur"},"east":{"uv":[8,2,10,4],"texture":"#fur"}}},{"from":[5.4,0.0,6.0],"to":[6.4,0.7,9.6],"faces":{"up":{"uv":[0,2,2,4],"texture":"#fur"},"down":{"uv":[2,2,4,4],"texture":"#fur"},"north":{"uv":[2,2,4,4],"texture":"#fur"},"south":{"uv":[0,2,2,4],"texture":"#fur"},"west":{"uv":[0,2,2,4],"texture":"#fur"},"east":{"uv":[0,2,2,4],"texture":"#fur"}}},{"from":[9.6,0.0,6.0],"to":[10.6,0.7,9.6],"faces":{"up":{"uv":[0,2,2,4],"texture":"#fur"},"down":{"uv":[2,2,4,4],"texture":"#fur"},"north":{"uv":[2,2,4,4],"texture":"#fur"},"south":{"uv":[0,2,2,4],"texture":"#fur"},"west":{"uv":[0,2,2,4],"texture":"#fur"},"east":{"uv":[0,2,2,4],"texture":"#fur"}}}]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

@ -1,37 +1,37 @@
plugins { java }
group = "com.example"
version = "1.0.18-jarvisloot1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
testImplementation("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
testImplementation("org.mockito:mockito-core:5.15.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) }
tasks.jar { archiveBaseName.set("DuneTerrain") }
tasks.withType<JavaCompile> { options.encoding = "UTF-8" }
tasks.test { useJUnitPlatform() }
tasks.jar { archiveFileName.set("DuneRealms-Terrain.jar") }
val highlandsDatapack by tasks.registering(Zip::class) {
from("highlands-datapack")
archiveFileName.set("DuneRealms-Dune-Highlands-Datapack.zip")
destinationDirectory.set(layout.buildDirectory.dir("distributions"))
}
tasks.assemble { dependsOn(highlandsDatapack) }
val mockitoAgent by configurations.creating
dependencies { mockitoAgent("org.mockito:mockito-core:5.15.2") { isTransitive = false } }
tasks.test { jvmArgs("-javaagent:${mockitoAgent.singleFile.absolutePath}") }
sourceSets.main { java.srcDir("../citizens-common/src/main/java") }
plugins { java }
group = "com.example"
version = "1.0.19-jerboa1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
testImplementation("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
testImplementation("org.mockito:mockito-core:5.15.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) }
tasks.jar { archiveBaseName.set("DuneTerrain") }
tasks.withType<JavaCompile> { options.encoding = "UTF-8" }
tasks.test { useJUnitPlatform() }
tasks.jar { archiveFileName.set("DuneRealms-Terrain.jar") }
val highlandsDatapack by tasks.registering(Zip::class) {
from("highlands-datapack")
archiveFileName.set("DuneRealms-Dune-Highlands-Datapack.zip")
destinationDirectory.set(layout.buildDirectory.dir("distributions"))
}
tasks.assemble { dependsOn(highlandsDatapack) }
val mockitoAgent by configurations.creating
dependencies { mockitoAgent("org.mockito:mockito-core:5.15.2") { isTransitive = false } }
tasks.test { jvmArgs("-javaagent:${mockitoAgent.singleFile.absolutePath}") }
sourceSets.main { java.srcDir("../citizens-common/src/main/java") }

View file

@ -18,12 +18,13 @@ import net.kyori.adventure.text.format.NamedTextColor;
final class JerboaMobs implements Listener {
static final NamespacedKey KIND=new NamespacedKey("dunerealms","jerboa"),ROLLED=new NamespacedKey("dunerealms","jerboa_mother_rolled");
private static final NamespacedKey EI=new NamespacedKey("executableitems","ei-id");
static final double SPEED=.225, MOTHER_CHANCE=.005;
static final double SPEED=.34, MOTHER_CHANCE=.005;
private final Plugin plugin;
private final ArrakisEcology.Items items;
private final java.util.function.DoubleSupplier random;
private final Set<UUID> replacing=new HashSet<>();
private final Map<UUID,UUID> retaliation=new HashMap<>();
private final Map<UUID,Long> lastHurt=new HashMap<>();
private final Map<UUID,Long> instantFeeds=new HashMap<>();
private final FaunaModels models;
private long ticks;
@ -52,7 +53,13 @@ final class JerboaMobs implements Listener {
if(entity instanceof Cat cat&&isJerboa(cat)){migrate(cat);continue;}
if(isJerboa(entity)){
valid.add(entity.getUniqueId());entity.setSilent(true);boolean curled=entity instanceof Armadillo a&&a.getState()!=Armadillo.State.IDLE;
String model=curled?"jerboa_curled":entity.getVelocity().lengthSquared()>.001?(entity.getTicksLived()/4%2==0?"jerboa_walk_left":"jerboa_walk_right"):"jerboa";
String model=curled?"jerboa_curled":entity.getVelocity().lengthSquared()>.001?(ticks/4%2==0?"jerboa_walk_left":"jerboa_walk_right"):"jerboa";
if(entity instanceof Armadillo armadillo){
var speed=armadillo.getAttribute(Attribute.MOVEMENT_SPEED);
if(speed!=null&&speed.getBaseValue()==.225)speed.setBaseValue(SPEED);
if(curled&&!recentlyHurt(armadillo))armadillo.rollOut();
if(!curled&&armadillo.getLoveModeTicks()==0)scurry(armadillo);
}
models.track(entity,model,entity instanceof Armadillo c&&!c.isAdult()?.48:mother(entity)?2:1);
if(!curled&&random.getAsDouble()<.01)entity.getWorld().playSound(entity.getLocation(),"dunerealms:jerboa.idle",SoundCategory.NEUTRAL,.35f,mother(entity)?.8f:1.1f);
if(entity instanceof Armadillo cat){if(cat.isAdult()&&!cat.getPersistentDataContainer().has(ROLLED,PersistentDataType.BYTE))rollMother(cat);}
@ -61,9 +68,28 @@ final class JerboaMobs implements Listener {
valid.add(entity.getUniqueId());models.track(entity,"tiny_worm",((Wolf)entity).isAdult()?.8:.45);
}
}
models.retain(valid);retaliation.keySet().retainAll(valid);instantFeeds.entrySet().removeIf(e->e.getValue()+1000<System.currentTimeMillis());
models.retain(valid);retaliation.keySet().retainAll(valid);lastHurt.keySet().retainAll(valid);instantFeeds.entrySet().removeIf(e->e.getValue()+1000<System.currentTimeMillis());
if((ticks+=4)%1200==0)for(var adult:world.getEntitiesByClass(Armadillo.class))autoBreed(adult);
}
/** Mouse-like movement: bolt away from nearby players in short, jinking dashes, and skitter around when undisturbed. */
private void scurry(Mob mob){
if(((ticks/4)+mob.getEntityId())%2!=0)return;
Location at=mob.getLocation();Player threat=null;double best=36;
for(Player player:mob.getWorld().getNearbyPlayers(at,6)){if(player.getGameMode()==GameMode.SPECTATOR||player.getGameMode()==GameMode.CREATIVE||player.isSneaking())continue;double d=player.getLocation().distanceSquared(at);if(d<best){best=d;threat=player;}}
if(threat!=null){
var away=at.toVector().subtract(threat.getLocation().toVector()).setY(0);
if(away.lengthSquared()<1e-4)away=new org.bukkit.util.Vector(random.getAsDouble()-.5,0,random.getAsDouble()-.5);
if(away.lengthSquared()<1e-4)return;
away.normalize().rotateAroundY((random.getAsDouble()-.5)*.9).multiply(8);
mob.getPathfinder().moveTo(at.clone().add(away),1.7);return;
}
if(random.getAsDouble()<.12&&mob.getPathfinder().getCurrentPath()==null){
double angle=random.getAsDouble()*Math.PI*2,run=2+random.getAsDouble()*3;
mob.getPathfinder().moveTo(at.clone().add(Math.cos(angle)*run,0,Math.sin(angle)*run),1.5);
}
}
private boolean recentlyHurt(Entity e){Long at=lastHurt.get(e.getUniqueId());return at!=null&&System.currentTimeMillis()-at<4000;}
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void hurt(EntityDamageEvent event){if(event.getEntity() instanceof Armadillo&&arrakis(event.getEntity())&&isJerboa(event.getEntity()))lastHurt.put(event.getEntity().getUniqueId(),System.currentTimeMillis());}
private void autoBreed(Armadillo adult){
if(!isJerboa(adult)||!adult.isAdult()||!adult.canBreed()||adult.getLoveModeTicks()>0||!adult.isTicking()||random.getAsDouble()>=.20)return;
var nearby=adult.getNearbyEntities(8,4,8);
@ -80,7 +106,7 @@ final class JerboaMobs implements Listener {
adult.getPersistentDataContainer().set(ROLLED,PersistentDataType.BYTE,(byte)1);
if(random.getAsDouble()>=MOTHER_CHANCE||adult.getNearbyEntities(32,16,32).stream().anyMatch(JerboaMobs::mother))return;
Location at=adult.getLocation().clone().add(2,0,2);if(!at.getChunk().isLoaded()||!at.getBlock().isPassable()||!at.clone().add(0,1,0).getBlock().isPassable()||!at.clone().add(0,-1,0).getBlock().getType().isSolid())return;
at.getWorld().spawn(at,Spider.class,s->{s.getPersistentDataContainer().set(KIND,PersistentDataType.BYTE,(byte)2);s.customName(Component.text("Big Mama Jerboa",NamedTextColor.GOLD));s.getAttribute(Attribute.MAX_HEALTH).setBaseValue(6);s.setHealth(6);s.getAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(SPEED);s.getAttribute(Attribute.ATTACK_DAMAGE).setBaseValue(3);var scale=s.getAttribute(Attribute.SCALE);if(scale!=null)scale.setBaseValue(1.4);s.setTarget(null);});
at.getWorld().spawn(at,Spider.class,s->{s.getPersistentDataContainer().set(KIND,PersistentDataType.BYTE,(byte)2);s.customName(Component.text("Big Mama Jerboa",NamedTextColor.GOLD));s.getAttribute(Attribute.MAX_HEALTH).setBaseValue(6);s.setHealth(6);s.getAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(.225);s.getAttribute(Attribute.ATTACK_DAMAGE).setBaseValue(3);var scale=s.getAttribute(Attribute.SCALE);if(scale!=null)scale.setBaseValue(1.4);s.setTarget(null);});
}
private static void consume(Player player,EquipmentSlot hand){if(player.getGameMode()==GameMode.CREATIVE)return;ItemStack item=player.getInventory().getItem(hand);item.setAmount(item.getAmount()-1);player.getInventory().setItem(hand,item);}
private void litter(Armadillo parent,Player breeder){int born=0;UUID reference=null;for(int i=0;i<4;i++){var at=parent.getLocation().clone().add((i%2-.5)*.4,0,(i/2-.5)*.4);var child=spawn(at,-24000);if(child.isValid()){born++;if(reference==null)reference=child.getUniqueId();FaunaProof.record(breeder,"jerboa","breed",child);}}if(born==4)FaunaProof.milestone(breeder,"husbandry_instant_litter",reference);parent.getWorld().spawnParticle(Particle.HEART,parent.getLocation().add(0,.5,0),7,.3,.3,.3);}

View file

@ -1,7 +1,7 @@
name: DuneTerrain
version: 1.0.18-jarvisloot1
main: com.example.duneterrain.DuneTerrain
api-version: '1.21'
load: STARTUP
description: Configurable Dune planet terrain and spawn generator for Paper
softdepend: [Citizens, DuneEss]
name: DuneTerrain
version: 1.0.19-jerboa1
main: com.example.duneterrain.DuneTerrain
api-version: '1.21'
load: STARTUP
description: Configurable Dune planet terrain and spawn generator for Paper
softdepend: [Citizens, DuneEss]

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"ambientocclusion":false,"textures":{"fur":"dunerealms:entity/jerboa","particle":"#fur"},"elements":[{"from":[5.279999999999999,2.2100000000000004,3.699],"to":[10.72,4.862,5.943],"faces":{"west":{"uv":[0,6,1.5,7.5],"texture":"#fur"},"north":{"uv":[1.5,6,3.5,7.5],"texture":"#fur"},"east":{"uv":[3.5,6,5,7.5],"texture":"#fur"},"south":{"uv":[5,6,7,7.5],"texture":"#fur"},"up":{"uv":[1.5,4.5,3.5,6],"texture":"#fur"},"down":{"uv":[3.5,4.5,5.5,6],"texture":"#fur"}}},{"from":[6.98,2.2100000000000004,2.9509999999999987],"to":[9.02,3.0940000000000007,3.699],"faces":{"west":{"uv":[9,6,9.5,6.5],"texture":"#fur"},"north":{"uv":[9.5,6,10.25,6.5],"texture":"#fur"},"east":{"uv":[10.25,6,10.75,6.5],"texture":"#fur"},"south":{"uv":[10.75,6,11.5,6.5],"texture":"#fur"},"up":{"uv":[9.5,5.5,10.25,6],"texture":"#fur"},"down":{"uv":[10.25,5.5,11,6],"texture":"#fur"}}},{"from":[9.36,4.862,4.0729999999999995],"to":[10.72,5.746,4.446999999999999],"faces":{"west":{"uv":[7.25,6.25,7.5,6.75],"texture":"#fur"},"north":{"uv":[7.5,6.25,8,6.75],"texture":"#fur"},"east":{"uv":[8,6.25,8.25,6.75],"texture":"#fur"},"south":{"uv":[8.25,6.25,8.75,6.75],"texture":"#fur"},"up":{"uv":[7.5,6,8,6.25],"texture":"#fur"},"down":{"uv":[8,6,8.5,6.25],"texture":"#fur"}}},{"from":[5.279999999999999,4.862,4.0729999999999995],"to":[6.64,5.746,4.446999999999999],"faces":{"west":{"uv":[4.75,0.25,5,0.75],"texture":"#fur"},"north":{"uv":[5,0.25,5.5,0.75],"texture":"#fur"},"east":{"uv":[5.5,0.25,5.75,0.75],"texture":"#fur"},"south":{"uv":[5.75,0.25,6.25,0.75],"texture":"#fur"},"up":{"uv":[5,0,5.5,0.25],"texture":"#fur"},"down":{"uv":[5.5,0,6,0.25],"texture":"#fur"}}},{"from":[5.96,1.5470000000000004,5.943],"to":[10.04,3.757,10.057],"faces":{"west":{"uv":[0.25,1.5,1.5,4.25],"texture":"#fur"},"down":{"uv":[1.5,1.5,3,4.25],"texture":"#fur"},"east":{"uv":[3,1.5,4.25,4.25],"texture":"#fur"},"up":{"uv":[4.25,1.5,5.75,4.25],"texture":"#fur"},"north":{"uv":[1.5,0.25,3,1.5],"texture":"#fur"},"south":{"uv":[3,0.25,4.5,1.5],"texture":"#fur"}}},{"from":[8.68,0,6.13],"to":[10.72,2.2100000000000004,7.252],"faces":{"west":{"uv":[6.25,4.25,7,5.5],"texture":"#fur"},"north":{"uv":[7,4.25,7.75,5.5],"texture":"#fur"},"east":{"uv":[7.75,4.25,8.5,5.5],"texture":"#fur"},"south":{"uv":[8.5,4.25,9.25,5.5],"texture":"#fur"},"up":{"uv":[7,3.5,7.75,4.25],"texture":"#fur"},"down":{"uv":[7.75,3.5,8.5,4.25],"texture":"#fur"}}},{"from":[8.68,0,8.748],"to":[10.72,2.2100000000000004,9.870000000000001],"faces":{"west":{"uv":[0,8.5,0.75,9.75],"texture":"#fur"},"north":{"uv":[0.75,8.5,1.5,9.75],"texture":"#fur"},"east":{"uv":[1.5,8.5,2.25,9.75],"texture":"#fur"},"south":{"uv":[2.25,8.5,3,9.75],"texture":"#fur"},"up":{"uv":[0.75,7.75,1.5,8.5],"texture":"#fur"},"down":{"uv":[1.5,7.75,2.25,8.5],"texture":"#fur"}}},{"from":[5.279999999999999,0,6.13],"to":[7.32,2.2100000000000004,7.252],"faces":{"west":{"uv":[6.5,7.75,7.25,9],"texture":"#fur"},"north":{"uv":[7.25,7.75,8,9],"texture":"#fur"},"east":{"uv":[8,7.75,8.75,9],"texture":"#fur"},"south":{"uv":[8.75,7.75,9.5,9],"texture":"#fur"},"up":{"uv":[7.25,7,8,7.75],"texture":"#fur"},"down":{"uv":[8,7,8.75,7.75],"texture":"#fur"}}},{"from":[5.279999999999999,0,8.748],"to":[7.32,2.2100000000000004,9.870000000000001],"faces":{"west":{"uv":[3.25,8.5,4,9.75],"texture":"#fur"},"north":{"uv":[4,8.5,4.75,9.75],"texture":"#fur"},"east":{"uv":[4.75,8.5,5.5,9.75],"texture":"#fur"},"south":{"uv":[5.5,8.5,6.25,9.75],"texture":"#fur"},"up":{"uv":[4,7.75,4.75,8.5],"texture":"#fur"},"down":{"uv":[4.75,7.75,5.5,8.5],"texture":"#fur"}}},{"from":[7.32,1.7680000000000002,10.057],"to":[8.68,3.5360000000000005,13.423],"faces":{"west":{"uv":[6.25,1,7.25,3.25],"texture":"#fur"},"up":{"uv":[7.25,1,8.25,3.25],"texture":"#fur"},"east":{"uv":[8.25,1,9.25,3.25],"texture":"#fur"},"down":{"uv":[9.25,1,10.25,3.25],"texture":"#fur"},"south":{"uv":[7.25,0,8.25,1],"texture":"#fur"},"north":{"uv":[8.25,0,9.25,1],"texture":"#fur"}}}]}
{"ambientocclusion":false,"textures":{"fur":"dunerealms:entity/jerboa","particle":"#fur"},"elements":[{"from":[5.0,0.2,3.6],"to":[11.0,6.0,10.4],"faces":{"up":{"uv":[0,0,2,2],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[0,0,2,2],"texture":"#fur"},"south":{"uv":[0,0,2,2],"texture":"#fur"},"west":{"uv":[0,0,2,2],"texture":"#fur"},"east":{"uv":[0,0,2,2],"texture":"#fur"}}},{"from":[5.4,0.1,4.0],"to":[10.6,1.4,10.0],"faces":{"up":{"uv":[4,0,6,2],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[4,0,6,2],"texture":"#fur"},"south":{"uv":[4,0,6,2],"texture":"#fur"},"west":{"uv":[4,0,6,2],"texture":"#fur"},"east":{"uv":[4,0,6,2],"texture":"#fur"}}},{"from":[6.3,0.8,1.9],"to":[9.7,4.0,4.1],"faces":{"up":{"uv":[6,0,8,2],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[6,0,8,2],"texture":"#fur"},"south":{"uv":[6,0,8,2],"texture":"#fur"},"west":{"uv":[6,0,8,2],"texture":"#fur"},"east":{"uv":[6,0,8,2],"texture":"#fur"}}},{"from":[7.2,1.0,1.2],"to":[8.8,2.4,2.0],"faces":{"up":{"uv":[14,2,16,4],"texture":"#fur"},"down":{"uv":[4,0,6,2],"texture":"#fur"},"north":{"uv":[14,2,16,4],"texture":"#fur"},"south":{"uv":[14,2,16,4],"texture":"#fur"},"west":{"uv":[14,2,16,4],"texture":"#fur"},"east":{"uv":[14,2,16,4],"texture":"#fur"}}},{"from":[6.1,2.3,2.6],"to":[6.4,3.4,3.7],"faces":{"up":{"uv":[12,0,14,2],"texture":"#fur"},"down":{"uv":[12,0,14,2],"texture":"#fur"},"north":{"uv":[12,0,14,2],"texture":"#fur"},"south":{"uv":[12,0,14,2],"texture":"#fur"},"west":{"uv":[12,0,14,2],"texture":"#fur"},"east":{"uv":[12,0,14,2],"texture":"#fur"}}},{"from":[9.6,2.3,2.6],"to":[9.9,3.4,3.7],"faces":{"up":{"uv":[12,0,14,2],"texture":"#fur"},"down":{"uv":[12,0,14,2],"texture":"#fur"},"north":{"uv":[12,0,14,2],"texture":"#fur"},"south":{"uv":[12,0,14,2],"texture":"#fur"},"west":{"uv":[12,0,14,2],"texture":"#fur"},"east":{"uv":[12,0,14,2],"texture":"#fur"}}},{"from":[6.0,5.8,3.7],"to":[7.2,6.2,6.2],"faces":{"up":{"uv":[8,0,10,2],"texture":"#fur"},"down":{"uv":[10,0,12,2],"texture":"#fur"},"north":{"uv":[8,0,10,2],"texture":"#fur"},"south":{"uv":[8,0,10,2],"texture":"#fur"},"west":{"uv":[8,0,10,2],"texture":"#fur"},"east":{"uv":[8,0,10,2],"texture":"#fur"}}},{"from":[8.8,5.8,3.7],"to":[10.0,6.2,6.2],"faces":{"up":{"uv":[8,0,10,2],"texture":"#fur"},"down":{"uv":[10,0,12,2],"texture":"#fur"},"north":{"uv":[8,0,10,2],"texture":"#fur"},"south":{"uv":[8,0,10,2],"texture":"#fur"},"west":{"uv":[8,0,10,2],"texture":"#fur"},"east":{"uv":[8,0,10,2],"texture":"#fur"}}},{"from":[5.4,0.2,10.4],"to":[10.6,1.2,11.2],"faces":{"up":{"uv":[4,2,6,4],"texture":"#fur"},"down":{"uv":[4,2,6,4],"texture":"#fur"},"north":{"uv":[4,2,6,4],"texture":"#fur"},"south":{"uv":[4,2,6,4],"texture":"#fur"},"west":{"uv":[4,2,6,4],"texture":"#fur"},"east":{"uv":[4,2,6,4],"texture":"#fur"}}},{"from":[5.0,0.2,7.0],"to":[5.8,1.2,10.8],"faces":{"up":{"uv":[6,2,8,4],"texture":"#fur"},"down":{"uv":[6,2,8,4],"texture":"#fur"},"north":{"uv":[6,2,8,4],"texture":"#fur"},"south":{"uv":[6,2,8,4],"texture":"#fur"},"west":{"uv":[6,2,8,4],"texture":"#fur"},"east":{"uv":[6,2,8,4],"texture":"#fur"}}},{"from":[5.0,0.2,5.0],"to":[5.8,1.4,7.0],"faces":{"up":{"uv":[8,2,10,4],"texture":"#fur"},"down":{"uv":[8,2,10,4],"texture":"#fur"},"north":{"uv":[8,2,10,4],"texture":"#fur"},"south":{"uv":[8,2,10,4],"texture":"#fur"},"west":{"uv":[8,2,10,4],"texture":"#fur"},"east":{"uv":[8,2,10,4],"texture":"#fur"}}},{"from":[5.4,0.0,6.0],"to":[6.4,0.7,9.6],"faces":{"up":{"uv":[0,2,2,4],"texture":"#fur"},"down":{"uv":[2,2,4,4],"texture":"#fur"},"north":{"uv":[2,2,4,4],"texture":"#fur"},"south":{"uv":[0,2,2,4],"texture":"#fur"},"west":{"uv":[0,2,2,4],"texture":"#fur"},"east":{"uv":[0,2,2,4],"texture":"#fur"}}},{"from":[9.6,0.0,6.0],"to":[10.6,0.7,9.6],"faces":{"up":{"uv":[0,2,2,4],"texture":"#fur"},"down":{"uv":[2,2,4,4],"texture":"#fur"},"north":{"uv":[2,2,4,4],"texture":"#fur"},"south":{"uv":[0,2,2,4],"texture":"#fur"},"west":{"uv":[0,2,2,4],"texture":"#fur"},"east":{"uv":[0,2,2,4],"texture":"#fur"}}}]}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

@ -75,8 +75,9 @@ def verify_dunechest_fleet_target(sid, root, unit, incoming, installed):
def plan(artifacts, inventory, expected_source):
mode=inventory.get('mode')
if mode not in {'gui-preserve-backends','pillager-preserve-economy','arrakis-crysknife','navigator','planet-dunechest','fleet-dunechest','arrakis-raw-spice'}:
if mode not in {'gui-preserve-backends','pillager-preserve-economy','arrakis-crysknife','navigator','planet-dunechest','fleet-dunechest','arrakis-raw-spice','arrakis-jerboa'}:
raise ValueError('An explicit supported rollout mode is required')
jerboa=mode=='arrakis-jerboa'
raw_spice=mode=='arrakis-raw-spice'
pillager=mode=='pillager-preserve-economy'
crysknife=mode=='arrakis-crysknife'
@ -90,6 +91,8 @@ def plan(artifacts, inventory, expected_source):
allowed_names = {'DuneEss', 'DuneRealms', 'DuneCore', 'DuneLobby', 'DuneNPC', 'DunerealmsGUI', 'DuneTerrain', 'JarvisTranslator', 'DuneMenus'}
if dunechest:
allowed_names={'DuneChest'}
if jerboa:
allowed_names={'DuneTerrain'}
if raw_spice:
allowed_names={'JarvisTranslator'}
if inventory.get('menuPack') is not None:
@ -126,7 +129,7 @@ def plan(artifacts, inventory, expected_source):
if inventory.get('menuPack') is not None:
_, menu = load_menu(artifacts, expected_source)
verify_public_menu(inventory['menuPack']['url'], menu)
if (pillager or crysknife or navigator or dunechest) and not(menu and menu.get('unified')):
if (pillager or crysknife or navigator or dunechest or jerboa) and not(menu and menu.get('unified')):
raise ValueError('This rollout requires its verified unified item/skin pack')
if fleet_dunechest and menu['sha256'] != '25ae69ae7198002ebff65b1eafbb454be7df235f51cdc46bb6233aa0b3ceec7a':
raise ValueError('Fleet release must use the exact resource pack tested on Ordos')
@ -157,11 +160,14 @@ def plan(artifacts, inventory, expected_source):
raise ValueError('Server private prerequisites must be explicitly provided and reviewed')
chosen = [files[name] for name in selected] + [prerequisites[key] for key in selected_prerequisites]
wanted = {entry['name'].casefold() for entry in chosen}
uses_menu='dunemenus' in wanted or bool(menu and menu.get('unified') and not (crysknife or dunechest))
if menu and menu.get('unified') and not (crysknife or dunechest) and 'dunerealmsgui' not in wanted:
uses_menu='dunemenus' in wanted or bool(menu and menu.get('unified') and not (crysknife or dunechest or jerboa))
if menu and menu.get('unified') and not (crysknife or dunechest or jerboa) and 'dunerealmsgui' not in wanted:
raise ValueError('Unified pack rollout must select its matching DunerealmsGUI adapter')
if not (pillager or crysknife or navigator or dunechest or raw_spice) and wanted - {'dunemenus','dunerealmsgui','dunenpc','dunelobby','mcgui'}:
if not (pillager or crysknife or navigator or dunechest or raw_spice or jerboa) and wanted - {'dunemenus','dunerealmsgui','dunenpc','dunelobby','mcgui'}:
raise ValueError('GUI rollout must retain working Ess/JARVIS/Core/Terrain binaries')
if jerboa and (sid != 'arrakis' or root != ARRAKIS_ROOT or unit != 'dune-arrakis.service'
or wanted != {'duneterrain'} or selected_prerequisites):
raise ValueError('Jerboa rollout may only replace Terrain on Arrakis')
if raw_spice and (sid != 'arrakis' or root != ARRAKIS_ROOT or unit != 'dune-arrakis.service'
or wanted != {'jarvistranslator'} or selected_prerequisites):
raise ValueError('Raw spice rollout may only replace JARVIS on Arrakis')
@ -319,6 +325,17 @@ def plan(artifacts, inventory, expected_source):
replaced={entry['filename'] for entry in previous}
retained=[{'filename':path.name,'sha256':digest(path),'metadata':metadata(path)}
for path in sorted(plugins.glob('*.jar')) if path.name not in replaced]
if jerboa:
from plugin_arrakis_jerboa import BASELINE_SHA256, verify_terrain
installed = existing_paths.get('duneterrain')
if installed is None or digest(installed) not in {BASELINE_SHA256, chosen[0]['sha256']}:
raise ValueError('Jerboa rollout requires the retained Arrakis Terrain')
if not {'dunerealmsgui', 'mcgui'}.issubset(existing_paths):
raise ValueError('Jerboa pack delivery requires the retained GUI and MCGUI runtimes')
verify_terrain(chosen[0]['source'])
replaced = {entry['filename'] for entry in previous}
retained = [{'filename': path.name, 'sha256': digest(path), 'metadata': metadata(path)}
for path in sorted(plugins.glob('*.jar')) if path.name not in replaced]
if raw_spice:
from plugin_arrakis_raw_spice import BASELINE_SHA256, verify_jar
installed = existing_paths.get('jarvistranslator')
@ -329,14 +346,14 @@ def plan(artifacts, inventory, expected_source):
retained = [{'filename': path.name, 'sha256': digest(path), 'metadata': metadata(path)}
for path in sorted(plugins.glob('*.jar')) if path.name not in replaced]
configurations = []
if uses_menu or crysknife or dunechest:
if uses_menu or crysknife or dunechest or jerboa:
if menu is None:
raise ValueError('DuneMenus requires a verified published built menu overlay')
for relative, content in config_payloads(menu).items():
target = plugins / relative
if target.is_symlink() or target.parent.is_symlink():
raise ValueError('Menu configuration path must not be a symlink')
if (crysknife or navigator or dunechest) and relative == 'MCGUI/config.yml' and (
if (crysknife or navigator or dunechest or jerboa) and relative == 'MCGUI/config.yml' and (
not target.is_file() or target.read_bytes() != content.encode()
):
raise ValueError('Rollout must preserve the existing MCGUI engine configuration')

104
tools/make-jerboa-art.py Normal file
View file

@ -0,0 +1,104 @@
#!/usr/bin/env python3
"""Regenerates the Arrakis jerboa display art: a real jerboa (Dipodidae) - small round body, huge ears and eyes, very long
bipedal hind legs, long tufted tail - as a 64x64 palette atlas plus four item models (idle, two hop frames, curled).
usage: make-jerboa-art.py [REPO_ROOT] (needs Pillow). Model front is -Z, ground is y=0, centre x=8 z=8 (same as before)."""
import json, pathlib, random, sys
from PIL import Image, ImageDraw
ROOT = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else pathlib.Path(__file__).resolve().parents[1])
ECO = ROOT / "DuneRealmsGUI/ecology"
LEGACY = ROOT / "network/resource-pack/central/legacy/assets/dunerealms"
rng = random.Random(1964)
CELL = dict(back=(0, 0), dorsal=(1, 0), belly=(2, 0), face=(3, 0), earout=(4, 0), earin=(5, 0), eye=(6, 0), nose=(7, 0),
foot=(0, 1), claw=(1, 1), tailbase=(2, 1), band=(3, 1), tip=(4, 1), arm=(5, 1), leg=(6, 1), muzzle=(7, 1))
BASE = dict(back=(214, 172, 112), dorsal=(184, 138, 84), belly=(247, 240, 228), face=(232, 204, 156), earout=(224, 184, 136),
earin=(238, 168, 168), eye=(14, 10, 10), nose=(190, 112, 116), foot=(240, 216, 192), claw=(88, 68, 60),
tailbase=(206, 164, 106), band=(28, 24, 26), tip=(250, 248, 244), arm=(238, 214, 178), leg=(222, 186, 134), muzzle=(240, 222, 190))
def texture():
im = Image.new("RGBA", (64, 64), (0, 0, 0, 0)); px = im.load(); d = ImageDraw.Draw(im)
for name, (cx, cy) in CELL.items():
base = BASE[name]
for y in range(8):
for x in range(8):
j = rng.randint(-7, 7) if name not in ("eye", "band", "tip", "claw") else 0
px[cx * 8 + x, cy * 8 + y] = tuple(max(0, min(255, c + j)) for c in base) + (255,)
ex, ey = CELL["eye"][0] * 8, CELL["eye"][1] * 8 # big dark eye with a highlight
d.ellipse([ex + 1, ey + 1, ex + 6, ey + 6], fill=(10, 8, 8, 255)); d.rectangle([ex + 2, ey + 2, ex + 3, ey + 3], fill=(250, 250, 250, 255))
nx, ny = CELL["nose"][0] * 8, CELL["nose"][1] * 8
d.rectangle([nx + 2, ny + 2, nx + 5, ny + 5], fill=(150, 84, 92, 255))
ex2, ey2 = CELL["earin"][0] * 8, CELL["earin"][1] * 8 # pink inner ear with a cream rim
d.rectangle([ex2, ey2, ex2 + 7, ey2 + 7], outline=(240, 214, 190, 255))
return im
def uv(cell): cx, cy = CELL[cell]; return [cx * 2, cy * 2, cx * 2 + 2, cy * 2 + 2]
def box(a, b, top=None, side=None, bottom=None, front=None, rot=None, **faces):
top = top or side; bottom = bottom or side; front = front or side
f = {"up": top, "down": bottom, "north": front, "south": side, "west": side, "east": side}; f.update(faces)
el = {"from": [round(v, 3) for v in a], "to": [round(v, 3) for v in b], "faces": {k: {"uv": uv(c), "texture": "#fur"} for k, c in f.items()}}
if rot: el["rotation"] = {"angle": rot[0], "axis": rot[1], "origin": list(rot[2])}
return el
def jerboa(foot_l=(0, 0), foot_r=(0, 0), body_dy=0.0, body_dz=0.0, ear=0, tail_dy=0.0, pitch=0):
"""foot_* = (dz, dy): forward/back shift and lift of each hind foot. Returns the element list."""
e = []; B = body_dy
for sx, (dz, dy) in ((-1.55, foot_l), (1.55, foot_r)): # long hind legs: foot, shank, thigh
x = 8 + sx; zf = 4.8 + dz
e.append(box([x - .6, dy, zf], [x + .6, .7 + dy, zf + 4.8], top="foot", side="foot", bottom="claw", front="claw")) # long foot, toes toward -z
e.append(box([x - .45, .7 + dy, zf + 3.6], [x + .45, 5.9 + dy, zf + 4.6], side="leg", rot=(22.5, "x", (x, .7 + dy, zf + 4.1)))) # thin shank
e.append(box([x - .95, 4.6 + dy * .5, 6.2 + dz * .4], [x + .95, 8.0 + B, 9.4 + dz * .4], side="leg", front="leg")) # thigh
z0 = body_dz
e.append(box([5.8, 5.0 + B, 3.2 + z0], [10.2, 9.0 + B, 9.8 + z0], top="back", side="back", bottom="belly", front="back")) # body
e.append(box([6.2, 5.2 + B, 3.4 + z0], [9.8, 5.9 + B, 9.4 + z0], top="belly", side="belly", bottom="belly", front="belly")) # pale belly line
e.append(box([7.4, 9.0 + B, 4.4 + z0], [8.6, 9.2 + B, 9.0 + z0], top="dorsal", side="dorsal", bottom="dorsal", front="dorsal")) # dark dorsal stripe
for sx in (-1.55, 1.55): # tiny forelimbs held to the chest
e.append(box([8 + sx - .4, 3.9 + B, 3.0 + z0], [8 + sx + .4, 5.8 + B, 3.8 + z0], side="arm", front="arm"))
hy = 6.0 + B; hz = z0 # head, muzzle, nose
e.append(box([6.4, hy, 0.6 + hz], [9.6, hy + 3.3, 4.0 + hz], top="face", side="face", bottom="belly", front="face"))
e.append(box([7.15, hy + .4, -0.7 + hz], [8.85, hy + 2.0, 0.6 + hz], top="muzzle", side="muzzle", bottom="belly", front="muzzle"))
e.append(box([7.5, hy + 1.1, -0.95 + hz], [8.5, hy + 1.8, -0.7 + hz], side="nose", front="nose"))
for sx in (-1, 1): # big dark eyes and very large ears
ex = 8 + sx * 1.62
e.append(box([ex - (.2 if sx < 0 else .2), hy + 1.5, 1.4 + hz], [ex + (.2 if sx < 0 else .2), hy + 3.0, 2.7 + hz], side="eye", front="eye", top="eye", bottom="eye"))
o = (8 + sx * 1.3, hy + 3.2, 2.4 + hz)
e.append(box([o[0] - .55, o[1], o[2] - .4], [o[0] + .55, o[1] + 3.6, o[2] + .4], side="earout", front="earin", rot=(ear * sx, "z", (o[0], o[1], o[2]))))
e.append(box([o[0] - .35, o[1] + .2, o[2] - .45], [o[0] + .35, o[1] + 3.3, o[2] - .4], side="earin", front="earin", rot=(ear * sx, "z", (o[0], o[1], o[2]))))
ty = 5.4 + B + tail_dy # very long tail with a black band and a white tuft
e.append(box([7.6, ty, 9.4 + z0], [8.4, ty + .8, 15.2 + z0], top="tailbase", side="tailbase", bottom="tailbase", front="tailbase"))
e.append(box([7.4, ty - .1 + tail_dy * .2, 15.2 + z0], [8.6, ty + 1.0 + tail_dy * .2, 17.6 + z0], top="band", side="band", bottom="band", front="band"))
e.append(box([7.3, ty - .2 + tail_dy * .3, 17.6 + z0], [8.7, ty + 1.2 + tail_dy * .3, 19.8 + z0], top="tip", side="tip", bottom="tip", front="tip"))
return e
def curled():
e = [box([5.0, 0.2, 3.6], [11.0, 6.0, 10.4], top="back", side="back", bottom="belly", front="back"),
box([5.4, 0.1, 4.0], [10.6, 1.4, 10.0], top="belly", side="belly", bottom="belly", front="belly"),
box([6.3, 0.8, 1.9], [9.7, 4.0, 4.1], top="face", side="face", bottom="belly", front="face"),
box([7.2, 1.0, 1.2], [8.8, 2.4, 2.0], top="muzzle", side="muzzle", bottom="belly", front="muzzle"),
box([6.1, 2.3, 2.6], [6.4, 3.4, 3.7], side="eye", front="eye", top="eye", bottom="eye"), box([9.6, 2.3, 2.6], [9.9, 3.4, 3.7], side="eye", front="eye", top="eye", bottom="eye"),
box([6.0, 5.8, 3.7], [7.2, 6.2, 6.2], side="earout", top="earout", bottom="earin", front="earout"), box([8.8, 5.8, 3.7], [10.0, 6.2, 6.2], side="earout", top="earout", bottom="earin", front="earout"),
box([5.4, 0.2, 10.4], [10.6, 1.2, 11.2], top="tailbase", side="tailbase", bottom="tailbase", front="tailbase"),
box([5.0, 0.2, 7.0], [5.8, 1.2, 10.8], top="band", side="band", bottom="band", front="band"),
box([5.0, 0.2, 5.0], [5.8, 1.4, 7.0], top="tip", side="tip", bottom="tip", front="tip"),
box([5.4, 0.0, 6.0], [6.4, 0.7, 9.6], top="foot", side="foot", bottom="claw", front="claw"), box([9.6, 0.0, 6.0], [10.6, 0.7, 9.6], top="foot", side="foot", bottom="claw", front="claw")]
return e
def model(elements): return {"ambientocclusion": False, "textures": {"fur": "dunerealms:entity/jerboa", "particle": "#fur"}, "elements": elements}
MODELS = {
"jerboa": model(jerboa()), # alert: upright on both feet, ears up
"jerboa_walk_left": model(jerboa(foot_l=(-2.4, .9), foot_r=(1.0, 0), body_dy=.5, body_dz=-.3, ear=22.5, tail_dy=.5, pitch=1)), # hop: feet gathered forward
"jerboa_walk_right": model(jerboa(foot_l=(1.0, 0), foot_r=(-2.4, .9), body_dy=.5, body_dz=-.3, ear=22.5, tail_dy=.5, pitch=1)),
"jerboa_curled": model(curled()),
}
def write_json(path, obj): path.parent.mkdir(parents=True, exist_ok=True); path.write_text(json.dumps(obj, separators=(",", ":")))
tex = texture()
for name, m in MODELS.items():
write_json(ECO / "models" / f"{name}.json", m)
if (LEGACY / "models/entity").exists(): write_json(LEGACY / "models/entity" / f"{name}.json", m)
(ECO / "textures").mkdir(parents=True, exist_ok=True); tex.save(ECO / "textures/jerboa.png")
if (LEGACY / "textures/entity").exists(): tex.save(LEGACY / "textures/entity/jerboa.png")
print("wrote", len(MODELS), "models and the 64x64 atlas")

View file

@ -0,0 +1,48 @@
import hashlib
from pathlib import Path
import sys
import zipfile
BASELINE_SHA256 = 'bad1022e2dab960808641fea15e3a6968d4aafeaaa46bedf4ee5c5e87bbd3534'
BASELINE_PACK = '25ae69ae7198002ebff65b1eafbb454be7df235f51cdc46bb6233aa0b3ceec7a'
RETAINED_TREE = '1ad55afb10d0876e584a9ca6530c622cb0364e724c6a8d3d6b25259b9ae43e78'
DESCRIPTOR_SHA256 = '6a065d36f5bf1857ab5b0ffa662fc8d7016fda556704479d7570a47a2c62aab1'
JERBOA_CLASS = 'com/example/duneterrain/JerboaMobs.class'
ASSETS = {
*(f'assets/dunerealms/models/entity/jerboa{pose}.json' for pose in ('', '_curled', '_walk_left', '_walk_right')),
'assets/dunerealms/textures/entity/jerboa.png',
}
def archive(path):
with zipfile.ZipFile(path) as file:
names = [name for name in file.namelist() if not name.endswith('/')]
if len(set(names)) != len(names):
raise ValueError('Duplicate archive entry')
return {name: file.read(name) for name in names}
def verify_terrain(path):
entries = archive(path)
if JERBOA_CLASS not in entries or hashlib.sha256(entries['plugin.yml']).hexdigest() != DESCRIPTOR_SHA256:
raise ValueError('Unexpected Jerboa Terrain identity')
rows = [name + '\0' + hashlib.sha256(data).hexdigest() for name, data in sorted(entries.items())
if name not in {JERBOA_CLASS, 'plugin.yml'}]
if hashlib.sha256('\n'.join(rows).encode()).hexdigest() != RETAINED_TREE:
raise ValueError('Terrain changes must be limited to JerboaMobs and the version label')
def verify_pack(before, after):
if hashlib.sha256(before.read_bytes()).hexdigest() != BASELINE_PACK:
raise ValueError('Unexpected Arrakis resource pack baseline')
old, new = archive(before), archive(after)
if old.keys() != new.keys() or {name for name in old if old[name] != new[name]} != ASSETS:
raise ValueError('Expected exactly four redesigned Jerboa poses and one texture')
assets = Path('network/resource-pack/central/legacy')
if any(new[name] != (assets / name).read_bytes() for name in ASSETS):
raise ValueError('Jerboa art differs from committed inputs')
if __name__ == '__main__':
verify_terrain(Path(sys.argv[1]))
verify_pack(Path(sys.argv[2]), Path(sys.argv[3]))

View file

@ -93,6 +93,14 @@ class CompletePackTests(unittest.TestCase):
from plugin_dunechest_pack import ASSETS
self.assertEqual(set(files),set(baseline)|set(changes)|{'CREDITS-Excalibur.txt'}|native_items|ASSETS)
else:self.assertEqual(set(files),set(baseline))
# Only the approved redesigned jerboa models and texture replace the owner baseline.
changes.update({
'assets/dunerealms/models/entity/jerboa.json': '6785d870031b326814b79a1f75fa0e69c1e0f2ba2c14644d4f046032a2c81df6',
'assets/dunerealms/models/entity/jerboa_curled.json': 'dd089bd58ab333fe08910f1f826d904c170507e4e41930d94f6b09f216c264e9',
'assets/dunerealms/models/entity/jerboa_walk_left.json': '13c9797d60e56719125474138c5efdcf0667b94df0e70e6998f3956f618a7012',
'assets/dunerealms/models/entity/jerboa_walk_right.json': '52cb0005d6a90b5e3e8f73375c3795b00c7fe8d639794b84024343be010915ff',
'assets/dunerealms/textures/entity/jerboa.png': '7cb10841fd92827f536c8138fdbebde7b0871de143cf8d5b715e7dc0d474f967',
})
for key,expected in baseline.items():
if key!='pack.mcmeta':self.assertEqual(hashlib.sha256(files[key]).hexdigest(),changes.get(key,expected),key)