fix: retain installed native NPC lifecycle and pin economy implementations
This commit is contained in:
parent
c599b2b708
commit
02e07b87e5
5 changed files with 98 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ import net.kyori.adventure.text.format.NamedTextColor;
|
|||
final class OrganisationHomeNpcs {
|
||||
static final NamespacedKey KEY=new NamespacedKey("dunerealms","organisation_home_npc");
|
||||
private final File file;private final YamlConfiguration ledger;private final JavaPlugin plugin;
|
||||
OrganisationHomeNpcs(JavaPlugin plugin){this.plugin=plugin;com.dunerealms.npc.CitizensBridge.start(plugin,KEY);file=new File(plugin.getDataFolder(),"home-npc-projection.yml");ledger=YamlConfiguration.loadConfiguration(file);}
|
||||
OrganisationHomeNpcs(JavaPlugin plugin){this.plugin=plugin;file=new File(plugin.getDataFolder(),"home-npc-projection.yml");ledger=YamlConfiguration.loadConfiguration(file);}
|
||||
private static String key(String kind,String id){return kind+":"+UUID.fromString(id);}
|
||||
private static String path(String key){return key.replace(':','.');}
|
||||
private Location saved(String id){String p=path(id);String world=ledger.getString(p+".world");if(world==null)return null;World w=Bukkit.getWorld(UUID.fromString(world));return w==null?null:new Location(w,ledger.getDouble(p+".x"),ledger.getDouble(p+".y"),ledger.getDouble(p+".z"));}
|
||||
|
|
@ -24,7 +24,7 @@ final class OrganisationHomeNpcs {
|
|||
private static Location stand(Location home){for(int y:new int[]{0,1})for(int[] delta:new int[][]{{1,0},{-1,0},{0,1},{0,-1},{2,0},{0,2},{0,0}}){Location pos=home.clone().add(delta[0],y,delta[1]);if(safe(pos,home))return pos;}return null;}
|
||||
private void configure(LivingEntity e,String id,String name){e.setInvulnerable(true);e.setPersistent(true);e.setRemoveWhenFarAway(false);e.setSilent(true);e.setCollidable(false);if(e instanceof Mob m)m.setAI(false);e.customName(Component.text("◇ "+name,NamedTextColor.GOLD));e.setCustomNameVisible(true);e.getPersistentDataContainer().set(KEY,PersistentDataType.STRING,id);}
|
||||
private void project(String id,JsonObject row,Location home)throws Exception{String p=path(id),authority=home.getWorld().getUID()+":"+home.getBlockX()+":"+home.getBlockY()+":"+home.getBlockZ();LivingEntity npc=find(id,home);String previous=ledger.getString(p+".home");String name=row.has("name")?row.get("name").getAsString():"Organisation";
|
||||
if(npc==null||!authority.equals(previous)){Location target=stand(home);if(target==null)throw new IllegalStateException("No safe standing space beside Home Block for "+id);if(npc==null)npc=home.getWorld().spawn(target,Villager.class,v->{v.setProfession(Villager.Profession.LIBRARIAN);configure(v,id,name);});else if(!com.dunerealms.npc.CitizensBridge.teleport(npc,target))throw new IllegalStateException("Home NPC relocation pending for "+id);}
|
||||
if(npc==null||!authority.equals(previous)){Location target=stand(home);if(target==null)throw new IllegalStateException("No safe standing space beside Home Block for "+id);if(npc==null)npc=home.getWorld().spawn(target,Villager.class,v->{v.setProfession(Villager.Profession.LIBRARIAN);configure(v,id,name);});else if(!npc.teleport(target))throw new IllegalStateException("Home NPC relocation pending for "+id);}
|
||||
if(!npc.isValid())throw new IllegalStateException("Home NPC spawn was blocked for "+id);configure(npc,id,name);Location at=npc.getLocation();ledger.set(p+".home",authority);ledger.set(p+".entity",npc.getUniqueId().toString());ledger.set(p+".world",at.getWorld().getUID().toString());ledger.set(p+".x",at.getX());ledger.set(p+".y",at.getY());ledger.set(p+".z",at.getZ());
|
||||
}
|
||||
private static Location home(JsonObject r){if(!r.has("homeBlock")||r.get("homeBlock").isJsonNull())return null;var h=r.getAsJsonObject("homeBlock");if(!"minecraft".equals(h.get("source").getAsString()))return null;World w=Bukkit.getWorld(UUID.fromString(h.get("worldUuid").getAsString()));if(w==null)return null;var p=h.getAsJsonObject("position");return new Location(w,p.get("x").getAsDouble()+.5,p.get("y").getAsDouble(),p.get("z").getAsDouble()+.5);}
|
||||
|
|
@ -33,7 +33,7 @@ final class OrganisationHomeNpcs {
|
|||
boolean reconcile(JsonArray clans,JsonArray companies,Set<String> owned,Set<String> towns,JsonArray review)throws Exception{
|
||||
if(!Bukkit.isPrimaryThread())throw new IllegalStateException("Home NPC mutation must run on the game thread");Map<String,JsonObject> active=new TreeMap<>();desired(clans,"clan",owned,active);desired(companies,"company",towns,active);Set<String> retained=new HashSet<>();if(review!=null)for(var v:review){var r=v.getAsJsonObject();if(Set.of("clan","company").contains(r.get("kind").getAsString()))retained.add(key(r.get("kind").getAsString(),r.get("id").getAsString()));}
|
||||
boolean complete=true;for(var entry:active.entrySet())if(!retained.contains(entry.getKey()))try{project(entry.getKey(),entry.getValue(),home(entry.getValue()));}catch(Exception pending){complete=false;plugin.getLogger().warning("Home NPC pending: "+entry.getKey()+" ("+pending.getMessage()+")");}
|
||||
for(String kind:List.of("clan","company")){var section=ledger.getConfigurationSection(kind);if(section==null)continue;for(String id:new HashSet<>(section.getKeys(false))){String k=key(kind,id);if(active.containsKey(k)||retained.contains(k))continue;Location old=saved(k);if(old==null){complete=false;continue;}LivingEntity e=find(k,old);if(e!=null)com.dunerealms.npc.CitizensBridge.remove(e);ledger.set(path(k),null);}}
|
||||
for(String kind:List.of("clan","company")){var section=ledger.getConfigurationSection(kind);if(section==null)continue;for(String id:new HashSet<>(section.getKeys(false))){String k=key(kind,id);if(active.containsKey(k)||retained.contains(k))continue;Location old=saved(k);if(old==null){complete=false;continue;}LivingEntity e=find(k,old);if(e!=null)e.remove();ledger.set(path(k),null);}}
|
||||
var target=file.toPath();java.nio.file.Files.createDirectories(target.getParent());String content=ledger.saveToString();if(!java.nio.file.Files.exists(target)||!java.nio.file.Files.readString(target).equals(content)){var staging=target.resolveSibling("home-npc-projection.yml.tmp");java.nio.file.Files.writeString(staging,content);try{java.nio.file.Files.move(staging,target,java.nio.file.StandardCopyOption.REPLACE_EXISTING,java.nio.file.StandardCopyOption.ATOMIC_MOVE);}catch(java.nio.file.AtomicMoveNotSupportedException unsupported){java.nio.file.Files.move(staging,target,java.nio.file.StandardCopyOption.REPLACE_EXISTING);}}
|
||||
return complete;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1854,5 +1854,84 @@
|
|||
],
|
||||
"fields": []
|
||||
}
|
||||
},
|
||||
"unchangedClassSha256": {
|
||||
"com/dunerealms/jarvis/ActiveQuestMinute.class": "b38a02d897791a8de645041e3c1eb2305c4dba4ca847549f323ac67b74ca51e9",
|
||||
"com/dunerealms/jarvis/ArrakisBrewing.class": "b49ff1c8a25d220f90679ffab368d9cf8c3cb9425054caa136d21a01438f98db",
|
||||
"com/dunerealms/jarvis/CraftedFlight.class": "3d750debf7dcf55420856dcbd4b82ee0b120098964c175e99ebbd13f0e06d6e6",
|
||||
"com/dunerealms/jarvis/CraftingGrades$Recipe.class": "cc8382746ec23772a58d788201320ad29e1d31c44319448ce121e68f3ac6f04c",
|
||||
"com/dunerealms/jarvis/CraftingGrades.class": "c1265ccceb55bc0d2e1b4b5db966e293d30eaff9856537fc849cdaf175c0c3eb",
|
||||
"com/dunerealms/jarvis/DunemarkCashCheckpoint$Piece.class": "d229b4c2e5b0a62e2a34c0cec8d0bd66f9854e959b9194f6060f5e533f2a726d",
|
||||
"com/dunerealms/jarvis/DunemarkCashCheckpoint$Plan.class": "fa9e3f8493568f8b14aa41c7470e9ad1b31aff5e22ecf7d9f1702238cdc1c2e9",
|
||||
"com/dunerealms/jarvis/DunemarkCashCheckpoint.class": "a6c4fd432156b76a3017b2d16076100ee9954d973dc747a99c3c2be39aed3d90",
|
||||
"com/dunerealms/jarvis/DunemarkDenomination.class": "6764a85b3e4c910314be61384ee01f0f48399efbfb4da46a1468d40055f1c836",
|
||||
"com/dunerealms/jarvis/EquipmentLoreStyle$1.class": "514f905fcaea741df0615a6709ad5ba474b1d3abbb6dbbcb226eb7da710e2e7b",
|
||||
"com/dunerealms/jarvis/EquipmentRefits.class": "7290dbf28c2b2a3c0983547c3ad90b478b4f39b4ccb88ea5ea3e6c7fb6911262",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$CargoReceipt.class": "a3470ff506afcbe99489a954708d3d943147c0a388448738d61412c85a5b14d2",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$CargoTask.class": "c9a6dcfbeab0aab5e6ae14f2a2be3d136a9c7a9835fb121c83abb278dc987754",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$MeatReceipt.class": "51b2cd0e13f20b7e479d84870478fb731ba6a2baa9491cc63d83e4ce7e9bf1d4",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$PaidFlight.class": "ab953bd3ee9c41b8eeb8feac2fcaeda04e870f5e90b7752ff9e548f0989cc9d5",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$Refined.class": "c6288289062c74d05a51a7afd7031042121af21c43bd0bdbc4ca9b88bc450d8b",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$StarterReceipt.class": "674ee0085b6452c693a1fb2b329a474ee93faf89fa459cdc72a19655a961981d",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$SupplyReceipt.class": "086107cef888b9acfb719f1e2ea19d833879fd4b3be0f7f132c4e9d53392d2a0",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$SupplyTask.class": "5d619700534af75cdddf2b6a8a75587fd70374a10e070382a44388945d498ad3",
|
||||
"com/dunerealms/jarvis/ExchangeInventory$Work.class": "c3fb7ee7f140eed3b3d9d6bf79d0ec200dcb5190a6e1523ded72262cf749f78b",
|
||||
"com/dunerealms/jarvis/ExchangeInventory.class": "3e92e9e7ac15442bd48624775de287dfbcdde485dfd5778299a1947c4c2f6e55",
|
||||
"com/dunerealms/jarvis/FactionsAdapter.class": "4c4a2ee11f23ac8a256fd71b0177ea9161af91ec83d92e30b8814e458338c49e",
|
||||
"com/dunerealms/jarvis/FlightObservations$1.class": "b5ce6657e714078d87174ed612437d081f4a93e8eca50429c0e768a216bdf909",
|
||||
"com/dunerealms/jarvis/FlightObservations.class": "2c2f918cda3a198b8f1c43021d89c1d2c901dbc3c94d95290d79f36a12d688f8",
|
||||
"com/dunerealms/jarvis/GuildTransport.class": "41ca667f8e211b629797a8e62c1a2d018fe27d964e22a406f16e05ae0e054e49",
|
||||
"com/dunerealms/jarvis/HQExchangeItem.class": "d245a6fc56659ad43956b0ac11419d61f10560ed89bb2504892e0ebdc0ca306e",
|
||||
"com/dunerealms/jarvis/HusbandryObservations.class": "2f53ecf8c0a3176d3d2b9f70388b82feb8a59d055c4e97d6515833888fcd5227",
|
||||
"com/dunerealms/jarvis/ItemCardArt.class": "7f7646da61356f37ce60e76e6935aea6a80b61ec2fb1295049c026d2a15fa2a7",
|
||||
"com/dunerealms/jarvis/ItemDesignPreview.class": "e634815fbbe25e6b0a1985f4bca3b6c6e8f204fafdcbccfc33805f53da8df046",
|
||||
"com/dunerealms/jarvis/ItemLoreCard$Card.class": "a2385c5a82f9c9fe3a7c362974d9c6e5bbf98cca547c502f329baaeffe78dffe",
|
||||
"com/dunerealms/jarvis/ItemLoreCard$Kind.class": "528c2f3a3761bd52fe79c8566c158018c89092c363959c058fb711ffbb9e6676",
|
||||
"com/dunerealms/jarvis/ItemLoreCard.class": "f1f6f37a1074944d2ecac1c8b98635caa1aa1da870e0b7c8b98ba947ad0c142a",
|
||||
"com/dunerealms/jarvis/ItemMetadataOverlay.class": "191b5ef64d6e6d9fdf29248b0e85cd9d40559b06860bc1ff7d5159bf22101353",
|
||||
"com/dunerealms/jarvis/ItemMetadataPolicy$Grade.class": "cb9ab3f508abb40a0b186015948e06a56b69048f58626f6fa8c7f07c2375e417",
|
||||
"com/dunerealms/jarvis/ItemMetadataPolicy$Template.class": "4a8322f8189ba232537bc9957736716f76e3c80096617e4cbf462a4db418f00b",
|
||||
"com/dunerealms/jarvis/ItemMetadataPolicy.class": "3461059adbb5f2dcf210294414f528befd0db1498ec2e7e8b120933e861ed733",
|
||||
"com/dunerealms/jarvis/ItemOrigin.class": "20c676166ebb7102f475c3e5e95a11cdccf10bfe7709a2a40382792e5f6f33b8",
|
||||
"com/dunerealms/jarvis/ItemRedeemCommand.class": "12e9b260901ce87b2eced8809a3eb79d6a06bf0848753a5d3486259a08a7bb16",
|
||||
"com/dunerealms/jarvis/LegacyNoticePolicy.class": "662d0b6685f1cdb8f5e6906d5e3d4b9e3a5c49bf67862a57b2fc3bfe36af7930",
|
||||
"com/dunerealms/jarvis/LorePanels.class": "ff87a17812d1244d37d7db86933a56c46aafddd265e55d14e5715c7d32e57c97",
|
||||
"com/dunerealms/jarvis/NativeActions$Binding.class": "82fafee4e4efb144d43491184c94424f4900ecc2557addcf57ec442ded3dfa2b",
|
||||
"com/dunerealms/jarvis/NativeActions$FieldResolver.class": "42bc768328779f2cd4298f5c4d1b911a6e9e196408a8615de15622efa552033b",
|
||||
"com/dunerealms/jarvis/NativeActions$KeyResolver.class": "da4ca43abba77b4faab405b8edf28ca26148ab4630d3a999f165799e8f31d4d0",
|
||||
"com/dunerealms/jarvis/NativeActions$Result.class": "fcda1609ca63937c5cfb65f0e90e19eb5b185c8aa2e4a12425a0a567c1db6ebd",
|
||||
"com/dunerealms/jarvis/NativeActions$Verified.class": "e60923a49fb1eea8e5e85da9357fff120e14db6bebfb02f7f8e9998d2916755c",
|
||||
"com/dunerealms/jarvis/NativeActions$VerifiedFields.class": "d34e53405345d48bcf07f1f79fca97ed554e145d8b77f54b89461aaf2097b5d6",
|
||||
"com/dunerealms/jarvis/NativeActions.class": "adcbd788069ba98428faa90830e1fabc0a2867d19f4fcf1e5a599da083807e5a",
|
||||
"com/dunerealms/jarvis/NativeCommandPolicy.class": "e4c7bdfa1d37e68622956cd69e10aef150fe8b50f09eeb22692e51b40e93a247",
|
||||
"com/dunerealms/jarvis/NativeHomes.class": "9811ce958ff913e61c9be9b97d1bd30ca6f68e831fbc67d3f29ed36d87cd9635",
|
||||
"com/dunerealms/jarvis/NativeKitGrant.class": "77d5106b7cc7cb803f74b858fafbf7625f774e755f1bf927ff66c657eec2e253",
|
||||
"com/dunerealms/jarvis/NativeProjectionScope.class": "b8b787ec1ae19d547458fb607ee7ef24c8e3e2c1ad53201fad474f333acac9b4",
|
||||
"com/dunerealms/jarvis/NativeReflection.class": "9853cec747ecebd9269b997bb1604ea5c9b1aaea62f09c67555948d615257cc7",
|
||||
"com/dunerealms/jarvis/NativeWorldGuard.class": "656a051ee3153c728683eb4e91dacd4f5bcf48e12898e397bfb9bdab6dc61f38",
|
||||
"com/dunerealms/jarvis/NetherAccess.class": "d426f44d108a09925beee788dee1b15f9f3a63349882a2405f814258516f08fb",
|
||||
"com/dunerealms/jarvis/OrganisationHomeNpcs.class": "959285eb7b474e6901fcc187fec1d5753e7114e269d6c35e027f9399f9dcc4e2",
|
||||
"com/dunerealms/jarvis/OrganisationTransport.class": "37b41d80e3db309a4ca200f05d8a2ef054b289929d6838ba0a577f015eef59c7",
|
||||
"com/dunerealms/jarvis/PlanetItemArtwork.class": "d982b3b216b0fe45ace12de3a3240f9b93032dc9f97c1a392d974c5207f008b7",
|
||||
"com/dunerealms/jarvis/PluginKey$Field.class": "358a26df156a07ad555f3db78df87a0abd0d9dc10a3118126da39a04934765c2",
|
||||
"com/dunerealms/jarvis/PluginKey.class": "ce7d26b89f83389fcccbdddd1f39c638b796b909b44f000e52583e8554a51dca",
|
||||
"com/dunerealms/jarvis/QuestObservations$Harvest.class": "29e9e2f66168e56745aa2c40f92c1a00238077370b26d0306819295145662763",
|
||||
"com/dunerealms/jarvis/QuestObservations.class": "2e25e4db4b1c03ca15aa18b557099e0448287e957a444e939ba912603bc48911",
|
||||
"com/dunerealms/jarvis/RefitItemArtwork.class": "0916f40b60429ea0320ed4fe5e4eee635054f4f8e235de00d7c8671b0bdeadb9",
|
||||
"com/dunerealms/jarvis/ReputationPower.class": "4ff7e2691134f8cea589d7dc19fb9a08516a40c68837570759bc4912992f34b5",
|
||||
"com/dunerealms/jarvis/SpiceBlocks.class": "6f3762e038bfca0581edd242e82a70027138446d55f9170ebdee21d9eda2d11d",
|
||||
"com/dunerealms/jarvis/SpiceRefiner.class": "ef3a62ec2eacda760d85d5e136ae48731b70855d9696ca5620dd8bbf0c1e6e11",
|
||||
"com/dunerealms/jarvis/StarterKitFlow.class": "445c66a0de99c8e61fcf6f9a0f6549ec65951d3c4d05aa38a4acfebdeb408e08",
|
||||
"com/dunerealms/jarvis/SurvivalFoodRecipes.class": "155da7a87355eac67452dbc5da4046d29b82fd5b544c4d5e911ce1dea09e74a3",
|
||||
"com/dunerealms/jarvis/TerrainAuthority.class": "1da687e6b42177f94cec0750ae4cf92987dbd57914d3cc8c92a52135535edb40",
|
||||
"com/dunerealms/jarvis/TownyAdapter.class": "6f19816515b4af66b7bf89d83896e391f95a8aaad368b7056111c03b696a721c",
|
||||
"com/dunerealms/jarvis/WarCampaignWorker$Original.class": "81b9d4040805a54bcf4d3a470ef2af5f9392eaf94a7a2dc6bdb2b7a53c037e99",
|
||||
"com/dunerealms/jarvis/WarCombatPolicy$Decision.class": "65335458eb876d132aebf7a01c18c8edd6609f39f12be0b1ae22762f7a4e6189",
|
||||
"com/dunerealms/jarvis/WarCombatPolicy$Member.class": "f2ccb392fff1fbd1cc1a195f9787f61a943cdb16ee1d2653a1940ec66af1f76b",
|
||||
"com/dunerealms/jarvis/WarCombatPolicy.class": "7c06f963aedb0bb728d9ef9ee2ac053f5e76f9fa4e337e4f3980f86139f4cfd2",
|
||||
"com/dunerealms/jarvis/WarObjectives$Marker.class": "e2c0220790b26c881136d21072ad488f7665259097e0c8328ec369a2d8b60716",
|
||||
"com/dunerealms/jarvis/WeirdingModule.class": "022fbf4334988dd9da0d0578f40861bb1aaec4531747edf1170a69aac95b28f7",
|
||||
"com/dunerealms/jarvis/WoodcuttingSupport.class": "6ebb1781f096410cc9b81d46aa0ea26bbb9494b69463cf748751adbed3c76e8d",
|
||||
"com/dunerealms/jarvis/WorldDefaults.class": "a2fcbc746af82f5db9ed3592bcd29f9b87389bc70f3062f7e5f986f6e117b3bb"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,3 +46,7 @@ The dedicated `Pillager Update Build` artifact packages only JarvisTranslator0.5
|
|||
Use explicit installer mode `pillager-preserve-economy`. Lobby receives only the resource/pack pins; planets additionally receive JARVIS, and only Arrakis receives provenance Terrain. Validate both reviewed JARVIS public-ABI variants and the installed MF11.1 prerequisite, retain every Core/Ess/other JAR hash and owner/mode, and use receipt-based rollback on startup/action-readiness failure. The older GUI installer profile retains its original restrictions. Do not use the world-reset helper for this update. Rollback preserves the durable raid journals; restoring an older JAR does not itself deliver queued outcomes or refund accepted orders, which require central recovery. The reviewed WorldGuard input is descriptor7.0.19+2400-f395a16 despite its historical7.0.13 filename; installation verifies exact bytes/API, not the filename.
|
||||
|
||||
Paired central source/CI, exact plugin CI artifact review, compatibility and startup checks are required before rollout. Real combat, paid ordering, client art and every gameplay callback are not established by compilation/unit tests. No connected-client or live payment acceptance is claimed here.
|
||||
|
||||
## Installed implementation audit
|
||||
|
||||
Comparison with both actual retained JARVIS variants found no SQL constant changes; ExchangeInventory and77 shared existing implementations are now byte-pinned, including native OrganisationHomeNpcs. The latent Citizens home-NPC migration from older source history is excluded from this release. Remaining non-feature differences are the existing GUI plugin-name corrections; the installed accepted GUI is the target. This is stronger than public-ABI compatibility, but still requires a startup canary before activation.
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ REVIEWED_TERRAIN_SHA256='b0777941e5c320e16731e447101b4157fb8af917951fc0e3128c4e6
|
|||
def verify_contract(path,fixture,require_hash=False):
|
||||
if require_hash and hashlib.sha256(Path(path).read_bytes()).hexdigest()!=fixture['sha256']:
|
||||
raise ValueError('Installed vendor runtime is not the reviewed input')
|
||||
with zipfile.ZipFile(path) as archive:
|
||||
for name,expected in fixture.get('unchangedClassSha256',{}).items():
|
||||
if hashlib.sha256(archive.read(name)).hexdigest()!=expected:
|
||||
raise ValueError('Retained implementation changed: '+name)
|
||||
classes=jar_classes(path)
|
||||
count=0
|
||||
for name,expected in fixture['classes'].items():
|
||||
|
|
|
|||
|
|
@ -66,6 +66,14 @@ class PillagerAbiTests(unittest.TestCase):
|
|||
result=abi.verify_contract(path,fixture);self.assertEqual(result['classes'],83);self.assertGreaterEqual(result['descriptors'],363)
|
||||
broken=copy.deepcopy(fixture);broken['classes']['com/dunerealms/jarvis/JarvisTranslator']['methods'].append(['missingPaidBypass','()V'])
|
||||
with self.assertRaisesRegex(ValueError,'missingPaidBypass'):abi.verify_contract(path,broken)
|
||||
def test_internal_economy_and_home_npc_implementations_are_byte_pinned(self):
|
||||
fixture=json.loads((ROOT/'JarvisConnector/src/test/resources/retained-jarvis-public-abi.json').read_text())
|
||||
self.assertEqual(len(fixture['unchangedClassSha256']),77)
|
||||
for name in ('ExchangeInventory','OrganisationHomeNpcs'):
|
||||
self.assertIn('com/dunerealms/jarvis/'+name+'.class',fixture['unchangedClassSha256'])
|
||||
broken=copy.deepcopy(fixture);broken['unchangedClassSha256']['com/dunerealms/jarvis/ExchangeInventory.class']='0'*64
|
||||
with self.assertRaisesRegex(ValueError,'Retained implementation changed'):
|
||||
abi.verify_contract(ROOT/'JarvisConnector/build/libs/jarvistranslator.jar',broken)
|
||||
def test_menu_artwork_may_change_but_no_class_or_unrelated_resource_may_change(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
before=Path(tmp)/'old.jar';after=Path(tmp)/'new.jar'
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff