Compare commits

...
Author SHA1 Message Date
koka fe491c0ebd chore(anotherworld): version safe vault fix
Verification 26.2 / check (pull_request) Canceled after 0s
2026-08-27 16:09:04 +02:00
koka 64b54c9b44 Merge remote-tracking branch 'origin/main' into feature/safe-vault-interface 2026-08-27 16:06:04 +02:00
koka 6b01d8f2f1 fix(anotherworld): finish safe vault formation 2026-08-27 16:03:59 +02:00
koka fd9fd1435b Merge pull request 'release: Sanctuary 26.2.0-alpha.203' (#20) from release/26.2.0-alpha.203 into main
Verification 26.2 / check (push) Canceled after 0s
Reviewed-on: #20
2026-08-27 13:23:35 +00:00
koka 1b9ee0aac0 release: prepare 26.2.0-alpha.203
Verification 26.2 / check (pull_request) Canceled after 0s
2026-08-27 15:19:15 +02:00
koka b0838ff9fd Merge pull request 'feat(anotherworld): add upright safe vault controls' (#19) from feature/safe-vault-interface into main
Verification 26.2 / check (push) Canceled after 0s
Reviewed-on: #19
2026-08-27 13:13:01 +00:00
koka 95ad129656 feat(anotherworld): add upright safe vault controls
Verification 26.2 / check (pull_request) Canceled after 0s
2026-08-27 14:41:22 +02:00
koka 51c1ad0e11 Merge pull request 'release: Sanctuary 26.2.0-alpha.202' (#15) from release/26.2.0-alpha.202 into main
Verification 26.2 / check (push) Canceled after 0s
Reviewed-on: #15
Reviewed-by: koka <cnstiout@gmail.com>
2026-08-27 12:04:35 +00:00
koka dd305cd64e merge: include safe vault in alpha.202
Verification 26.2 / check (pull_request) Canceled after 0s
2026-08-27 14:02:29 +02:00
koka c9a8d601a8 Merge pull request 'feat(anotherworld): ajouter le coffre-fort joueur 3 × 3' (#16) from feature/safe-vault into main
Verification 26.2 / check (push) Canceled after 0s
Reviewed-on: #16
Reviewed-by: botsu <botsu@botsu.net>
2026-08-27 11:51:01 +00:00
koka 414afb15da release: prepare 26.2.0-alpha.202
Verification 26.2 / check (pull_request) Canceled after 0s
2026-08-27 12:20:14 +02:00
33 changed files with 1168 additions and 168 deletions
+31 -4
View File
@@ -6,17 +6,44 @@ Ce journal suit les **versions du modpack**. Lorsqu'un seul module change, sa ve
- Depuis `26.2.0-alpha.6`, le pack et les modules ont des versions indépendantes. I Like To Move It et Only Fun deviennent les cinquième et sixième modules actifs dans l'alpha 46.
- Les versions ci-dessous ont été reconstituées à partir des JAR archivés, des packs locaux et du code source actuel. Les dates n'étant pas enregistrées de manière fiable, elles ne sont pas inventées.
## En développement — coffre-fort 3 × 3
## En développement — correction finale du Safe Block
Modules modifiés : **Another World `0.0.0-alpha.50`** et **Sanctuary `0.0.0-alpha.117`**. Le pack distribué reste en `26.2.0-alpha.201` jusqu’à la préparation dune release dédiée.
Module modifié : **Another World `0.0.0-alpha.52`**. Le pack distribué reste en **`26.2.0-alpha.203`**.
- charge la texture 16×16 du Safe Block depuis latlas de blocs afin de supprimer la texture manquante avant formation ;
- refuse explicitement les lignes horizontales ou verticales de 3 × 1 et nactive le CTM 48×48 quaprès validation des neuf blocs du mur 3 × 3 ;
- décale le panneau dinventaire étendu sous les trois lignes monétaires afin de rendre l’émeraude visible et laisse Sanctuary afficher un seul libellé dinventaire ;
- conserve les données v3, le protocole 1, les IDs et les soldes existants sans migration de sauvegarde.
## `26.2.0-alpha.203`
Module modifié : **Another World `0.0.0-alpha.51`**. Les neuf autres modules conservent leur version issue de lalpha.202.
- corrige la structure du Safe Block : les neuf segments doivent former un mur vertical exact de 3 × 3, et non une plateforme qui apparaît en 3 × 1 de face ;
- conserve un modèle cubique individuel en main et tant que la structure est incomplète ;
- active uniquement après formation les neuf modèles CTM qui découpent les textures 48×48 du coffre-fort ;
- remplace le coffre vanilla à 27 cases par une interface dédiée à trois soldes centrés — rubis, saphirs et émeraudes — avec les boutons ` ×64`, ` ×1`, `+ ×1` et `+ ×64` ;
- valide tous les transferts côté serveur, utilise seulement les rangées Sanctuary débloquées et refuse un retrait plutôt que de jeter des gemmes lorsque linventaire est plein ;
- actualise JEI de `30.26.0.186` à `30.27.0.187` dans Packwiz et le manifeste Prism/Modrinth ;
- préserve les soldes existants et le stockage persistant à 27 piles, porte Another World de la donnée v2 à v3 et `safe_vaults` de v1 à v2 ; une ancienne plateforme horizontale doit être reconstruite verticalement.
## `26.2.0-alpha.202`
Modules modifiés : **Another World `0.0.0-alpha.50`**, **It's Alive `0.0.0-alpha.31`**, **I Like To Move It `0.0.0-alpha.14`** et **Sanctuary `0.0.0-alpha.117`**. Les six autres modules conservent leur version issue de lalpha.201.
- ajoute `anotherworld:safe_block`, crafté avec huit blocs dor autour dun coffre, et active un unique coffre-fort par joueur lorsque neuf blocs du même propriétaire forment un carré horizontal exact de 3 × 3 ;
- conserve 27 emplacements globaux pour rubis, saphirs et émeraudes sous la clé versionnée `anotherworld_safe_vaults`, ce qui garde le solde accessible au Shop lorsque le chunk de la structure est déchargé ;
- expose dans Sanctuary une API publique de fournisseurs de monnaie et relie explicitement `Another World → Sanctuary` dans Gradle et Fabric, sans cycle ni copie des règles du Shop ;
- ajoute `anotherworld:titanium_drill` avec la texture 16×16 fournie et une recette en titane, redstone, piston, blocs de fer et pioche en diamant ;
- ajoute `anotherworld:titanium_drill` avec sa recette en titane, redstone, piston, blocs de fer et pioche en diamant ;
- impose un forage serveur continu de 60 secondes sur un coffre ennemi dont le propriétaire est connecté, alerte celui-ci, consomme la foreuse en cas de réussite et transfère 20 % des gemmes au pillard ;
- protège le coffre pendant 24 heures après un pillage réussi, bloque les attaques concurrentes et interdit la casse par un tiers ou le démontage dun coffre rempli ;
- porte les données Another World de v1 à v2 pour la nouvelle sauvegarde, sans changer les protocoles Another World 1 et Sanctuary 21 ni exiger de réinitialisation du monde.
- autorise la descente directe par un ascenseur de Waystones vers l’étage immédiatement inférieur encore inconnu et le découvre après larrivée ;
- exige toujours une découverte préalable pour monter par lascenseur ou emprunter un trajet Waystone ordinaire ;
- compte et consomme les rubis, saphirs et émeraudes du Shop et du marché noir dans toutes les rangées Sanctuary débloquées, y compris les rangées doverflow, sans compter deux fois une pile visible par plusieurs vues ;
- permet de poser le livre de recettes culinaires Its Alive sur un pupitre vanilla et dy consulter le catalogue appris par le joueur qui la placé ;
- efface cette inscription lorsque le livre est retiré ou le pupitre cassé, afin que le livre redevienne personnel dans linventaire ;
- ajoute linfobulle FR/EN/RU du livre partageable et le tag vanilla `minecraft:lectern_books` ;
- porte les données Another World de v1 à v2 pour la nouvelle sauvegarde et conserve les données Its Alive v1, I Like To Move It v3 et Sanctuary v11, leurs protocoles 1, 3, 5 et 21 ainsi que les sauvegardes existantes.
## `26.2.0-alpha.201`
+6 -2
View File
@@ -22,9 +22,13 @@ Licence : **GNU GPL 3.0 or Later** (`GPL-3.0-or-later`)
Les descriptions FR/EN/RU sont déclarées dans chaque `fabric.mod.json` et dans les fichiers de langue. Les images fournies servent d'icônes Fabric de leur module.
Version courante du pack distribué : **`26.2.0-alpha.201`**. Le développement du coffre-fort porte Another World en **`0.0.0-alpha.50`** et Sanctuary en **`0.0.0-alpha.117`** sans republier encore le pack.
Version courante du pack distribué : **`26.2.0-alpha.203`**. Dans le workspace, le correctif du Safe Block porte Another World en développement à **`0.0.0-alpha.52`** sans produire une nouvelle version du pack.
Le coffre-fort joueur utilise neuf blocs Another World disposés horizontalement en 3 × 3. Il accepte rubis, saphirs et émeraudes dans 27 emplacements liés au joueur et les rend disponibles aux transactions du Shop même lorsque la structure est déchargée. Une foreuse en titane maintenue pendant 60 secondes permet de piller 20 % du contenu dun propriétaire connecté, qui reçoit immédiatement une alerte ; une réussite consomme la foreuse et protège ensuite le coffre pendant 24 heures.
Lalpha.203 porte Another World en **`0.0.0-alpha.51`** et JEI en **`30.27.0.187`**. Le Safe Block forme désormais un mur vertical exact de 3 × 3 : ses blocs restent des cubes individuels avant validation, puis les neuf segments composent les textures connectées 48×48. Son interface affiche trois soldes centrés — rubis, saphirs et émeraudes — avec les transferts serveur ` ×64`, ` ×1`, `+ ×1` et `+ ×64`.
Lalpha.202 permet de descendre par un ascenseur de Waystones vers l’étage immédiatement inférieur encore inconnu, sans ouvrir la montée ni les trajets ordinaires aux destinations non découvertes. Le Shop et le marché noir comptent et consomment désormais les rubis et saphirs de toutes les rangées débloquées, y compris loverflow. Le livre culinaire peut enfin être posé sur un pupitre vanilla pour partager le catalogue de recettes de son propriétaire ; retiré du pupitre, il redevient personnel.
Le coffre-fort joueur utilise neuf blocs Another World disposés en mur vertical de 3 × 3. Il conserve les rubis, saphirs et émeraudes dans un compte lié au joueur et les rend disponibles aux transactions du Shop même lorsque la structure est déchargée. Une foreuse en titane maintenue pendant 60 secondes permet de piller 20 % du contenu dun propriétaire connecté, qui reçoit immédiatement une alerte ; une réussite consomme la foreuse et protège ensuite le coffre pendant 24 heures.
Lalpha.201 rend les demandes communautaires réellement terminables. Le demandeur dépose la récompense lors de la publication, le preneur confirme sans commande après avoir lu les détails, KILL progresse automatiquement, BRING livre les objets au demandeur et PAY est confirmé par le joueur désigné. La récompense séquestrée est ensuite expédiée une seule fois dans la Mailbox du preneur. Le pseudonyme conserve la couleur du joueur et le panneau rose adopte une palette plus claire et poudrée.
+61 -27
View File
@@ -177,26 +177,54 @@ tasks.register("generateAnotherWorldResources") {
// Mirror, creative-only rainbow blocks, gems and first-pass metal art.
simpleBlock("mirror", "minecraft:block/cube_all", "anotherworld:block/mirror_glass")
writeJson("assets/anotherworld/blockstates/safe_block.json", [variants: [
"facing=north": [model: "anotherworld:block/safe_block"],
"facing=east": [model: "anotherworld:block/safe_block", y: 90],
"facing=south": [model: "anotherworld:block/safe_block", y: 180],
"facing=west": [model: "anotherworld:block/safe_block", y: 270]
]])
writeJson("assets/anotherworld/models/block/safe_block.json", [
parent: "minecraft:block/cube",
textures: [
particle: "anotherworld:block/safe_vault/front",
down: "anotherworld:block/safe_vault/bottom",
up: "anotherworld:block/safe_vault/top",
north: "anotherworld:block/safe_vault/front",
south: "anotherworld:block/safe_vault/side",
west: "anotherworld:block/safe_vault/side",
east: "anotherworld:block/safe_vault/side"
]
def vaultParts = [
[id: "bottom_left", column: 0, row: 0], [id: "bottom_center", column: 1, row: 0],
[id: "bottom_right", column: 2, row: 0], [id: "middle_left", column: 0, row: 1],
[id: "center", column: 1, row: 1], [id: "middle_right", column: 2, row: 1],
[id: "top_left", column: 0, row: 2], [id: "top_center", column: 1, row: 2],
[id: "top_right", column: 2, row: 2]
]
def safeMultipart = [[when: [formed: "false"], apply: [model: "anotherworld:block/safe_block_unformed"]]]
[north: 0, east: 90, south: 180, west: 270].each { facing, rotation ->
vaultParts.each { part ->
def apply = [model: "anotherworld:block/safe_block/${part.id}"]
if (rotation != 0) apply.y = rotation
safeMultipart.add([when: [formed: "true", facing: facing.toString(), part: part.id], apply: apply])
}
}
writeJson("assets/anotherworld/blockstates/safe_block.json", [multipart: safeMultipart])
writeJson("assets/anotherworld/models/block/safe_block_unformed.json", [
parent: "minecraft:block/cube_all", textures: [all: "anotherworld:block/safe_block"]
])
def third = 16.0D / 3.0D
def segmentUv = { int column, int row ->
[column * third, (2 - row) * third, (column + 1) * third, (3 - row) * third]
}
vaultParts.each { part ->
def frontUv = segmentUv(part.column as int, part.row as int)
def backUv = segmentUv(2 - (part.column as int), part.row as int)
def sideUv = segmentUv(1, part.row as int)
def topUv = segmentUv(part.column as int, 1)
writeJson("assets/anotherworld/models/block/safe_block/${part.id}.json", [
textures: [
particle: "anotherworld:block/safe_vault/front",
bottom: "anotherworld:block/safe_vault/bottom",
top: "anotherworld:block/safe_vault/top",
front: "anotherworld:block/safe_vault/front",
side: "anotherworld:block/safe_vault/side"
],
elements: [[from: [0, 0, 0], to: [16, 16, 16], faces: [
down: [uv: topUv, texture: "#bottom", cullface: "down"],
up: [uv: topUv, texture: "#top", cullface: "up"],
north: [uv: frontUv, texture: "#front", cullface: "north"],
south: [uv: backUv, texture: "#side", cullface: "south"],
west: [uv: sideUv, texture: "#side", cullface: "west"],
east: [uv: sideUv, texture: "#side", cullface: "east"]
]]]
])
}
writeJson("assets/anotherworld/models/item/safe_block.json", [
parent: "minecraft:item/generated", textures: [layer0: "anotherworld:item/safe_block"]
parent: "anotherworld:block/safe_block_unformed"
])
writeJson("assets/anotherworld/items/safe_block.json", modelItem("anotherworld:item/safe_block"))
selfLoot("safe_block")
@@ -1594,9 +1622,11 @@ tasks.register("generateAnotherWorldResources") {
"container.anotherworld.safe_vault": "Coffre-fort",
"tooltip.anotherworld.titanium_drill.use": "Maintenir sur un coffre-fort ennemi pour le forer.",
"tooltip.anotherworld.titanium_drill.consumed": "Consommée après un pillage réussi.",
"message.anotherworld.safe_vault.incomplete": "Le coffre-fort exige exactement 9 blocs appartenant au même joueur, posés en 3 × 3.",
"message.anotherworld.safe_vault.incomplete": "Le coffre-fort exige exactement 9 blocs appartenant au même joueur, posés en mur vertical de 3 × 3.",
"message.anotherworld.safe_vault.locked": "Ce coffre-fort appartient à un autre joueur.",
"message.anotherworld.safe_vault.formed": "Coffre-fort 3 × 3 lié à vous en %s, %s, %s.",
"message.anotherworld.safe_vault.formed": "Coffre-fort vertical 3 × 3 lié à vous en %s, %s, %s.",
"message.anotherworld.safe_vault.deposit_failed": "Impossible de déposer %s : inventaire vide ou coffre-fort plein.",
"message.anotherworld.safe_vault.withdraw_failed": "Impossible de retirer %s : solde vide ou inventaire plein.",
"message.anotherworld.safe_vault.already_owned": "Vous possédez déjà un coffre-fort actif.",
"message.anotherworld.safe_vault.break_not_owner": "Seul le propriétaire peut démonter ce bloc de coffre-fort.",
"message.anotherworld.safe_vault.empty_before_break": "Videz le coffre-fort et attendez la fin du forage avant de le démonter.",
@@ -1616,9 +1646,11 @@ tasks.register("generateAnotherWorldResources") {
"container.anotherworld.safe_vault": "Сейф",
"tooltip.anotherworld.titanium_drill.use": "Удерживайте на чужом сейфе, чтобы просверлить его.",
"tooltip.anotherworld.titanium_drill.consumed": "Расходуется после успешного ограбления.",
"message.anotherworld.safe_vault.incomplete": "Сейф требует ровно 9 блоков одного владельца, уложенных 3 × 3.",
"message.anotherworld.safe_vault.incomplete": "Сейф требует вертикальную стену 3 × 3 из 9 блоков одного владельца.",
"message.anotherworld.safe_vault.locked": "Этот сейф принадлежит другому игроку.",
"message.anotherworld.safe_vault.formed": "Сейф 3 × 3 привязан к вам в точке %s, %s, %s.",
"message.anotherworld.safe_vault.formed": "Вертикальный сейф 3 × 3 привязан к вам в точке %s, %s, %s.",
"message.anotherworld.safe_vault.deposit_failed": "Не удалось внести %s: предметов нет или сейф заполнен.",
"message.anotherworld.safe_vault.withdraw_failed": "Не удалось забрать %s: баланс пуст или инвентарь заполнен.",
"message.anotherworld.safe_vault.already_owned": "У вас уже есть активный сейф.",
"message.anotherworld.safe_vault.break_not_owner": "Разобрать этот блок может только владелец.",
"message.anotherworld.safe_vault.empty_before_break": "Опустошите сейф и дождитесь окончания сверления перед разборкой.",
@@ -1638,9 +1670,11 @@ tasks.register("generateAnotherWorldResources") {
"container.anotherworld.safe_vault": "Safe",
"tooltip.anotherworld.titanium_drill.use": "Hold on an enemy safe to drill it.",
"tooltip.anotherworld.titanium_drill.consumed": "Consumed after a successful raid.",
"message.anotherworld.safe_vault.incomplete": "A safe requires exactly 9 blocks owned by one player in a 3 × 3 square.",
"message.anotherworld.safe_vault.incomplete": "A safe requires an upright 3 × 3 wall of exactly 9 blocks owned by one player.",
"message.anotherworld.safe_vault.locked": "This safe belongs to another player.",
"message.anotherworld.safe_vault.formed": "3 × 3 safe linked to you at %s, %s, %s.",
"message.anotherworld.safe_vault.formed": "Upright 3 × 3 safe linked to you at %s, %s, %s.",
"message.anotherworld.safe_vault.deposit_failed": "Could not deposit %s: none available or the safe is full.",
"message.anotherworld.safe_vault.withdraw_failed": "Could not withdraw %s: the balance is empty or inventory is full.",
"message.anotherworld.safe_vault.already_owned": "You already own an active safe.",
"message.anotherworld.safe_vault.break_not_owner": "Only the owner may dismantle this safe block.",
"message.anotherworld.safe_vault.empty_before_break": "Empty the safe and wait for drilling to end before dismantling it.",
@@ -1766,7 +1800,7 @@ tasks.named("sourcesJar") {
tasks.register("verifyAnotherWorldCatalog") {
group = "verification"
description = "Checks the Another World alpha.50 catalog, player vault and climate-aware biome mixer."
description = "Checks the Another World alpha.51 catalog, player vault and climate-aware biome mixer."
dependsOn tasks.named("generateAnotherWorldResources")
inputs.file(file("src/main/resources/data/anotherworld/sanctuary_biome_catalog.json"))
inputs.file(rootProject.file("sanctuary/src/main/resources/data/sanctuary/worldgen/noise_settings/sanctuary.json"))
@@ -1904,7 +1938,7 @@ tasks.register("verifyAnotherWorldCatalog") {
"src/main/resources/assets/redstoner/textures/item/weather_gauge.png",
"src/main/resources/data/redstoner/recipe/weather_gauge.json"
]
if (project.version.toString() != "0.0.0-alpha.50"
if (project.version.toString() != "0.0.0-alpha.52"
|| sulfurMigration.target?.modules?.anotherworld != "0.0.0-alpha.44"
|| sulfurMigration.sulfur_caves?.sanctuary?.dripstone_cell_period != 2
|| !javaText.contains('Identifier.parse("sanctuary:sulfur_caves")')
@@ -3221,7 +3255,7 @@ tasks.register("verifyClimateBiomeMixer") {
"pack/migrations/26.2.0-alpha.188-beta-climate-provinces-to-alpha.189.json"))
def mixer = file(
"src/main/java/fr/koka99cab/sanctuary26/anotherworld/mixin/MultiNoiseBiomeSourceParameterListPresetMixin.java").text
if (project.version.toString() != "0.0.0-alpha.50"
if (project.version.toString() != "0.0.0-alpha.52"
|| migration.source?.pack_version != "26.2.0-alpha.188"
|| migration.target?.pack_version != "26.2.0-alpha.189"
|| migration.target?.modules?.anotherworld != "0.0.0-alpha.48"
@@ -13,7 +13,7 @@ import org.slf4j.LoggerFactory;
public final class AnotherWorldMod implements ModInitializer {
public static final String MOD_ID = "anotherworld";
public static final String DISPLAY_NAME = "Another World";
public static final int CURRENT_DATA_VERSION = 2;
public static final int CURRENT_DATA_VERSION = 3;
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public AnotherWorldMod() {
@@ -7,6 +7,7 @@ import fr.koka99cab.sanctuary26.anotherworld.vault.VaultData;
import fr.koka99cab.sanctuary26.anotherworld.vault.VaultDrillingService;
import fr.koka99cab.sanctuary26.anotherworld.vault.VaultService;
import fr.koka99cab.sanctuary26.anotherworld.vault.VaultStructure;
import fr.koka99cab.sanctuary26.anotherworld.vault.VaultPart;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
@@ -29,15 +30,21 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.BlockHitResult;
public final class SafeVaultBlock extends BaseEntityBlock {
public static final MapCodec<SafeVaultBlock> CODEC = simpleCodec(SafeVaultBlock::new);
public static final EnumProperty<Direction> FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final BooleanProperty FORMED = BooleanProperty.create("formed");
public static final EnumProperty<VaultPart> PART = EnumProperty.create("part", VaultPart.class);
public SafeVaultBlock(Properties properties) {
super(properties);
registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH));
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.NORTH)
.setValue(FORMED, false)
.setValue(PART, VaultPart.CENTER));
}
@Override protected MapCodec<? extends BaseEntityBlock> codec() { return CODEC; }
@@ -53,7 +60,7 @@ public final class SafeVaultBlock extends BaseEntityBlock {
return rotate(state, mirror.getRotation(state.getValue(FACING)));
}
@Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
builder.add(FACING, FORMED, PART);
}
@Override
@@ -111,7 +118,7 @@ public final class SafeVaultBlock extends BaseEntityBlock {
@Override
protected void affectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos,
boolean movedByPiston) {
if (!movedByPiston) VaultData.get(level.getServer()).unregisterNear(level, pos);
if (!movedByPiston) VaultService.onSegmentRemoved(level, pos, state);
super.affectNeighborsAfterRemoval(state, level, pos, movedByPiston);
}
}
@@ -2,6 +2,7 @@ package fr.koka99cab.sanctuary26.anotherworld.block.entity;
import fr.koka99cab.sanctuary26.anotherworld.registry.AnotherWorldBlockEntities;
import fr.koka99cab.sanctuary26.anotherworld.vault.VaultData;
import fr.koka99cab.sanctuary26.anotherworld.vault.SafeVaultMenu;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.core.UUIDUtil;
@@ -11,7 +12,6 @@ import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ChestMenu;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.ValueInput;
@@ -54,7 +54,7 @@ public final class SafeVaultBlockEntity extends BlockEntity implements MenuProvi
@Override
public AbstractContainerMenu createMenu(int containerId, Inventory inventory, Player player) {
if (owner == null || !owner.equals(player.getUUID()) || !(level instanceof ServerLevel serverLevel)) return null;
return ChestMenu.threeRows(containerId, inventory,
VaultData.get(serverLevel.getServer()).container(owner, serverLevel, getBlockPos()));
return new SafeVaultMenu(containerId, inventory, VaultData.get(serverLevel.getServer()),
serverLevel, getBlockPos(), owner);
}
}
@@ -4,8 +4,10 @@ import fr.koka99cab.canon.client.CanonClient;
import fr.koka99cab.sanctuary26.anotherworld.client.render.MirrorBlockEntityRenderer;
import fr.koka99cab.sanctuary26.anotherworld.client.render.AnotherWorldBoatRendering;
import fr.koka99cab.sanctuary26.anotherworld.registry.AnotherWorldBlockEntities;
import fr.koka99cab.sanctuary26.anotherworld.registry.AnotherWorldMenus;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
import net.minecraft.client.gui.screens.MenuScreens;
public final class AnotherWorldClient implements ClientModInitializer {
@Override
@@ -14,5 +16,6 @@ public final class AnotherWorldClient implements ClientModInitializer {
MiroirClientSettings.load();
AnotherWorldBoatRendering.initialize();
BlockEntityRendererRegistry.register(AnotherWorldBlockEntities.MIRROR, MirrorBlockEntityRenderer::new);
MenuScreens.register(AnotherWorldMenus.SAFE_VAULT, SafeVaultScreen::new);
}
}
@@ -0,0 +1,66 @@
package fr.koka99cab.sanctuary26.anotherworld.client;
import fr.koka99cab.sanctuary26.anotherworld.vault.SafeVaultMenu;
import fr.koka99cab.sanctuary26.anotherworld.vault.VaultRules;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.ItemStack;
/** Three centered currency balances with explicit one/stack deposit and withdrawal controls. */
public final class SafeVaultScreen extends AbstractContainerScreen<SafeVaultMenu> {
private static final Identifier TEXTURE = Identifier.withDefaultNamespace(
"textures/gui/container/crafting_table.png");
private static final String[] LABELS = {" ×64", " ×1", "+ ×1", "+ ×64"};
private static final int[] BUTTON_X = {7, 43, 105, 135};
private static final int[] BUTTON_WIDTH = {34, 30, 28, 34};
private static final int SLOT_X = 79;
private static final int FIRST_ROW_Y = 17;
private static final int ROW_HEIGHT = 22;
public SafeVaultScreen(SafeVaultMenu menu, Inventory inventory, Component title) {
super(menu, inventory, title);
}
@Override
protected void init() {
super.init();
titleLabelX = (imageWidth - font.width(title)) / 2;
for (int currency = 0; currency < VaultRules.CURRENCY_SLOTS; currency++) {
int y = topPos + FIRST_ROW_Y + currency * ROW_HEIGHT;
for (int action = 0; action < VaultRules.BUTTONS_PER_CURRENCY; action++) {
int buttonId = SafeVaultMenu.buttonId(currency, action);
addRenderableWidget(Button.builder(Component.literal(LABELS[action]),
button -> sendTransfer(buttonId))
.bounds(leftPos + BUTTON_X[action], y, BUTTON_WIDTH[action], 20).build());
}
}
}
@Override
public void extractBackground(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float tickDelta) {
super.extractBackground(graphics, mouseX, mouseY, tickDelta);
graphics.blit(RenderPipelines.GUI_TEXTURED, TEXTURE, leftPos, topPos, 0.0F, 0.0F,
imageWidth, imageHeight, 256, 256);
graphics.fill(leftPos + 5, topPos + 15, leftPos + 171, topPos + 80, 0xFFC6C6C6);
for (int currency = 0; currency < VaultRules.CURRENCY_SLOTS; currency++) {
int x = leftPos + SLOT_X;
int y = topPos + FIRST_ROW_Y + currency * ROW_HEIGHT + 1;
graphics.outline(x, y, 18, 18, 0xFF373737);
graphics.fill(x + 1, y + 1, x + 17, y + 17, 0xFF8B8B8B);
graphics.item(new ItemStack(SafeVaultMenu.currency(currency)), x + 1, y + 1);
Component balance = Component.literal(Integer.toString(menu.balance(currency)));
graphics.text(font, balance, x + 17 - font.width(balance), y + 9, 0xFFFFFFFF, true);
}
}
private void sendTransfer(int buttonId) {
if (minecraft != null && minecraft.gameMode != null) {
minecraft.gameMode.handleInventoryButtonClick(menu.containerId, buttonId);
}
}
}
@@ -0,0 +1,23 @@
package fr.koka99cab.sanctuary26.anotherworld.registry;
import fr.koka99cab.sanctuary26.anotherworld.AnotherWorldMod;
import fr.koka99cab.sanctuary26.anotherworld.vault.SafeVaultMenu;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.inventory.MenuType;
public final class AnotherWorldMenus {
public static final MenuType<SafeVaultMenu> SAFE_VAULT = Registry.register(
BuiltInRegistries.MENU,
AnotherWorldMod.id("safe_vault"),
new MenuType<>(SafeVaultMenu::new, FeatureFlags.VANILLA_SET)
);
private AnotherWorldMenus() {
}
public static void initialize() {
AnotherWorldMod.LOGGER.debug("[{}] Safe-vault menu registered.", AnotherWorldMod.DISPLAY_NAME);
}
}
@@ -21,6 +21,7 @@ public final class AnotherWorldRegistries {
AnotherWorldEntities.initialize();
AnotherWorldItems.initialize();
AnotherWorldBlockEntities.initialize();
AnotherWorldMenus.initialize();
AnotherWorldCreativeTab.initialize();
AnotherWorldWorldGeneration.initialize();
AnotherWorldMod.LOGGER.info(
@@ -0,0 +1,195 @@
package fr.koka99cab.sanctuary26.anotherworld.vault;
import fr.koka99cab.sanctuary26.anotherworld.registry.AnotherWorldItems;
import fr.koka99cab.sanctuary26.anotherworld.registry.AnotherWorldMenus;
import fr.koka99cab.sanctuary26.sanctuary.api.inventory.SanctuaryPlayerInventoryView;
import java.util.List;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ContainerData;
import net.minecraft.world.inventory.SimpleContainerData;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
/** Server-authoritative three-currency vault controls backed by the existing saved account. */
public final class SafeVaultMenu extends AbstractContainerMenu {
private static final int PLAYER_INVENTORY_Y = 108;
private static final List<Item> CURRENCIES = List.of(
AnotherWorldItems.RUBY,
AnotherWorldItems.SAPPHIRE,
Items.EMERALD
);
private final ContainerData balances;
private final VaultData vaultData;
private final ServerLevel serverLevel;
private final UUID owner;
private final BlockPos center;
public SafeVaultMenu(int containerId, Inventory inventory) {
this(containerId, inventory, new SimpleContainerData(VaultRules.CURRENCY_SLOTS),
null, null, null, null);
}
public SafeVaultMenu(int containerId, Inventory inventory, VaultData data,
ServerLevel level, BlockPos center, UUID owner) {
this(containerId, inventory, new VaultBalanceData(data, owner), data, level,
center.immutable(), owner);
}
private SafeVaultMenu(int containerId, Inventory inventory, ContainerData balances,
VaultData vaultData, ServerLevel serverLevel, BlockPos center, UUID owner) {
super(AnotherWorldMenus.SAFE_VAULT, containerId);
checkContainerDataCount(balances, VaultRules.CURRENCY_SLOTS);
this.balances = balances;
this.vaultData = vaultData;
this.serverLevel = serverLevel;
this.center = center;
this.owner = owner;
// Leave all three currency rows visible above Sanctuary's extended inventory panel.
addStandardInventorySlots(inventory, 8, PLAYER_INVENTORY_Y);
addDataSlots(balances);
}
public int balance(int currency) {
return currency >= 0 && currency < VaultRules.CURRENCY_SLOTS ? balances.get(currency) : 0;
}
public static Item currency(int currency) {
return CURRENCIES.get(Math.clamp(currency, 0, CURRENCIES.size() - 1));
}
public static int buttonId(int currency, int action) {
return currency * VaultRules.BUTTONS_PER_CURRENCY + action;
}
@Override
public boolean clickMenuButton(Player player, int buttonId) {
if (!(player instanceof ServerPlayer serverPlayer) || vaultData == null || !stillValid(player)) return false;
int currencyIndex = VaultRules.buttonCurrency(buttonId);
int amount = VaultRules.buttonAmount(buttonId);
if (currencyIndex < 0 || amount <= 0) return false;
Item item = currency(currencyIndex);
int moved = VaultRules.buttonDeposits(buttonId)
? deposit(serverPlayer, item, amount)
: withdraw(serverPlayer, item, amount);
if (moved <= 0) {
serverPlayer.sendOverlayMessage(Component.translatable(
VaultRules.buttonDeposits(buttonId)
? "message.anotherworld.safe_vault.deposit_failed"
: "message.anotherworld.safe_vault.withdraw_failed",
new ItemStack(item).getHoverName()));
}
broadcastChanges();
return true;
}
@Override
public ItemStack quickMoveStack(Player player, int index) {
return ItemStack.EMPTY;
}
@Override
public boolean stillValid(Player player) {
if (serverLevel == null || vaultData == null || center == null || owner == null) return true;
if (!player.getUUID().equals(owner)
|| player.distanceToSqr(center.getX() + 0.5D, center.getY() + 0.5D, center.getZ() + 0.5D) > 64.0D) {
return false;
}
return vaultData.isRegistered(serverLevel, center, owner)
&& VaultStructure.find(serverLevel, center)
.filter(formed -> formed.center().equals(center) && formed.owner().equals(owner)).isPresent();
}
private int deposit(ServerPlayer player, Item item, int requested) {
int available = countPlayerItem(player, item);
int amount = Math.min(requested, Math.min(available, vaultData.capacity(owner, item)));
if (amount <= 0) return 0;
int removed = removePlayerItem(player, item, amount);
int stored = vaultData.add(owner, item, removed);
if (stored < removed) insertPlayerItem(player, item, removed - stored);
return stored;
}
private int withdraw(ServerPlayer player, Item item, int requested) {
int amount = Math.min(requested,
Math.min(vaultData.count(owner, item), playerCapacity(player, item)));
if (amount <= 0) return 0;
int removed = vaultData.remove(owner, item, amount);
int inserted = insertPlayerItem(player, item, removed);
if (inserted < removed) vaultData.add(owner, item, removed - inserted);
return inserted;
}
private static int countPlayerItem(ServerPlayer player, Item item) {
long count = 0L;
for (var slot : SanctuaryPlayerInventoryView.unlockedRows(player)) {
if (slot.stack().is(item)) count += slot.stack().getCount();
}
return (int) Math.min(Integer.MAX_VALUE, count);
}
private static int removePlayerItem(ServerPlayer player, Item item, int amount) {
int remaining = amount;
for (var slot : SanctuaryPlayerInventoryView.unlockedRows(player)) {
if (remaining <= 0) break;
ItemStack stack = slot.stack();
if (!stack.is(item)) continue;
int removed = Math.min(remaining, stack.getCount());
slot.remove(removed);
remaining -= removed;
}
return amount - remaining;
}
private static int playerCapacity(ServerPlayer player, Item item) {
long capacity = 0L;
for (var slot : SanctuaryPlayerInventoryView.unlockedRows(player)) {
ItemStack stack = slot.stack();
if (stack.isEmpty()) capacity += item.getDefaultMaxStackSize();
else if (stack.is(item)) capacity += Math.max(0, stack.getMaxStackSize() - stack.getCount());
}
return (int) Math.min(Integer.MAX_VALUE, capacity);
}
private static int insertPlayerItem(ServerPlayer player, Item item, int amount) {
int remaining = amount;
var slots = SanctuaryPlayerInventoryView.unlockedRows(player);
for (var slot : slots) {
if (remaining <= 0) break;
ItemStack stack = slot.stack();
if (!stack.is(item) || stack.getCount() >= stack.getMaxStackSize()) continue;
int inserted = Math.min(remaining, stack.getMaxStackSize() - stack.getCount());
stack.grow(inserted);
slot.markChanged();
remaining -= inserted;
}
for (var slot : slots) {
if (remaining <= 0) break;
if (!slot.stack().isEmpty()) continue;
int inserted = Math.min(remaining, item.getDefaultMaxStackSize());
slot.container().setItem(slot.slot(), new ItemStack(item, inserted));
slot.markChanged();
remaining -= inserted;
}
return amount - remaining;
}
private record VaultBalanceData(VaultData data, UUID owner) implements ContainerData {
@Override public int get(int index) {
return index >= 0 && index < CURRENCIES.size() ? data.count(owner, CURRENCIES.get(index)) : 0;
}
@Override public void set(int index, int value) {
}
@Override public int getCount() {
return VaultRules.CURRENCY_SLOTS;
}
}
}
@@ -26,7 +26,7 @@ import net.minecraft.world.level.saveddata.SavedDataType;
/** Global player-linked vault inventory, available to the Shop even when its structure is unloaded. */
public final class VaultData extends SavedData {
public static final String SAVE_KEY = "safe_vaults";
public static final int DATA_VERSION = 1;
public static final int DATA_VERSION = 2;
private static final Identifier RUBY = Identifier.fromNamespaceAndPath("anotherworld", "ruby");
private static final Identifier SAPPHIRE = Identifier.fromNamespaceAndPath("anotherworld", "sapphire");
private static final Identifier EMERALD = Identifier.withDefaultNamespace("emerald");
@@ -116,7 +116,8 @@ public final class VaultData extends SavedData {
boolean changed = vaults.removeIf(address -> {
if (!address.dimension().equals(dimension)) return false;
BlockPos center = BlockPos.of(address.pos());
return center.getY() == member.getY() && Math.abs(center.getX() - member.getX()) <= 1
return Math.abs(center.getX() - member.getX()) <= 1
&& Math.abs(center.getY() - member.getY()) <= 1
&& Math.abs(center.getZ() - member.getZ()) <= 1;
});
if (changed) setDirty();
@@ -152,6 +153,37 @@ public final class VaultData extends SavedData {
return amount - remaining;
}
public int capacity(UUID owner, Item item) {
if (!isCurrency(item)) return 0;
long capacity = 0L;
for (ItemStack stack : items(owner)) {
if (stack.isEmpty()) capacity += item.getDefaultMaxStackSize();
else if (stack.is(item)) capacity += Math.max(0, stack.getMaxStackSize() - stack.getCount());
}
return (int) Math.min(Integer.MAX_VALUE, capacity);
}
public int add(UUID owner, Item item, int amount) {
if (!isCurrency(item) || amount <= 0) return 0;
NonNullList<ItemStack> stored = items(owner);
int remaining = amount;
for (ItemStack stack : stored) {
if (remaining <= 0) break;
if (!stack.is(item) || stack.getCount() >= stack.getMaxStackSize()) continue;
int inserted = Math.min(remaining, stack.getMaxStackSize() - stack.getCount());
stack.grow(inserted);
remaining -= inserted;
}
for (int slot = 0; slot < stored.size() && remaining > 0; slot++) {
if (!stored.get(slot).isEmpty()) continue;
int inserted = Math.min(remaining, item.getDefaultMaxStackSize());
stored.set(slot, new ItemStack(item, inserted));
remaining -= inserted;
}
if (remaining != amount) setDirty();
return amount - remaining;
}
public boolean hasContents(UUID owner) {
Account account = accounts.get(owner);
return account != null && account.items.stream().anyMatch(stack -> !stack.isEmpty());
@@ -0,0 +1,46 @@
package fr.koka99cab.sanctuary26.anotherworld.vault;
import net.minecraft.util.StringRepresentable;
/** Stable position of one segment in the front-facing 3x3 vault wall. */
public enum VaultPart implements StringRepresentable {
BOTTOM_LEFT("bottom_left", 0, 0),
BOTTOM_CENTER("bottom_center", 1, 0),
BOTTOM_RIGHT("bottom_right", 2, 0),
MIDDLE_LEFT("middle_left", 0, 1),
CENTER("center", 1, 1),
MIDDLE_RIGHT("middle_right", 2, 1),
TOP_LEFT("top_left", 0, 2),
TOP_CENTER("top_center", 1, 2),
TOP_RIGHT("top_right", 2, 2);
private final String serializedName;
private final int column;
private final int row;
VaultPart(String serializedName, int column, int row) {
this.serializedName = serializedName;
this.column = column;
this.row = row;
}
public int column() {
return column;
}
public int row() {
return row;
}
public static VaultPart at(int column, int row) {
for (VaultPart part : values()) {
if (part.column == column && part.row == row) return part;
}
throw new IllegalArgumentException("Invalid vault part: " + column + ", " + row);
}
@Override
public String getSerializedName() {
return serializedName;
}
}
@@ -5,7 +5,10 @@ public final class VaultRules {
public static final int STRUCTURE_WIDTH = 3;
public static final int STRUCTURE_RADIUS = 1;
public static final int STRUCTURE_BLOCKS = STRUCTURE_WIDTH * STRUCTURE_WIDTH;
public static final int COMPLETE_STRUCTURE_MASK = (1 << STRUCTURE_BLOCKS) - 1;
public static final int STORAGE_SLOTS = 27;
public static final int CURRENCY_SLOTS = 3;
public static final int BUTTONS_PER_CURRENCY = 4;
public static final int RAID_DURATION_TICKS = 60 * 20;
public static final int RAID_LOOT_PERCENT = 20;
public static final long RAID_PROTECTION_TICKS = 24L * 60L * 60L * 20L;
@@ -22,4 +25,29 @@ public final class VaultRules {
public static int progressPercent(int elapsedTicks) {
return Math.clamp((int) ((long) Math.max(0, elapsedTicks) * 100L / RAID_DURATION_TICKS), 0, 100);
}
public static boolean isCompleteStructureMask(int partMask) {
return partMask == COMPLETE_STRUCTURE_MASK;
}
public static int buttonCurrency(int buttonId) {
return validButton(buttonId) ? buttonId / BUTTONS_PER_CURRENCY : -1;
}
public static int buttonAmount(int buttonId) {
if (!validButton(buttonId)) return 0;
return switch (buttonId % BUTTONS_PER_CURRENCY) {
case 0, 3 -> 64;
case 1, 2 -> 1;
default -> 0;
};
}
public static boolean buttonDeposits(int buttonId) {
return validButton(buttonId) && buttonId % BUTTONS_PER_CURRENCY >= 2;
}
private static boolean validButton(int buttonId) {
return buttonId >= 0 && buttonId < CURRENCY_SLOTS * BUTTONS_PER_CURRENCY;
}
}
@@ -11,6 +11,8 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.permissions.Permissions;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
/** Owns vault lifecycle, break protection and Sanctuary currency-storage integration. */
public final class VaultService {
@@ -50,18 +52,37 @@ public final class VaultService {
}
public static void onSegmentPlaced(ServerLevel level, net.minecraft.core.BlockPos pos, ServerPlayer player) {
VaultStructure.find(level, pos).ifPresent(formed -> {
var facing = level.getBlockState(pos).getValue(SafeVaultBlock.FACING);
formed.members().forEach(member -> level.setBlock(member,
level.getBlockState(member).setValue(SafeVaultBlock.FACING, facing),
net.minecraft.world.level.block.Block.UPDATE_CLIENTS));
tryRegister(level, formed, player);
});
VaultStructure.find(level, pos).ifPresent(formed -> tryRegister(level, formed, player));
}
public static void onSegmentRemoved(ServerLevel level, net.minecraft.core.BlockPos pos, BlockState state) {
VaultData.get(level.getServer()).unregisterNear(level, pos);
if (!state.getValue(SafeVaultBlock.FORMED)) return;
net.minecraft.core.BlockPos center = VaultStructure.centerFor(pos, state);
var facing = state.getValue(SafeVaultBlock.FACING);
var width = facing.getClockWise();
for (int column = 0; column < VaultRules.STRUCTURE_WIDTH; column++) {
for (int row = 0; row < VaultRules.STRUCTURE_WIDTH; row++) {
var member = center.relative(width, column - VaultRules.STRUCTURE_RADIUS)
.above(row - VaultRules.STRUCTURE_RADIUS);
BlockState memberState = level.getBlockState(member);
if (!memberState.is(AnotherWorldBlocks.SAFE_BLOCK)) continue;
level.setBlock(member, memberState
.setValue(SafeVaultBlock.FORMED, false)
.setValue(SafeVaultBlock.PART, VaultPart.CENTER), Block.UPDATE_CLIENTS);
}
}
}
public static boolean tryRegister(ServerLevel level, VaultStructure.Formed formed, ServerPlayer player) {
VaultData data = VaultData.get(level.getServer());
if (data.register(level, formed.center(), formed.owner())) {
formed.members().forEach(member -> level.setBlock(member,
level.getBlockState(member)
.setValue(SafeVaultBlock.FACING, formed.facing())
.setValue(SafeVaultBlock.FORMED, true)
.setValue(SafeVaultBlock.PART, formed.part(member)),
Block.UPDATE_CLIENTS));
if (player != null) player.sendSystemMessage(Component.translatable(
"message.anotherworld.safe_vault.formed",
formed.center().getX(), formed.center().getY(), formed.center().getZ()));
@@ -1,61 +1,92 @@
package fr.koka99cab.sanctuary26.anotherworld.vault;
import fr.koka99cab.sanctuary26.anotherworld.block.entity.SafeVaultBlockEntity;
import fr.koka99cab.sanctuary26.anotherworld.block.SafeVaultBlock;
import fr.koka99cab.sanctuary26.anotherworld.registry.AnotherWorldBlocks;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.Level;
/** Detects one isolated horizontal 3x3 platform owned by a single player. */
/** Detects one isolated, upright 3x3 vault wall owned by a single player. */
public final class VaultStructure {
private VaultStructure() {
}
public static Optional<Formed> find(Level level, BlockPos member) {
if (level == null || member == null) return Optional.empty();
for (int offsetX = -VaultRules.STRUCTURE_RADIUS; offsetX <= VaultRules.STRUCTURE_RADIUS; offsetX++) {
for (int offsetZ = -VaultRules.STRUCTURE_RADIUS; offsetZ <= VaultRules.STRUCTURE_RADIUS; offsetZ++) {
BlockPos center = member.offset(-offsetX, 0, -offsetZ);
Formed formed = validate(level, center);
if (formed != null && formed.contains(member)) return Optional.of(formed);
if (level == null || member == null || !level.getBlockState(member).is(AnotherWorldBlocks.SAFE_BLOCK)) {
return Optional.empty();
}
Direction preferred = level.getBlockState(member).getValue(SafeVaultBlock.FACING);
for (Direction facing : List.of(preferred, preferred.getOpposite(),
preferred.getClockWise(), preferred.getCounterClockWise())) {
Direction width = facing.getClockWise();
for (int offsetWidth = -VaultRules.STRUCTURE_RADIUS;
offsetWidth <= VaultRules.STRUCTURE_RADIUS; offsetWidth++) {
for (int offsetY = -VaultRules.STRUCTURE_RADIUS;
offsetY <= VaultRules.STRUCTURE_RADIUS; offsetY++) {
BlockPos center = member.relative(width, -offsetWidth).below(offsetY);
Formed formed = validate(level, center, facing);
if (formed != null && formed.contains(member)) return Optional.of(formed);
}
}
}
return Optional.empty();
}
private static Formed validate(Level level, BlockPos center) {
private static Formed validate(Level level, BlockPos center, Direction facing) {
UUID owner = null;
List<BlockPos> members = new ArrayList<>(VaultRules.STRUCTURE_BLOCKS);
for (int x = -VaultRules.STRUCTURE_RADIUS; x <= VaultRules.STRUCTURE_RADIUS; x++) {
for (int z = -VaultRules.STRUCTURE_RADIUS; z <= VaultRules.STRUCTURE_RADIUS; z++) {
BlockPos pos = center.offset(x, 0, z);
int partMask = 0;
Direction width = facing.getClockWise();
for (int column = 0; column < VaultRules.STRUCTURE_WIDTH; column++) {
for (int row = 0; row < VaultRules.STRUCTURE_WIDTH; row++) {
BlockPos pos = center.relative(width, column - VaultRules.STRUCTURE_RADIUS)
.above(row - VaultRules.STRUCTURE_RADIUS);
if (!level.getBlockState(pos).is(AnotherWorldBlocks.SAFE_BLOCK)
|| !(level.getBlockEntity(pos) instanceof SafeVaultBlockEntity blockEntity)
|| blockEntity.owner() == null) return null;
if (owner == null) owner = blockEntity.owner();
else if (!owner.equals(blockEntity.owner())) return null;
members.add(pos.immutable());
partMask |= 1 << (row * VaultRules.STRUCTURE_WIDTH + column);
}
}
if (!VaultRules.isCompleteStructureMask(partMask)) return null;
// Reject ambiguous 3x4/4x3 carpets: a vault is one discrete 3x3 structure.
for (int x = -2; x <= 2; x++) {
for (int z = -2; z <= 2; z++) {
if (Math.abs(x) <= 1 && Math.abs(z) <= 1) continue;
if (level.getBlockState(center.offset(x, 0, z)).is(AnotherWorldBlocks.SAFE_BLOCK)) return null;
// Reject ambiguous 3x4/4x3 walls: a vault is one discrete upright 3x3 structure.
for (int widthOffset = -2; widthOffset <= 2; widthOffset++) {
for (int yOffset = -2; yOffset <= 2; yOffset++) {
if (Math.abs(widthOffset) <= 1 && Math.abs(yOffset) <= 1) continue;
if (level.getBlockState(center.relative(width, widthOffset).above(yOffset))
.is(AnotherWorldBlocks.SAFE_BLOCK)) return null;
}
}
return new Formed(center.immutable(), owner, List.copyOf(members));
return new Formed(center.immutable(), owner, List.copyOf(members), facing);
}
public record Formed(BlockPos center, UUID owner, List<BlockPos> members) {
public static BlockPos centerFor(BlockPos member, BlockState state) {
VaultPart part = state.getValue(SafeVaultBlock.PART);
Direction width = state.getValue(SafeVaultBlock.FACING).getClockWise();
return member.relative(width, VaultRules.STRUCTURE_RADIUS - part.column())
.below(part.row() - VaultRules.STRUCTURE_RADIUS).immutable();
}
public record Formed(BlockPos center, UUID owner, List<BlockPos> members, Direction facing) {
public boolean contains(BlockPos pos) {
return pos != null && pos.getY() == center.getY()
&& Math.abs(pos.getX() - center.getX()) <= VaultRules.STRUCTURE_RADIUS
&& Math.abs(pos.getZ() - center.getZ()) <= VaultRules.STRUCTURE_RADIUS;
return pos != null && members.contains(pos);
}
public VaultPart part(BlockPos pos) {
Direction width = facing.getClockWise();
int column = (pos.getX() - center.getX()) * width.getStepX()
+ (pos.getZ() - center.getZ()) * width.getStepZ() + VaultRules.STRUCTURE_RADIUS;
int row = pos.getY() - center.getY() + VaultRules.STRUCTURE_RADIUS;
return VaultPart.at(column, row);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

@@ -37,7 +37,7 @@
"sanctuary26": {
"system_type": "gameplay-system",
"namespace": "anotherworld",
"data_version": 2,
"data_version": 3,
"network_protocol": 1,
"lifecycle": "${lifecycle}",
"pack_version": "${pack_version}",
@@ -6,8 +6,27 @@ public final class VaultRulesSmoke {
public static void main(String[] args) {
require(VaultRules.STRUCTURE_WIDTH == 3, "vault width");
require(VaultRules.STRUCTURE_BLOCKS == 9, "vault footprint");
require(VaultRules.STRUCTURE_BLOCKS == 9, "upright vault wall");
require(!VaultRules.isCompleteStructureMask(0b000_000_111),
"horizontal 3x1 must stay unformed");
require(!VaultRules.isCompleteStructureMask(0b001_001_001),
"vertical 3x1 must stay unformed");
require(VaultRules.isCompleteStructureMask(0b111_111_111),
"only all nine parts form the vault");
require(VaultRules.STORAGE_SLOTS == 27, "vault capacity");
require(VaultRules.CURRENCY_SLOTS == 3, "currency controls");
require(VaultPart.at(0, 0) == VaultPart.BOTTOM_LEFT, "bottom-left CTM part");
require(VaultPart.at(1, 1) == VaultPart.CENTER, "center CTM part");
require(VaultPart.at(2, 2) == VaultPart.TOP_RIGHT, "top-right CTM part");
require(VaultRules.buttonCurrency(0) == 0 && VaultRules.buttonCurrency(11) == 2,
"button currency routing");
require(VaultRules.buttonAmount(0) == 64 && VaultRules.buttonAmount(1) == 1
&& VaultRules.buttonAmount(2) == 1 && VaultRules.buttonAmount(3) == 64,
"button transfer amounts");
require(!VaultRules.buttonDeposits(1) && VaultRules.buttonDeposits(2),
"button transfer directions");
require(VaultRules.buttonCurrency(12) == -1 && VaultRules.buttonAmount(-1) == 0,
"invalid button rejection");
require(VaultRules.RAID_DURATION_TICKS == 1_200, "raid duration");
require(VaultRules.RAID_PROTECTION_TICKS == 1_728_000L, "raid protection");
require(VaultRules.raidLoot(0) == 0, "empty loot");
+247 -54
View File
@@ -329,7 +329,7 @@ tasks.register("verifyWorkspace") {
}
def progressionJeiMigration = new JsonSlurper().parse(file(
"pack/migrations/26.2.0-alpha.87-progression-jei-audio-to-alpha.88.json"))
def jeiFiles = prismIndex.files.findAll { it.path == "mods/jei-26.2-fabric-30.26.0.186.jar" }
def jeiFiles = prismIndex.files.findAll { it.path == "mods/jei-26.2-fabric-30.27.0.187.jar" }
if (progressionJeiMigration.source?.pack_version != "26.2.0-alpha.87"
|| progressionJeiMigration.target?.pack_version != "26.2.0-alpha.88"
|| progressionJeiMigration.target?.modules?.sanctuary != "0.0.0-alpha.38"
@@ -344,8 +344,8 @@ tasks.register("verifyWorkspace") {
|| progressionJeiMigration.compatibility?.network_protocol != 10
|| progressionJeiMigration.compatibility?.network_protocol_changed != true
|| jeiFiles.size() != 1
|| jeiFiles[0].hashes?.sha1 != "950efcf2d63a3a0560eae81223479577ad1a78cd"
|| jeiFiles[0].hashes?.sha512 != "6d8aaad5066d607e460db6f83cba28807129104b46c580b5ba3372d7b7cef84e28ade393c0a3d6bbb38191bcac053af691d0f58d8075f211c687c7b56c74337c"
|| jeiFiles[0].hashes?.sha1 != "cbd62af1f8e568cbe29c7892ae1b2917c0784a44"
|| jeiFiles[0].hashes?.sha512 != "f8bf88c089c7fe3d56031d7629170ba01eb1d0c5cc4d33f2fd0ac9413369cdef84a0fde999528621426d3dca878c9cfaf7a790622e2cd1d54802e1086fb073f0"
|| jeiFiles[0].env?.client != "required" || jeiFiles[0].env?.server != "required") {
throw new GradleException("The alpha.88 progression, JEI and Minecrafter audio contract is incomplete")
}
@@ -1815,7 +1815,7 @@ tasks.register("verifyWorkspace") {
|| terramixMigration.compatibility?.new_registry_ids != 100
|| terramixMigration.compatibility?.worldgen_changed != true
|| terramixMigration.compatibility?.save_migration_required != false
|| anotherWorldManifest?.custom?.sanctuary26?.data_version != 2
|| anotherWorldManifest?.custom?.sanctuary26?.data_version != 3
|| anotherWorldManifest?.custom?.sanctuary26?.network_protocol != 1
|| sanctuaryManifest?.custom?.sanctuary26?.data_version < 9
) {
@@ -3427,7 +3427,7 @@ tasks.register("verifyProgressivePauseMenuRelease") {
[(locale): new JsonSlurper().parse(file(
"sanctuary/src/main/resources/assets/sanctuary/lang/${locale}.json"))]
}
if (rootProject.pack_version != "26.2.0-alpha.201"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| rootProject.onlyfun_version != "0.0.0-alpha.19"
|| release.pack_version != rootProject.pack_version || index.versionId != rootProject.pack_version
@@ -3477,8 +3477,8 @@ tasks.register("verifyMirrorLavenderDrawerRelease") {
def redStonerRegistry = file(
"redstoner/src/main/java/fr/koka99cab/sanctuary26/redstoner/registry/RedStonerRegistries.java").text
def drawerRecipe = file("redstoner/src/main/resources/data/redstoner/recipe/drawer.json")
if (rootProject.pack_version != "26.2.0-alpha.201"
|| rootProject.anotherworld_version != "0.0.0-alpha.50"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.anotherworld_version != "0.0.0-alpha.52"
|| rootProject.redstoner_version != "0.0.0-alpha.10"
|| release.pack_version != rootProject.pack_version || index.versionId != rootProject.pack_version
|| migration.source?.pack_version != "26.2.0-alpha.191"
@@ -4123,7 +4123,7 @@ tasks.register("verifyShopPricingLayoutRelease") {
"pack/migrations/26.2.0-alpha.192-shop-pricing-layout-to-alpha.193.json"))
def release = new JsonSlurper().parse(file("pack/release.json"))
def index = new JsonSlurper().parse(file("pack/prism/modrinth.index.json"))
if (rootProject.pack_version != "26.2.0-alpha.201"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.onlyfun_version != "0.0.0-alpha.19"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| release.pack_version != rootProject.pack_version || index.versionId != rootProject.pack_version
@@ -4168,8 +4168,8 @@ tasks.register("verifyCuisineCropsRelease") {
def climate = file("itsalive/src/main/java/fr/koka99cab/sanctuary26/itsalive/agriculture/ClimateCropForaging.java").text
def rice = file("itsalive/src/main/java/fr/koka99cab/sanctuary26/itsalive/agriculture/RiceCropBlock.java").text
def bean = file("itsalive/src/main/java/fr/koka99cab/sanctuary26/itsalive/agriculture/BeanCropBlock.java").text
if (rootProject.pack_version != "26.2.0-alpha.201"
|| rootProject.itsalive_version != "0.0.0-alpha.30"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.itsalive_version != "0.0.0-alpha.31"
|| release.pack_version != rootProject.pack_version || index.versionId != rootProject.pack_version
|| migration.source?.pack_version != "26.2.0-alpha.193"
|| migration.source?.modules != [itsalive: "0.0.0-alpha.26"]
@@ -4217,7 +4217,7 @@ tasks.register("verifyShopCsvBossGatesRelease") {
def bossGate = file("onlyfun/src/main/java/fr/koka99cab/sanctuary26/onlyfun/shop/OnlyFunBossShopGate.java").text
def catalog = file("onlyfun/src/main/java/fr/koka99cab/sanctuary26/onlyfun/shop/OnlyFunShopCatalog.java").text
def offerCatalog = file("sanctuary/src/main/java/fr/koka99cab/sanctuary26/sanctuary/shop/ShopOfferCatalog.java").text
if (rootProject.pack_version != "26.2.0-alpha.201"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.onlyfun_version != "0.0.0-alpha.19"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| release.pack_version != rootProject.pack_version || index.versionId != rootProject.pack_version
@@ -4263,7 +4263,7 @@ tasks.register("verifyCulinaryMailboxGrappleFixesRelease") {
def release = new JsonSlurper().parse(file("pack/release.json"))
def prism = new JsonSlurper().parse(file("pack/prism/modrinth.index.json"))
def packwiz = file("pack/packwiz/pack.toml").text
if (rootProject.pack_version != "26.2.0-alpha.201"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| migration.source?.pack_version != "26.2.0-alpha.195"
|| migration.target?.pack_version != "26.2.0-alpha.196"
|| migration.target?.modules != [
@@ -4281,10 +4281,10 @@ tasks.register("verifyCulinaryMailboxGrappleFixesRelease") {
|| migration.distribution?.jei?.target != "30.26.0.182"
|| migration.compatibility?.save_migration_required != false
|| migration.compatibility?.registry_ids_changed != false
|| release.pack_version != "26.2.0-alpha.201"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.201.mrpack"
|| prism.versionId != "26.2.0-alpha.201"
|| !packwiz.contains('version = "26.2.0-alpha.201"')) {
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')) {
throw new GradleException("The alpha.196 culinary, mailbox and grapple release contract is incomplete")
}
}
@@ -4309,8 +4309,8 @@ tasks.register("verifyQuestRequestsCauldronBatchesRelease") {
def prism = new JsonSlurper().parse(file("pack/prism/modrinth.index.json"))
def packwiz = file("pack/packwiz/pack.toml").text
def sanctuaryManifest = new JsonSlurper().parse(file("sanctuary/src/main/resources/fabric.mod.json"))
if (rootProject.pack_version != "26.2.0-alpha.201"
|| rootProject.itsalive_version != "0.0.0-alpha.30"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.itsalive_version != "0.0.0-alpha.31"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| migration.source?.pack_version != "26.2.0-alpha.196"
|| migration.target?.pack_version != "26.2.0-alpha.197"
@@ -4329,10 +4329,10 @@ tasks.register("verifyQuestRequestsCauldronBatchesRelease") {
|| migration.distribution?.jei?.target != "30.26.0.186"
|| migration.compatibility?.sanctuary_target_network_protocol != 19
|| sanctuaryManifest.custom?.sanctuary26?.network_protocol != 21
|| release.pack_version != "26.2.0-alpha.201"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.201.mrpack"
|| prism.versionId != "26.2.0-alpha.201"
|| !packwiz.contains('version = "26.2.0-alpha.201"')) {
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')) {
throw new GradleException("The alpha.197 quest-request and cauldron-batch release contract is incomplete")
}
}
@@ -4359,8 +4359,8 @@ tasks.register("verifyFermentationBarrelAutomationRelease") {
def packwiz = file("pack/packwiz/pack.toml").text
def packwizIndex = file("pack/packwiz/index.toml").text
def itsAliveManifest = new JsonSlurper().parse(file("itsalive/src/main/resources/fabric.mod.json"))
if (rootProject.pack_version != "26.2.0-alpha.201"
|| rootProject.itsalive_version != "0.0.0-alpha.30"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.itsalive_version != "0.0.0-alpha.31"
|| migration.source?.pack_version != "26.2.0-alpha.197"
|| migration.target?.pack_version != "26.2.0-alpha.198"
|| migration.target?.modules != [itsalive: "0.0.0-alpha.30", sanctuary: "0.0.0-alpha.114"]
@@ -4378,11 +4378,11 @@ tasks.register("verifyFermentationBarrelAutomationRelease") {
|| migration.distribution?.packwiz_index_refreshed != true
|| itsAliveManifest.custom?.sanctuary26?.data_version != 1
|| itsAliveManifest.custom?.sanctuary26?.network_protocol != 3
|| release.pack_version != "26.2.0-alpha.201"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.201.mrpack"
|| prism.versionId != "26.2.0-alpha.201"
|| !packwiz.contains('version = "26.2.0-alpha.201"')
|| !packwizIndex.contains('file = "mods/itsalive-0.0.0-alpha.30.jar"')) {
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')
|| !packwizIndex.contains('file = "mods/itsalive-0.0.0-alpha.31.jar"')) {
throw new GradleException("The alpha.198 fermentation barrel release contract is incomplete")
}
}
@@ -4409,8 +4409,8 @@ tasks.register("verifyQuestRequestContractsRelease") {
def packwiz = file("pack/packwiz/pack.toml").text
def packwizIndex = file("pack/packwiz/index.toml").text
def sanctuaryManifest = new JsonSlurper().parse(file("sanctuary/src/main/resources/fabric.mod.json"))
if (rootProject.pack_version != "26.2.0-alpha.201"
|| rootProject.itsalive_version != "0.0.0-alpha.30"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.itsalive_version != "0.0.0-alpha.31"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| migration.source?.pack_version != "26.2.0-alpha.198"
|| migration.source?.modules?.sanctuary != "0.0.0-alpha.114"
@@ -4423,12 +4423,12 @@ tasks.register("verifyQuestRequestContractsRelease") {
|| migration.quest_request_contracts?.chat_accept_revalidates_distance_owner_sign_and_claim != true
|| migration.compatibility?.sanctuary_target_network_protocol != 20
|| sanctuaryManifest.custom?.sanctuary26?.network_protocol != 21
|| release.pack_version != "26.2.0-alpha.201"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.201.mrpack"
|| prism.versionId != "26.2.0-alpha.201"
|| !packwiz.contains('version = "26.2.0-alpha.201"')
|| !packwizIndex.contains('file = "mods/itsalive-0.0.0-alpha.30.jar"')
|| !packwizIndex.contains('file = "mods/sanctuary-0.0.0-alpha.116.jar"')) {
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')
|| !packwizIndex.contains('file = "mods/itsalive-0.0.0-alpha.31.jar"')
|| !packwizIndex.contains('file = "mods/sanctuary-0.0.0-alpha.117.jar"')) {
throw new GradleException("The alpha.199 quest-request contract release is incomplete")
}
}
@@ -4464,7 +4464,7 @@ tasks.register("verifyWeatherTntAmbianceRelease") {
def ambianceManifest = new JsonSlurper().parse(file("ambiance/src/main/resources/fabric.mod.json"))
def ouchManifest = new JsonSlurper().parse(file("ouch/src/main/resources/fabric.mod.json"))
def rootBuild = file("build.gradle").text
if (rootProject.pack_version != "26.2.0-alpha.201"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.ambiance_version != "0.0.0-alpha.12"
|| rootProject.ouch_version != "0.0.0-alpha.9"
|| migration.source?.pack_version != "26.2.0-alpha.199"
@@ -4498,10 +4498,10 @@ tasks.register("verifyWeatherTntAmbianceRelease") {
|| !weatherTnt.contains("AmbianceDailyWeather.CLEAR")
|| !weatherTnt.contains("CLEAR_WEATHER_TICKS = 864_000")
|| weatherTnt.contains("setWeatherParameters")
|| release.pack_version != "26.2.0-alpha.201"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.201.mrpack"
|| prism.versionId != "26.2.0-alpha.201"
|| !packwiz.contains('version = "26.2.0-alpha.201"')
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')
|| !packwizIndex.contains('file = "mods/ambiance-0.0.0-alpha.12.jar"')
|| !packwizIndex.contains('file = "mods/ouch-0.0.0-alpha.9.jar"')) {
throw new GradleException("The alpha.200 Weather TNT and Ambiance release is incomplete")
@@ -4530,7 +4530,7 @@ tasks.register("verifyQuestRequestEscrowRelease") {
def packwiz = file("pack/packwiz/pack.toml").text
def packwizIndex = file("pack/packwiz/index.toml").text
def sanctuaryManifest = new JsonSlurper().parse(file("sanctuary/src/main/resources/fabric.mod.json"))
if (rootProject.pack_version != "26.2.0-alpha.201"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| migration.source?.pack_version != "26.2.0-alpha.200"
|| migration.source?.modules?.sanctuary != "0.0.0-alpha.115"
@@ -4545,11 +4545,11 @@ tasks.register("verifyQuestRequestEscrowRelease") {
|| migration.compatibility?.sanctuary_target_network_protocol != 21
|| sanctuaryManifest.custom?.sanctuary26?.data_version != 11
|| sanctuaryManifest.custom?.sanctuary26?.network_protocol != 21
|| release.pack_version != "26.2.0-alpha.201"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.201.mrpack"
|| prism.versionId != "26.2.0-alpha.201"
|| !packwiz.contains('version = "26.2.0-alpha.201"')
|| !packwizIndex.contains('file = "mods/sanctuary-0.0.0-alpha.116.jar"')) {
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')
|| !packwizIndex.contains('file = "mods/sanctuary-0.0.0-alpha.117.jar"')) {
throw new GradleException("The alpha.201 quest-request escrow release is incomplete")
}
}
@@ -4559,37 +4559,134 @@ tasks.named("verifyWorkspace") {
dependsOn tasks.named("verifyQuestRequestEscrowRelease")
}
tasks.register("verifyWaystoneShopCulinaryAlpha202Release") {
group = "verification"
description = "Checks the complete Sanctuary 26.2.0-alpha.202 Waystone, Shop and culinary lectern release."
inputs.file(file("pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
inputs.file(file("pack/release.json"))
inputs.file(file("pack/prism/modrinth.index.json"))
inputs.file(file("pack/packwiz/pack.toml"))
inputs.file(file("pack/packwiz/index.toml"))
inputs.files(file(
"itsalive/src/main/resources/fabric.mod.json"), file(
"iliketomoveit/src/main/resources/fabric.mod.json"), file(
"sanctuary/src/main/resources/fabric.mod.json"))
doLast {
def migration = new JsonSlurper().parse(file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
def release = new JsonSlurper().parse(file("pack/release.json"))
def prism = new JsonSlurper().parse(file("pack/prism/modrinth.index.json"))
def packwiz = file("pack/packwiz/pack.toml").text
def packwizIndex = file("pack/packwiz/index.toml").text
def itsAliveManifest = new JsonSlurper().parse(file(
"itsalive/src/main/resources/fabric.mod.json"))
def moveItManifest = new JsonSlurper().parse(file(
"iliketomoveit/src/main/resources/fabric.mod.json"))
def sanctuaryManifest = new JsonSlurper().parse(file(
"sanctuary/src/main/resources/fabric.mod.json"))
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.anotherworld_version != "0.0.0-alpha.52"
|| rootProject.itsalive_version != "0.0.0-alpha.31"
|| rootProject.iliketomoveit_version != "0.0.0-alpha.14"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| migration.source?.pack_version != "26.2.0-alpha.201"
|| migration.source?.modules != [
itsalive: "0.0.0-alpha.30",
iliketomoveit: "0.0.0-alpha.13",
sanctuary: "0.0.0-alpha.116"]
|| migration.target?.pack_version != "26.2.0-alpha.202"
|| migration.target?.modules != [
itsalive: "0.0.0-alpha.31",
iliketomoveit: "0.0.0-alpha.14",
sanctuary: "0.0.0-alpha.117"]
|| migration.waystone_elevator?.undiscovered_downward_destination_allowed != true
|| migration.waystone_elevator?.destination_discovered_after_arrival != true
|| migration.waystone_elevator?.undiscovered_upward_destination_allowed != false
|| migration.waystone_elevator?.undiscovered_ordinary_destination_allowed != false
|| migration.shop_currency_inventory?.all_unlocked_rows_counted != true
|| migration.shop_currency_inventory?.overflow_rows_counted != true
|| migration.shop_currency_inventory?.duplicate_stack_views_deduplicated != true
|| migration.culinary_lectern?.book_tag != "minecraft:lectern_books"
|| migration.culinary_lectern?.owner_catalog_shared_while_placed != true
|| migration.culinary_lectern?.inscription_removed_when_taken != true
|| migration.culinary_lectern?.inscription_removed_when_lectern_broken != true
|| migration.compatibility?.itsalive_data_version != 1
|| migration.compatibility?.itsalive_network_protocol != 3
|| migration.compatibility?.iliketomoveit_data_version != 3
|| migration.compatibility?.iliketomoveit_network_protocol != 5
|| migration.compatibility?.sanctuary_data_version != 11
|| migration.compatibility?.sanctuary_network_protocol != 21
|| migration.compatibility?.save_migration_required != false
|| migration.compatibility?.registry_ids_changed != false
|| itsAliveManifest.custom?.sanctuary26?.data_version != 1
|| itsAliveManifest.custom?.sanctuary26?.network_protocol != 3
|| moveItManifest.custom?.sanctuary26?.data_version != 3
|| moveItManifest.custom?.sanctuary26?.network_protocol != 5
|| sanctuaryManifest.custom?.sanctuary26?.data_version != 11
|| sanctuaryManifest.custom?.sanctuary26?.network_protocol != 21
|| release.pack_version != "26.2.0-alpha.203"
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != "26.2.0-alpha.203"
|| !packwiz.contains('version = "26.2.0-alpha.203"')
|| !packwizIndex.contains('file = "mods/anotherworld-0.0.0-alpha.51.jar"')
|| !packwizIndex.contains('file = "mods/itsalive-0.0.0-alpha.31.jar"')
|| !packwizIndex.contains('file = "mods/iliketomoveit-0.0.0-alpha.14.jar"')
|| !packwizIndex.contains('file = "mods/sanctuary-0.0.0-alpha.117.jar"')) {
throw new GradleException("The alpha.202 Waystone, Shop and culinary lectern release is incomplete")
}
}
}
tasks.register("verifySafeVaultFeature") {
group = "verification"
description = "Checks the unreleased 3x3 player safe, titanium drill and Shop currency-provider contract."
description = "Checks the current upright 3x3 safe, custom currency interface, drill and Shop contract."
dependsOn ":anotherworld:generateAnotherWorldResources"
inputs.file(file("pack/migrations/anotherworld-safe-vault-data-v2.json"))
inputs.file(file("pack/migrations/anotherworld-safe-vault-data-v3.json"))
inputs.file(file("pack/migrations/anotherworld-safe-vault-fix-alpha52.json"))
inputs.file(file("anotherworld/src/main/resources/fabric.mod.json"))
inputs.file(file("sanctuary/src/main/java/fr/koka99cab/sanctuary26/sanctuary/api/inventory/SanctuaryCurrencyStorage.java"))
inputs.files(fileTree("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/vault") { include "*.java" })
inputs.file(file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/block/SafeVaultBlock.java"))
inputs.file(file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/client/SafeVaultScreen.java"))
inputs.files(fileTree("anotherworld/src/main/resources/assets/anotherworld/textures/block/safe_vault") { include "*.png" })
inputs.file(file("anotherworld/src/main/resources/assets/anotherworld/textures/block/safe_block.png"))
inputs.file(file("anotherworld/src/main/resources/assets/anotherworld/textures/item/safe_block.png"))
inputs.file(file("anotherworld/src/main/resources/assets/anotherworld/textures/item/titanium_drill.png"))
doLast {
def migration = new JsonSlurper().parse(file("pack/migrations/anotherworld-safe-vault-data-v2.json"))
def interfaceMigration = new JsonSlurper().parse(file("pack/migrations/anotherworld-safe-vault-data-v3.json"))
def fixMigration = new JsonSlurper().parse(file("pack/migrations/anotherworld-safe-vault-fix-alpha52.json"))
def manifest = new JsonSlurper().parse(file("anotherworld/src/main/resources/fabric.mod.json"))
def rules = file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/vault/VaultRules.java").text
def data = file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/vault/VaultData.java").text
def structure = file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/vault/VaultStructure.java").text
def menu = file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/vault/SafeVaultMenu.java").text
def block = file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/block/SafeVaultBlock.java").text
def screen = file("anotherworld/src/main/java/fr/koka99cab/sanctuary26/anotherworld/client/SafeVaultScreen.java").text
def currencyApi = file("sanctuary/src/main/java/fr/koka99cab/sanctuary26/sanctuary/api/inventory/SanctuaryCurrencyStorage.java").text
def generated = file("anotherworld/build/generated/resources")
def safeRecipe = new JsonSlurper().parse(new File(generated, "data/anotherworld/recipe/safe_block.json"))
def drillRecipe = new JsonSlurper().parse(new File(generated, "data/anotherworld/recipe/titanium_drill.json"))
def safeBlockState = new JsonSlurper().parse(new File(generated, "assets/anotherworld/blockstates/safe_block.json"))
def safeUnformedModel = new JsonSlurper().parse(new File(generated, "assets/anotherworld/models/block/safe_block_unformed.json"))
def safeItemModel = new JsonSlurper().parse(new File(generated, "assets/anotherworld/models/item/safe_block.json"))
def requiredTextures = [
"block/safe_vault/bottom.png": [48, 48], "block/safe_vault/front.png": [48, 48],
"block/safe_vault/side.png": [48, 48], "block/safe_vault/top.png": [48, 48],
"item/safe_block.png": [16, 16], "item/titanium_drill.png": [16, 16]
"block/safe_block.png": [16, 16], "item/safe_block.png": [16, 16],
"item/titanium_drill.png": [16, 16]
]
def invalidTextures = requiredTextures.findAll { path, size ->
def image = javax.imageio.ImageIO.read(file("anotherworld/src/main/resources/assets/anotherworld/textures/${path}"))
image == null || image.width != size[0] || image.height != size[1]
}.keySet()
if (rootProject.anotherworld_version != "0.0.0-alpha.50"
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.anotherworld_version != "0.0.0-alpha.52"
|| rootProject.sanctuary_version != "0.0.0-alpha.117"
|| migration.schema_version != 1
|| migration.source?.pack_version != "26.2.0-alpha.201"
|| migration.target?.pack_version != "26.2.0-alpha.202"
|| migration.source?.modules != [anotherworld: "0.0.0-alpha.49", sanctuary: "0.0.0-alpha.116"]
|| migration.target?.modules != [anotherworld: "0.0.0-alpha.50", sanctuary: "0.0.0-alpha.117"]
|| migration.safe_vault?.footprint != "3x3_horizontal"
@@ -4603,14 +4700,62 @@ tasks.register("verifySafeVaultFeature") {
|| migration.compatibility?.anotherworld_target_data_version != 2
|| migration.compatibility?.anotherworld_network_protocol != 1
|| migration.compatibility?.sanctuary_network_protocol != 21
|| migration.compatibility?.pack_release_updated != true
|| interfaceMigration.source?.pack_version != "26.2.0-alpha.202"
|| interfaceMigration.source?.modules != [anotherworld: "0.0.0-alpha.50"]
|| interfaceMigration.target?.pack_version != "26.2.0-alpha.203"
|| interfaceMigration.target?.modules != [anotherworld: "0.0.0-alpha.51"]
|| interfaceMigration.safe_vault_structure?.source_footprint != "3x3_horizontal"
|| interfaceMigration.safe_vault_structure?.target_footprint != "3x3_upright"
|| interfaceMigration.safe_vault_structure?.blocks_required != 9
|| interfaceMigration.safe_vault_structure?.connected_texture_parts != 9
|| interfaceMigration.safe_vault_interface?.currency_slots != 3
|| interfaceMigration.safe_vault_interface?.controls_per_currency != ["withdraw_64", "withdraw_1", "deposit_1", "deposit_64"]
|| interfaceMigration.compatibility?.anotherworld_target_data_version != 3
|| interfaceMigration.compatibility?.vault_target_data_version != 2
|| interfaceMigration.compatibility?.saved_currency_balances_preserved != true
|| interfaceMigration.compatibility?.pack_release_updated != true
|| fixMigration.source?.pack_version != "26.2.0-alpha.203"
|| fixMigration.source?.modules != [anotherworld: "0.0.0-alpha.51"]
|| fixMigration.target?.pack_version != "26.2.0-alpha.203"
|| fixMigration.target?.modules != [anotherworld: "0.0.0-alpha.52"]
|| fixMigration.safe_vault_structure_fix?.unformed_block_texture != "anotherworld:block/safe_block"
|| fixMigration.safe_vault_structure_fix?.horizontal_3x1_rejected != true
|| fixMigration.safe_vault_structure_fix?.vertical_3x1_rejected != true
|| fixMigration.safe_vault_structure_fix?.complete_3x3_mask_required != true
|| fixMigration.safe_vault_structure_fix?.connected_texture_parts != 9
|| fixMigration.safe_vault_interface_fix?.currency_slots != 3
|| fixMigration.safe_vault_interface_fix?.emerald_row_visible != true
|| fixMigration.safe_vault_interface_fix?.extended_inventory_starts_below_currency_controls != true
|| fixMigration.safe_vault_interface_fix?.native_inventory_label_suppressed != true
|| fixMigration.compatibility?.anotherworld_data_version != 3
|| fixMigration.compatibility?.vault_data_version != 2
|| fixMigration.compatibility?.anotherworld_network_protocol != 1
|| fixMigration.compatibility?.save_migration_required != false
|| fixMigration.compatibility?.registry_ids_changed != false
|| fixMigration.compatibility?.saved_currency_balances_preserved != true
|| fixMigration.compatibility?.pack_release_updated != false
|| manifest.depends?.sanctuary != ">=0.0.0-alpha.117"
|| manifest.custom?.sanctuary26?.data_version != 2
|| manifest.custom?.sanctuary26?.data_version != 3
|| !file("build.gradle").text.contains('implementation project(":sanctuary")')
|| !currencyApi.contains("public interface Provider")
|| !currencyApi.contains("countAdditional") || !currencyApi.contains("removeAdditional")
|| !rules.contains("STRUCTURE_WIDTH = 3") || !rules.contains("RAID_DURATION_TICKS = 60 * 20")
|| !rules.contains("STRUCTURE_WIDTH = 3") || !rules.contains("COMPLETE_STRUCTURE_MASK")
|| !rules.contains("CURRENCY_SLOTS = 3")
|| !rules.contains("BUTTONS_PER_CURRENCY = 4") || !rules.contains("RAID_DURATION_TICKS = 60 * 20")
|| !rules.contains("RAID_LOOT_PERCENT = 20") || !rules.contains("24L * 60L * 60L * 20L")
|| !data.contains('SAVE_KEY = "safe_vaults"') || !data.contains("DATA_VERSION = 1")
|| !data.contains('SAVE_KEY = "safe_vaults"') || !data.contains("DATA_VERSION = 2")
|| !structure.contains("upright 3x3") || !structure.contains(".above(row - VaultRules.STRUCTURE_RADIUS)")
|| !structure.contains("isCompleteStructureMask(partMask)")
|| !block.contains("BooleanProperty FORMED") || !block.contains("EnumProperty<VaultPart> PART")
|| !menu.contains("clickMenuButton") || !menu.contains("SanctuaryPlayerInventoryView.unlockedRows")
|| !menu.contains("PLAYER_INVENTORY_Y = 108")
|| !screen.contains("handleInventoryButtonClick") || !screen.contains('" ×64", " ×1", "+ ×1", "+ ×64"')
|| screen.contains("inventoryLabelY =")
|| safeBlockState.multipart?.size() != 37
|| safeBlockState.multipart?.count { it.when?.formed == "true" } != 36
|| safeUnformedModel.textures?.all != "anotherworld:block/safe_block"
|| safeItemModel.parent != "anotherworld:block/safe_block_unformed"
|| safeRecipe.pattern != ["GGG", "GCG", "GGG"]
|| drillRecipe.pattern != ["TTT", "RPR", "FDF"]
|| !invalidTextures.isEmpty()) {
@@ -4619,8 +4764,56 @@ tasks.register("verifySafeVaultFeature") {
}
}
tasks.register("verifySafeVaultInterfaceAlpha203Release") {
group = "verification"
description = "Checks the complete Sanctuary 26.2.0-alpha.203 upright safe-vault interface release."
inputs.file(file("pack/migrations/anotherworld-safe-vault-data-v3.json"))
inputs.file(file("pack/release.json"))
inputs.file(file("pack/prism/modrinth.index.json"))
inputs.file(file("pack/packwiz/pack.toml"))
inputs.file(file("pack/packwiz/index.toml"))
doLast {
def migration = new JsonSlurper().parse(file("pack/migrations/anotherworld-safe-vault-data-v3.json"))
def release = new JsonSlurper().parse(file("pack/release.json"))
def prism = new JsonSlurper().parse(file("pack/prism/modrinth.index.json"))
def packwiz = file("pack/packwiz/pack.toml").text
def packwizIndex = file("pack/packwiz/index.toml").text
def jeiFiles = prism.files.findAll { it.path == "mods/jei-26.2-fabric-30.27.0.187.jar" }
if (rootProject.pack_version != "26.2.0-alpha.203"
|| rootProject.anotherworld_version != "0.0.0-alpha.52"
|| migration.source?.pack_version != "26.2.0-alpha.202"
|| migration.source?.modules != [anotherworld: "0.0.0-alpha.50"]
|| migration.target?.pack_version != "26.2.0-alpha.203"
|| migration.target?.modules != [anotherworld: "0.0.0-alpha.51"]
|| migration.compatibility?.anotherworld_source_data_version != 2
|| migration.compatibility?.anotherworld_target_data_version != 3
|| migration.compatibility?.vault_source_data_version != 1
|| migration.compatibility?.vault_target_data_version != 2
|| migration.compatibility?.anotherworld_network_protocol != 1
|| migration.compatibility?.pack_release_updated != true
|| migration.distribution?.packwiz_index_refreshed != true
|| migration.distribution?.jei?.source != "30.26.0.186"
|| migration.distribution?.jei?.target != "30.27.0.187"
|| migration.distribution?.jei?.modrinth_version_id != "XXTFqqwG"
|| migration.distribution?.jei?.prism_manifest_updated != true
|| release.pack_version != rootProject.pack_version
|| release.modrinth?.primary_file != "sanctuary-26.2.0-alpha.203.mrpack"
|| prism.versionId != rootProject.pack_version
|| !packwiz.contains('version = "26.2.0-alpha.203"')
|| !packwizIndex.contains('file = "mods/anotherworld-0.0.0-alpha.51.jar"')
|| packwizIndex.contains('file = "mods/anotherworld-0.0.0-alpha.50.jar"')
|| jeiFiles.size() != 1
|| jeiFiles[0].hashes?.sha1 != "cbd62af1f8e568cbe29c7892ae1b2917c0784a44"
|| jeiFiles[0].hashes?.sha512 != "f8bf88c089c7fe3d56031d7629170ba01eb1d0c5cc4d33f2fd0ac9413369cdef84a0fde999528621426d3dca878c9cfaf7a790622e2cd1d54802e1086fb073f0") {
throw new GradleException("The alpha.203 upright safe-vault interface release is incomplete")
}
}
}
tasks.named("verifyWorkspace") {
dependsOn tasks.named("verifyWaystoneShopCulinaryAlpha202Release")
dependsOn tasks.named("verifySafeVaultFeature")
dependsOn tasks.named("verifySafeVaultInterfaceAlpha203Release")
}
tasks.named("check") {
+4 -4
View File
@@ -16,19 +16,19 @@ ambiance_version=0.0.0-alpha.12
ambiance_lifecycle=active
redstoner_version=0.0.0-alpha.10
redstoner_lifecycle=active
anotherworld_version=0.0.0-alpha.50
anotherworld_version=0.0.0-alpha.52
anotherworld_lifecycle=active
itsalive_version=0.0.0-alpha.30
itsalive_version=0.0.0-alpha.31
itsalive_lifecycle=active
ouch_version=0.0.0-alpha.9
ouch_lifecycle=active
masterkey_version=0.0.0-alpha.8
masterkey_lifecycle=active
iliketomoveit_version=0.0.0-alpha.13
iliketomoveit_version=0.0.0-alpha.14
iliketomoveit_lifecycle=active
onlyfun_version=0.0.0-alpha.19
onlyfun_lifecycle=active
sanctuary_version=0.0.0-alpha.117
sanctuary_lifecycle=active
pack_version=26.2.0-alpha.201
pack_version=26.2.0-alpha.203
maven_group=fr.koka99cab.sanctuary26
+35 -3
View File
@@ -295,7 +295,7 @@ tasks.register("verifyPortals") {
}
def atlasCavernsMigration = new JsonSlurper().parse(rootProject.file(
"pack/migrations/26.2.0-alpha.149-atlas-caverns-to-alpha.150.json"))
if (project.version.toString() != "0.0.0-alpha.13"
if (project.version.toString() != "0.0.0-alpha.14"
|| atlasCavernsMigration.target?.pack_version != "26.2.0-alpha.150"
|| atlasCavernsMigration.target?.modules?.iliketomoveit != "0.0.0-alpha.9"
|| atlasCavernsMigration.portals?.active_routes != [
@@ -331,7 +331,7 @@ tasks.register("verifySilverAircraft") {
def manifest = new JsonSlurper().parse(file("src/main/resources/fabric.mod.json"))
def migration = new JsonSlurper().parse(rootProject.file(
"pack/migrations/26.2.0-alpha.184-silver-engineering-to-alpha.185.json"))
if (project.version.toString() != "0.0.0-alpha.13"
if (project.version.toString() != "0.0.0-alpha.14"
|| recipe.pattern != ["PGP", "GCG", "PBP"]
|| recipe.key != [B: "anotherworld:silver_block", C: "anotherworld:aircraft_cockpit",
G: "anotherworld:silver_gear", P: "anotherworld:silver_plate"]
@@ -360,7 +360,7 @@ tasks.register("verifyGrapplePrediction") {
def payload = file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/network/GrappleStatePayload.java").text
def controller = file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/grapple/GrappleController.java").text
def prediction = file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/client/grapple/ClientGrapplePrediction.java").text
if (project.version.toString() != "0.0.0-alpha.13"
if (project.version.toString() != "0.0.0-alpha.14"
|| migration.target?.modules?.iliketomoveit != "0.0.0-alpha.13"
|| migration.grappling?.owner_prediction_payload != "iliketomoveit:s2c/grapple_state"
|| migration.compatibility?.iliketomoveit_source_network_protocol != 4
@@ -377,12 +377,44 @@ tasks.register("verifyGrapplePrediction") {
}
}
tasks.register("verifyWaystoneDescendingRelease") {
group = "verification"
description = "Checks alpha.14 downward discovery for direct Waystone elevators."
inputs.file(rootProject.file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/waystone/WaystoneElevatorRules.java"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/network/WaystoneTeleportation.java"))
inputs.file(file("src/test/java/fr/koka99cab/sanctuary26/iliketomoveit/waystone/WaystoneElevatorRulesSmoke.java"))
doLast {
def migration = new JsonSlurper().parse(rootProject.file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
def rules = file(
"src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/waystone/WaystoneElevatorRules.java").text
def teleportation = file(
"src/main/java/fr/koka99cab/sanctuary26/iliketomoveit/network/WaystoneTeleportation.java").text
if (project.version.toString() != "0.0.0-alpha.14"
|| migration.target?.modules?.iliketomoveit != "0.0.0-alpha.14"
|| migration.waystone_elevator?.undiscovered_downward_destination_allowed != true
|| migration.waystone_elevator?.destination_discovered_after_arrival != true
|| migration.waystone_elevator?.undiscovered_upward_destination_allowed != false
|| migration.waystone_elevator?.undiscovered_ordinary_destination_allowed != false
|| migration.compatibility?.iliketomoveit_data_version != 3
|| migration.compatibility?.iliketomoveit_network_protocol != 5
|| !rules.contains("return !upward || targetDiscovered;")
|| !rules.contains("elevatorRide && targetY < sourceY")
|| !teleportation.contains("discoveries.discover(player.getUUID(), level, target)")) {
throw new GradleException("I Like To Move It alpha.14 downward Waystone discovery contract is incomplete")
}
}
}
tasks.named("check") {
dependsOn tasks.named("grapplePhysicsSmoke")
dependsOn tasks.named("waystoneElevatorRulesSmoke")
dependsOn tasks.named("verifyWaystones")
dependsOn tasks.named("verifyGrappling")
dependsOn tasks.named("verifyGrapplePrediction")
dependsOn tasks.named("verifyWaystoneDescendingRelease")
dependsOn tasks.named("verifyPortals")
dependsOn tasks.named("verifySilverAircraft")
}
+54 -4
View File
@@ -417,7 +417,7 @@ tasks.register("verifyItsAlive") {
def climateSource = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/agriculture/ClimateCropForaging.java").text
def pineappleSource = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/agriculture/PineappleItem.java").text
def worldgenSource = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/agriculture/ItsAliveAgricultureWorldGeneration.java").text
if (project.version.toString() != "0.0.0-alpha.30"
if (project.version.toString() != "0.0.0-alpha.31"
|| climateMigration.target?.pack_version != "26.2.0-alpha.157"
|| climateMigration.target?.modules?.itsalive != "0.0.0-alpha.24"
|| !climateSource.contains("PlayerBlockBreakEvents.AFTER.register")
@@ -1174,7 +1174,7 @@ tasks.register("verifyCulinaryReliability") {
}
}
}
if (project.version.toString() != "0.0.0-alpha.30"
if (project.version.toString() != "0.0.0-alpha.31"
|| migration.target?.modules?.itsalive != "0.0.0-alpha.28"
|| migration.culinary_fixes?.food_press_contents_destroyed_on_break != true
|| migration.culinary_fixes?.comparator_contract?.blocks?.size() != 6
@@ -1212,7 +1212,7 @@ tasks.register("verifyCauldronBatching") {
def recipe = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/recipe/CulinaryProcessRecipe.java").text
def cauldron = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/block/entity/CookingCauldronBlockEntity.java").text
def timed = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/block/entity/AbstractTimedCulinaryBlockEntity.java").text
if (project.version.toString() != "0.0.0-alpha.30"
if (project.version.toString() != "0.0.0-alpha.31"
|| migration.target?.modules?.itsalive != "0.0.0-alpha.29"
|| migration.cauldron_batches?.logical_stack_limit != 64
|| migration.cauldron_batches?.identity != "same_item_same_components"
@@ -1250,7 +1250,7 @@ tasks.register("verifyFermentationBarrelAutomation") {
def partialMatching = file("src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/recipe/CulinaryPartialMatching.java").text
def blockstate = new JsonSlurper().parse(
file("src/main/resources/assets/itsalive/blockstates/fermentation_barrel.json"))
if (project.version.toString() != "0.0.0-alpha.30"
if (project.version.toString() != "0.0.0-alpha.31"
|| migration.source?.modules?.itsalive != "0.0.0-alpha.29"
|| migration.target?.modules?.itsalive != "0.0.0-alpha.30"
|| migration.fermentation_barrel?.maximum_units_per_input_slot != 1
@@ -1273,11 +1273,61 @@ tasks.register("verifyFermentationBarrelAutomation") {
}
}
tasks.register("verifyCulinaryLecternRelease") {
group = "verification"
description = "Checks alpha.31 shared culinary books on vanilla lecterns."
inputs.file(rootProject.file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/knowledge/CulinaryLectern.java"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/knowledge/CulinaryRecipeKnowledge.java"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/itsalive/registry/ItsAliveDataComponents.java"))
inputs.file(file("src/main/resources/data/minecraft/tags/item/lectern_books.json"))
inputs.files(fileTree("src/main/resources/assets/itsalive/lang") { include "*.json" })
doLast {
def migration = new JsonSlurper().parse(rootProject.file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
def lectern = file(
"src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/knowledge/CulinaryLectern.java").text
def knowledge = file(
"src/main/java/fr/koka99cab/sanctuary26/itsalive/culinary/knowledge/CulinaryRecipeKnowledge.java").text
def components = file(
"src/main/java/fr/koka99cab/sanctuary26/itsalive/registry/ItsAliveDataComponents.java").text
def lecternBooks = new JsonSlurper().parse(file(
"src/main/resources/data/minecraft/tags/item/lectern_books.json"))
def locales = ["en_us", "fr_fr", "ru_ru"].collectEntries { locale ->
[(locale): new JsonSlurper().parse(file(
"src/main/resources/assets/itsalive/lang/${locale}.json"))]
}
if (project.version.toString() != "0.0.0-alpha.31"
|| migration.target?.modules?.itsalive != "0.0.0-alpha.31"
|| migration.culinary_lectern?.book_tag != "minecraft:lectern_books"
|| migration.culinary_lectern?.owner_catalog_shared_while_placed != true
|| migration.culinary_lectern?.inscription_removed_when_taken != true
|| migration.culinary_lectern?.inscription_removed_when_lectern_broken != true
|| migration.compatibility?.itsalive_data_version != 1
|| migration.compatibility?.itsalive_network_protocol != 3
|| !lectern.contains("UseBlockCallback.EVENT.register(CulinaryLectern::use)")
|| !lectern.contains("PlayerBlockBreakEvents.BEFORE.register")
|| !lectern.contains("CulinaryRecipeKnowledge.openBook(serverPlayer, book)")
|| !lectern.contains("CulinaryRecipeKnowledge.forgetInscription(taken)")
|| !knowledge.contains("stack.set(ItsAliveDataComponents.CULINARY_BOOK")
|| !knowledge.contains("stack.remove(ItsAliveDataComponents.CULINARY_BOOK)")
|| !components.contains('ItsAliveMod.id("culinary_book")')
|| !lecternBooks["values"]?.contains("itsalive:culinary_recipe_book")
|| locales.any { locale, values ->
!values.containsKey("tooltip.itsalive.culinary_recipe_book.blank")
}) {
throw new GradleException("It's Alive alpha.31 culinary lectern contract is incomplete")
}
}
}
tasks.named("check") {
dependsOn tasks.named("verifyItsAlive")
dependsOn tasks.named("verifyCulinaryReliability")
dependsOn tasks.named("verifyCauldronBatching")
dependsOn tasks.named("culinaryBatchingSmoke")
dependsOn tasks.named("verifyFermentationBarrelAutomation")
dependsOn tasks.named("verifyCulinaryLecternRelease")
dependsOn tasks.named("culinaryPartialMatchingSmoke")
}
@@ -0,0 +1,56 @@
{
"schema_version": 1,
"source": {
"pack_version": "26.2.0-alpha.201",
"modules": {
"itsalive": "0.0.0-alpha.30",
"iliketomoveit": "0.0.0-alpha.13",
"sanctuary": "0.0.0-alpha.116"
}
},
"target": {
"pack_version": "26.2.0-alpha.202",
"modules": {
"itsalive": "0.0.0-alpha.31",
"iliketomoveit": "0.0.0-alpha.14",
"sanctuary": "0.0.0-alpha.117"
}
},
"waystone_elevator": {
"undiscovered_downward_destination_allowed": true,
"destination_discovered_after_arrival": true,
"undiscovered_upward_destination_allowed": false,
"undiscovered_ordinary_destination_allowed": false,
"source_discovery_required": true
},
"shop_currency_inventory": {
"all_unlocked_rows_counted": true,
"overflow_rows_counted": true,
"offhand_counted": true,
"duplicate_stack_views_deduplicated": true,
"server_authoritative_removal": true
},
"culinary_lectern": {
"vanilla_lectern_supported": true,
"book_tag": "minecraft:lectern_books",
"owner_catalog_shared_while_placed": true,
"inscription_removed_when_taken": true,
"inscription_removed_when_lectern_broken": true,
"inventory_book_remains_personal": true,
"owner_name_max_length": 32
},
"distribution": {
"prism_instance": "Sanctuary-26.2-dev",
"packwiz_index_refreshed": true
},
"compatibility": {
"itsalive_data_version": 1,
"itsalive_network_protocol": 3,
"iliketomoveit_data_version": 3,
"iliketomoveit_network_protocol": 5,
"sanctuary_data_version": 11,
"sanctuary_network_protocol": 21,
"save_migration_required": false,
"registry_ids_changed": false
}
}
@@ -1,4 +1,5 @@
{
"schema_version": 1,
"source": {
"pack_version": "26.2.0-alpha.201",
"modules": {
@@ -7,7 +8,7 @@
}
},
"target": {
"pack_version": "26.2.0-alpha.201",
"pack_version": "26.2.0-alpha.202",
"modules": {
"anotherworld": "0.0.0-alpha.50",
"sanctuary": "0.0.0-alpha.117"
@@ -71,6 +72,6 @@
"anotherworld:titanium_drill"
],
"existing_world_reset_required": false,
"pack_release_updated": false
"pack_release_updated": true
}
}
@@ -0,0 +1,55 @@
{
"schema_version": 1,
"source": {
"pack_version": "26.2.0-alpha.202",
"modules": {
"anotherworld": "0.0.0-alpha.50"
}
},
"target": {
"pack_version": "26.2.0-alpha.203",
"modules": {
"anotherworld": "0.0.0-alpha.51"
}
},
"safe_vault_structure": {
"source_footprint": "3x3_horizontal",
"target_footprint": "3x3_upright",
"blocks_required": 9,
"unformed_blocks_use_individual_cube_model": true,
"connected_48x48_texture_requires_complete_structure": true,
"connected_texture_parts": 9
},
"safe_vault_interface": {
"currency_slots": 3,
"currencies": [
"anotherworld:ruby",
"anotherworld:sapphire",
"minecraft:emerald"
],
"controls_per_currency": ["withdraw_64", "withdraw_1", "deposit_1", "deposit_64"],
"server_authoritative": true,
"persisted_storage_slots_preserved": 27
},
"distribution": {
"packwiz_index_refreshed": true,
"jei": {
"source": "30.26.0.186",
"target": "30.27.0.187",
"modrinth_version_id": "XXTFqqwG",
"prism_manifest_updated": true
}
},
"compatibility": {
"anotherworld_source_data_version": 2,
"anotherworld_target_data_version": 3,
"vault_source_data_version": 1,
"vault_target_data_version": 2,
"anotherworld_network_protocol": 1,
"saved_currency_balances_preserved": true,
"legacy_horizontal_structure_requires_rebuild": true,
"new_registry_ids": ["menu:anotherworld:safe_vault"],
"removed_registry_ids": [],
"pack_release_updated": true
}
}
@@ -0,0 +1,37 @@
{
"schema_version": 1,
"source": {
"pack_version": "26.2.0-alpha.203",
"modules": {
"anotherworld": "0.0.0-alpha.51"
}
},
"target": {
"pack_version": "26.2.0-alpha.203",
"modules": {
"anotherworld": "0.0.0-alpha.52"
}
},
"safe_vault_structure_fix": {
"unformed_block_texture": "anotherworld:block/safe_block",
"horizontal_3x1_rejected": true,
"vertical_3x1_rejected": true,
"complete_3x3_mask_required": true,
"connected_texture_parts": 9
},
"safe_vault_interface_fix": {
"currency_slots": 3,
"emerald_row_visible": true,
"extended_inventory_starts_below_currency_controls": true,
"native_inventory_label_suppressed": true
},
"compatibility": {
"anotherworld_data_version": 3,
"vault_data_version": 2,
"anotherworld_network_protocol": 1,
"save_migration_required": false,
"registry_ids_changed": false,
"saved_currency_balances_preserved": true,
"pack_release_updated": false
}
}
+15 -15
View File
@@ -14,15 +14,15 @@ hash = "41f4f4c88c71d0a23446d5014f7407d55ad477441847099cad24492b032335a0"
[[files]]
file = "mods/ambiance-0.0.0-alpha.12.jar"
hash = "6d131ff56488ecc6352a86c87e29bef6a198ad672983838ad71941661d6567af"
hash = "40de39da187fa42f3b947f83872286ef6f049ff8bac0ac1a66d46d18ee14f911"
[[files]]
file = "mods/anotherworld-0.0.0-alpha.49.jar"
hash = "b245c849985c208ca547da3dc41121ce6dd2bc1ffbbb1bfd8f6a7326356cfbdc"
file = "mods/anotherworld-0.0.0-alpha.51.jar"
hash = "caa4d8b29af65dd0a43e9aa2a7b897255ae10869595f1ca706f579b15d37c5a2"
[[files]]
file = "mods/events-0.0.0-alpha.0.jar"
hash = "d8dac51f88f72bfb1f7cd92279447897ee349e4cbc78b070cb33e99d5acbb965"
hash = "09047070e419df4bbd510c114e6c23c609757e03ef1142ba4d38f6b99ecb0a7c"
[[files]]
file = "mods/fabric-api.pw.toml"
@@ -30,8 +30,8 @@ hash = "df032a6b051d0262cf24945c43e0e6b915e8cc1d62af62fe933932e7f35960c4"
metafile = true
[[files]]
file = "mods/iliketomoveit-0.0.0-alpha.13.jar"
hash = "cf3e90860f475f6a7466eb29686d230c95d5629a36fac89c60077fbae4ede865"
file = "mods/iliketomoveit-0.0.0-alpha.14.jar"
hash = "e8027e82ebcb214c94e028d7c2780057d745dcb810ca785ee35601bbbc1c3ec0"
[[files]]
file = "mods/iris.pw.toml"
@@ -39,33 +39,33 @@ hash = "84a3cef87679c0d21dceb4641167dc0368b9a3593698f6a3632485e9b3a8d5da"
metafile = true
[[files]]
file = "mods/itsalive-0.0.0-alpha.30.jar"
hash = "c311281a771bb8fec63be8e8a0d792be919737e4dfcf3da25ef08c6878662d55"
file = "mods/itsalive-0.0.0-alpha.31.jar"
hash = "04fcdc3312c0bd4e4271602c2e9eb8eb419de10c7b61b6ab47182033de736452"
[[files]]
file = "mods/jei.pw.toml"
hash = "0461b1b0c56d4f9bd9af2e8c53dcf121ad4ff29f740d6fbe7363649fcc6d8aa5"
hash = "7196839cc369a00ea9cffd0a85594f8fd46c0978f4f2fc708e61368a8b451270"
metafile = true
[[files]]
file = "mods/masterkey-0.0.0-alpha.8.jar"
hash = "4fac6589b42df15599915849cbf624d6cb8fbd41f47623357d5d6fa27e6f992f"
hash = "1a14be8288a9eb2b93922e84cf14d701fb86bd67d6227adb16a534961dae5f87"
[[files]]
file = "mods/onlyfun-0.0.0-alpha.19.jar"
hash = "cf8f3afb8503ed9689fcce6153ad72c5621f4bb2441af867326d536d347756ed"
hash = "c5b8bf67efd0a001c142172110f307ec2a59ac3d7457ed8e4f53f8e683033c1d"
[[files]]
file = "mods/ouch-0.0.0-alpha.9.jar"
hash = "fc0f678eb72354c6594c90c59af78bcc7420190d91e922d1cd74a45f5eaa948e"
hash = "781f89dd44e3277dd8fd51e60ff2da9677a6376faeafd4000e1c07cf6f818759"
[[files]]
file = "mods/redstoner-0.0.0-alpha.10.jar"
hash = "6325d6edf66b1b0f102f53152239982c4c0c7011a59848e8d6e569f360b7ff0f"
hash = "2d6ea237771f7a75a6d0184a68e910a7513159c0259e3c2b06f0a411a0979cbe"
[[files]]
file = "mods/sanctuary-0.0.0-alpha.116.jar"
hash = "c1f856995a259f6471cf0780e1b02f5f73e487f21d39b0519b5a02299c480516"
file = "mods/sanctuary-0.0.0-alpha.117.jar"
hash = "10a7403a4b10ef049a7e557fd00eed56178f6d5383a2b7f28ff60b951eb4e053"
[[files]]
file = "mods/simple-voice-chat.pw.toml"
+4 -4
View File
@@ -1,14 +1,14 @@
name = "Just Enough Items (JEI)"
filename = "jei-26.2-fabric-30.26.0.186.jar"
filename = "jei-26.2-fabric-30.27.0.187.jar"
side = "both"
pin = true
[download]
url = "https://cdn.modrinth.com/data/u6dRKJwZ/versions/ZLvOB7Pk/jei-26.2-fabric-30.26.0.186.jar"
url = "https://cdn.modrinth.com/data/u6dRKJwZ/versions/XXTFqqwG/jei-26.2-fabric-30.27.0.187.jar"
hash-format = "sha512"
hash = "6d8aaad5066d607e460db6f83cba28807129104b46c580b5ba3372d7b7cef84e28ade393c0a3d6bbb38191bcac053af691d0f58d8075f211c687c7b56c74337c"
hash = "f8bf88c089c7fe3d56031d7629170ba01eb1d0c5cc4d33f2fd0ac9413369cdef84a0fde999528621426d3dca878c9cfaf7a790622e2cd1d54802e1086fb073f0"
[update]
[update.modrinth]
mod-id = "u6dRKJwZ"
version = "ZLvOB7Pk"
version = "XXTFqqwG"
+2 -2
View File
@@ -1,12 +1,12 @@
name = "Sanctuary 26.2"
author = "KOKA99CAB"
version = "26.2.0-alpha.201"
version = "26.2.0-alpha.203"
pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
hash-format = "sha256"
hash = "52d4011015ea5b087f0cd0c06fb2f762e83e2cd6d227441984d5d204fb6aedd1"
hash = "0cb034db4939949917ee7d06d1eb205268b1453c2fb78a3fe57d64d090b54a87"
[versions]
fabric = "0.19.3"
+6 -6
View File
@@ -3,7 +3,7 @@
"game": "minecraft",
"name": "Sanctuary 26.2",
"summary": "Sanctuary 26.2 — progression, exploration, worldgen and multiplayer systems by KOKA99CAB.",
"versionId": "26.2.0-alpha.201",
"versionId": "26.2.0-alpha.203",
"files": [
{
"path": "mods/fabric-api-0.158.0+26.2.jar",
@@ -21,19 +21,19 @@
"fileSize": 2535765
},
{
"path": "mods/jei-26.2-fabric-30.26.0.186.jar",
"path": "mods/jei-26.2-fabric-30.27.0.187.jar",
"hashes": {
"sha1": "950efcf2d63a3a0560eae81223479577ad1a78cd",
"sha512": "6d8aaad5066d607e460db6f83cba28807129104b46c580b5ba3372d7b7cef84e28ade393c0a3d6bbb38191bcac053af691d0f58d8075f211c687c7b56c74337c"
"sha1": "cbd62af1f8e568cbe29c7892ae1b2917c0784a44",
"sha512": "f8bf88c089c7fe3d56031d7629170ba01eb1d0c5cc4d33f2fd0ac9413369cdef84a0fde999528621426d3dca878c9cfaf7a790622e2cd1d54802e1086fb073f0"
},
"env": {
"client": "required",
"server": "required"
},
"downloads": [
"https://cdn.modrinth.com/data/u6dRKJwZ/versions/ZLvOB7Pk/jei-26.2-fabric-30.26.0.186.jar"
"https://cdn.modrinth.com/data/u6dRKJwZ/versions/XXTFqqwG/jei-26.2-fabric-30.27.0.187.jar"
],
"fileSize": 1818022
"fileSize": 1818136
},
{
"path": "mods/voicechat-fabric-2.6.22+26.2.jar",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"schema_version": 1,
"pack_version": "26.2.0-alpha.201",
"pack_version": "26.2.0-alpha.203",
"release_channel": "alpha",
"minecraft_version": "26.2",
"fabric_loader_version": "0.19.3",
@@ -9,7 +9,7 @@
"project_id": "FgOqyAXd",
"project_slug": "sanctuary-koka99",
"project_url": "https://modrinth.com/modpack/sanctuary-koka99",
"primary_file": "sanctuary-26.2.0-alpha.201.mrpack",
"primary_file": "sanctuary-26.2.0-alpha.203.mrpack",
"shared_client_server_pack": true,
"update_owner": "packwiz-installer",
"check_on_launch": true,
+39
View File
@@ -2748,6 +2748,44 @@ tasks.register("verifyCompanionPowerTooltips") {
}
}
tasks.register("verifyShopCurrencyRowsRelease") {
group = "verification"
description = "Checks alpha.117 Shop currency across every unlocked inventory row."
inputs.file(rootProject.file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/sanctuary/api/inventory/SanctuaryPlayerInventoryView.java"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/sanctuary/shop/BlackMarketService.java"))
inputs.file(file("src/main/java/fr/koka99cab/sanctuary26/sanctuary/shop/ShopService.java"))
doLast {
def migration = new JsonSlurper().parse(rootProject.file(
"pack/migrations/26.2.0-alpha.201-waystone-shop-culinary-to-alpha.202.json"))
def inventory = file(
"src/main/java/fr/koka99cab/sanctuary26/sanctuary/api/inventory/SanctuaryPlayerInventoryView.java").text
def market = file(
"src/main/java/fr/koka99cab/sanctuary26/sanctuary/shop/BlackMarketService.java").text
def shop = file(
"src/main/java/fr/koka99cab/sanctuary26/sanctuary/shop/ShopService.java").text
if (project.version.toString() != "0.0.0-alpha.117"
|| migration.target?.modules?.sanctuary != "0.0.0-alpha.117"
|| migration.shop_currency_inventory?.all_unlocked_rows_counted != true
|| migration.shop_currency_inventory?.overflow_rows_counted != true
|| migration.shop_currency_inventory?.duplicate_stack_views_deduplicated != true
|| migration.shop_currency_inventory?.server_authoritative_removal != true
|| migration.compatibility?.sanctuary_data_version != 11
|| migration.compatibility?.sanctuary_network_protocol != 21
|| !inventory.contains("public static List<SlotReference> unlockedRows(Player player)")
|| !inventory.contains("SanctuaryOverflowAccess.of(player)")
|| !market.contains("IdentityHashMap<ItemStack, Boolean> seen")
|| !market.contains("player.inventoryMenu.slots")
|| !market.contains("SanctuaryPlayerInventoryView.unlockedRows(player)")
|| !market.contains("SanctuaryPlayerInventoryView.offhand(player)")
|| !shop.contains("BlackMarketService.countPlayerItem(player, item)")
|| !shop.contains("BlackMarketService.removePlayerItem(player, item, count)")) {
throw new GradleException("Sanctuary alpha.117 unlocked-row Shop currency contract is incomplete")
}
}
}
tasks.named("verifySanctuary") {
dependsOn tasks.named("verifyCompanionPowerTooltips")
}
@@ -3245,6 +3283,7 @@ tasks.named("check") {
dependsOn tasks.named("verifyQuestRequests")
dependsOn tasks.named("verifyQuestRequestContracts")
dependsOn tasks.named("verifyQuestRequestEscrow")
dependsOn tasks.named("verifyShopCurrencyRowsRelease")
dependsOn tasks.named("celestialGraphSmoke")
dependsOn tasks.named("questRequestModelSmoke")
}