Structure place waits for plans

- Bukkit structure place catches ProvisionalAnswerException around the piece loop
- Pieces already written are recorded for /iris object undo, as the modded command does
- The player gets a retry message with the placement position
- The new message is translated in every bundled language
This commit is contained in:
Brian Neumann-Fopiano committed 2026-11-02 06:08:09 -05:00
1 parent 9f0615a975
commit 6041077c8a
19 files changed
+40 -8

No files matched your search

@@ -24,7 +24,9 @@ import art.arcane.iris.structure.BulkStructureImporter;
import art.arcane.iris.structure.StructureCaptureImporter;
import art.arcane.iris.structure.StructureImporter;
import art.arcane.iris.structure.StructureIndexService;
import art.arcane.iris.studio.object.ObjectSVC;
import art.arcane.iris.generation.runtime.Engine;
import art.arcane.iris.generation.stream.ProvisionalAnswerException;
import art.arcane.iris.structure.placement.IrisStructureLocator;
import art.arcane.iris.structure.nativegen.NativeStructureGenerationPolicy;
import art.arcane.iris.structure.placement.PlacedStructurePiece;
@@ -358,15 +360,23 @@ public class CommandStructure implements DirectorExecutor {
PlatformChunkGenerator targetGenerator = IrisToolbelt.access(targetWorld);
Engine targetEngine = targetGenerator == null ? null : targetGenerator.getEngine();
IObjectPlacer placer = CommandObject.createPlacer(targetWorld, future, targetEngine);
for (PlacedStructurePiece p : pieces) {
IrisObjectPlacement config = new IrisObjectPlacement();
config.setMode(ObjectPlaceMode.STRUCTURE_PIECE);
config.setRotation(p.getRotation());
config.getPlace().add(p.getObject().getLoadKey());
if (!s.getEdit().isEmpty()) {
config.setEdit(s.getEdit());
try {
for (PlacedStructurePiece p : pieces) {
IrisObjectPlacement config = new IrisObjectPlacement();
config.setMode(ObjectPlaceMode.STRUCTURE_PIECE);
config.setRotation(p.getRotation());
config.getPlace().add(p.getObject().getLoadKey());
if (!s.getEdit().isEmpty()) {
config.setEdit(s.getEdit());
}
p.getObject().place(p.getX(), p.getY(), p.getZ(), placer, config, rng, null, null, data);
}
p.getObject().place(p.getX(), p.getY(), p.getZ(), placer, config, rng, null, null, data);
} catch (ProvisionalAnswerException provisional) {
J.runGlobal(() -> Iris.service(ObjectSVC.class).addChanges(future));
sender().sendMessage(IrisLanguage.text(BukkitCommandMessagesExtended.COMMAND_STRUCTURE_PLACE_WAITS_FOR_TERRAIN_PLAN,
MessageArgument.untrusted("x", loc.getBlockX()), MessageArgument.untrusted("y", loc.getBlockY()),
MessageArgument.untrusted("z", loc.getBlockZ())));
return;
}
int blockChanges = 0;
for (Map.Entry<Block, BlockData> entry : future.entrySet()) {
@@ -581,6 +581,10 @@ public final class BukkitCommandMessagesExtended {
C.GREEN + "Placed '" + "{structure}" + "' (" + "{value}" + " pieces, "
+ "{value2}" + " block changes) at your location."
);
public static final TextKey COMMAND_STRUCTURE_PLACE_WAITS_FOR_TERRAIN_PLAN = TextKey.of(
"iris.bukkit.commandstructure.place_waits_for_terrain_plan",
C.YELLOW + "The terrain at " + "{x}" + " " + "{y}" + " " + "{z}" + " is still being planned. Pieces placed so far can be removed with /iris object undo; run the placement again in a moment."
);
public static final TextKey COMMAND_STRUCTURE_PLACEMENT_CHANGED_NO_BLOCKS = TextKey.of(
"iris.bukkit.commandstructure.placement_changed_no_blocks",
C.RED + "Structure '" + "{structure}" + "' assembled " + "{value}"
@@ -952,6 +956,7 @@ public final class BukkitCommandMessagesExtended {
COMMAND_STRUCTURE_NO_IRIS_STRUCTURE_THIS_PACK_2,
COMMAND_STRUCTURE_STRUCTURE_ASSEMBLED_0_PIECES,
COMMAND_STRUCTURE_PLACED_PIECES_AT_YOUR_LOCATION,
COMMAND_STRUCTURE_PLACE_WAITS_FOR_TERRAIN_PLAN,
COMMAND_STRUCTURE_PLACEMENT_CHANGED_NO_BLOCKS,
COMMAND_STUDIO_OPENING_STUDIO_PACK_SEED,
COMMAND_STUDIO_PROVIDE_DIMENSION_PACK_IRIS_STD_IMPORTVANILLA_PACK_DIMENSION,
@@ -643,6 +643,7 @@ no_iris_structure_this_pack_2 = "§cKeine Iris-Struktur '{structure}' in diesem
structure_assembled_0_pieces = "§cStruktur '{structure}' wurde aus 0 Teilen zusammengesetzt"
placed_pieces_at_your_location = "§a'{structure}' ({value} Teile) an deiner Position platziert. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eDas Gelände bei {x} {y} {z} wird noch geplant. Bereits platzierte Teile lassen sich mit /iris object undo entfernen; führe die Platzierung gleich erneut aus."
[iris.bukkit.commandstudio]
hotloading = "§eStudio wird im laufenden Betrieb neu geladen..."
@@ -643,6 +643,7 @@ no_iris_structure_this_pack_2 = "§cNo existe la estructura de Iris '{structure}
structure_assembled_0_pieces = "§cLa estructura '{structure}' ensambló 0 piezas"
placed_pieces_at_your_location = "§aSe colocó '{structure}' ({value} piezas) en tu ubicación. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eEl terreno en {x} {y} {z} todavía se está planificando. Las piezas ya colocadas se pueden quitar con /iris object undo; vuelve a ejecutar la colocación en un momento."
[iris.bukkit.commandstudio]
hotloading = "§eRecargando Studio en caliente..."
@@ -648,6 +648,7 @@ no_iris_structure_this_pack_2 = "§cEi iirisrakennetta '{structure}Tässä pakka
structure_assembled_0_pieces = "§cRakenne{structure}' koottu 0 kappaletta"
placed_pieces_at_your_location = "§aPaikka{structure}' ({value} Palaset) sijaintisi. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eMaastoa kohdassa {x} {y} {z} suunnitellaan vielä. Jo sijoitetut osat voi poistaa komennolla /iris object undo; suorita sijoitus uudelleen hetken kuluttua."
[iris.bukkit.commandstudio]
hotloading = "§eLadataan Studiota uudelleen..."
@@ -643,6 +643,7 @@ no_iris_structure_this_pack_2 = "§cAucune structure Iris '{structure}' dans ce
structure_assembled_0_pieces = "§cLa structure '{structure}' a assemblé 0 pièce"
placed_pieces_at_your_location = "§aLa structure '{structure}' ({value} pièces) a été placée à votre position. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eLe terrain en {x} {y} {z} est encore en cours de planification. Les pièces déjà placées peuvent être retirées avec /iris object undo ; relancez le placement dans un instant."
[iris.bukkit.commandstudio]
hotloading = "§eRechargement à chaud de Studio..."
@@ -648,6 +648,7 @@ no_iris_structure_this_pack_2 = "§cאין מבנה איריס \"{structure}\"ב
structure_assembled_0_pieces = "§cמבנה \"{structure}התאספו 0 חתיכות"
placed_pieces_at_your_location = "§aמקום \"{structure}' ({value} חתיכות) במיקום שלך. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eהשטח ב-{x} {y} {z} עדיין בתכנון. ניתן להסיר את החלקים שכבר הוצבו עם /iris object undo; הרץ את ההצבה שוב בעוד רגע."
[iris.bukkit.commandstudio]
hotloading = "§eטוען מחדש את Studio..."
@@ -643,6 +643,7 @@ no_iris_structure_this_pack_2 = "§cNessuna struttura Iris '{structure}' in ques
structure_assembled_0_pieces = "§cLa struttura '{structure}' è stata assemblata con 0 pezzi"
placed_pieces_at_your_location = "§a'{structure}' ({value} pezzi) posizionata nella tua posizione. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eIl terreno in {x} {y} {z} è ancora in fase di pianificazione. I pezzi già piazzati si possono rimuovere con /iris object undo; esegui di nuovo il piazzamento tra un momento."
[iris.bukkit.commandstudio]
hotloading = "§eRicaricamento a caldo di Studio..."
@@ -646,6 +646,7 @@ no_iris_structure_this_pack_2 = "§cこのパックには Iris 構造物 '{struc
structure_assembled_0_pieces = "§c構造物 '{structure}' は 0 ピースで組み立てられました"
placed_pieces_at_your_location = "§a現在位置に '{structure}'({value} ピース)を配置しました。 ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§e{x} {y} {z} の地形はまだ計画中です。配置済みのピースは /iris object undo で取り除けます。少し待ってからもう一度配置してください。"
[iris.bukkit.commandstudio]
hotloading = "§eStudio をホットリロード中..."
@@ -646,6 +646,7 @@ no_iris_structure_this_pack_2 = "§c아이리스 구조 없음 '{structure}이
structure_assembled_0_pieces = "§c구조물 '{structure}' 조립 결과: 조각 0개"
placed_pieces_at_your_location = "§a장소 '{structure}' ({value} 당신의 위치에 조각). ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§e{x} {y} {z}의 지형은 아직 계획 중입니다. 이미 배치된 조각은 /iris object undo로 제거할 수 있습니다. 잠시 후 다시 배치를 실행하세요."
[iris.bukkit.commandstudio]
hotloading = "§eStudio 핫 리로드 중..."
@@ -648,6 +648,7 @@ no_iris_structure_this_pack_2 = "§cNėra rainelės struktūros \"{structure}\"
structure_assembled_0_pieces = "§cStruktūra \"{structure}'surinkti 0 vienetai"
placed_pieces_at_your_location = "§aPateikta \"{structure}' ({value} vienetų). ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eReljefas ties {x} {y} {z} dar planuojamas. Jau padėtas dalis galima pašalinti komanda /iris object undo; po akimirkos padėkite dar kartą."
[iris.bukkit.commandstudio]
hotloading = "§eStudio įkeliama iš naujo..."
@@ -643,6 +643,7 @@ no_iris_structure_this_pack_2 = "§cGeen irisstructuur '{structure}' in deze ver
structure_assembled_0_pieces = "§cStructuur{structure}' gemonteerd 0 stuks"
placed_pieces_at_your_location = "§aGeplaatst '{structure}' ({value} stukken) op uw locatie. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eHet terrein bij {x} {y} {z} wordt nog gepland. Al geplaatste stukken verwijder je met /iris object undo; voer het plaatsen zo meteen opnieuw uit."
[iris.bukkit.commandstudio]
hotloading = "§eStudio wordt opnieuw geladen..."
@@ -648,6 +648,7 @@ no_iris_structure_this_pack_2 = "§cBrak struktury tęczówki \"{structure}'w ty
structure_assembled_0_pieces = "§cStruktura \"{structure}\"zmontowane 0 kawałki"
placed_pieces_at_your_location = "§aUmieszczone \"{structure}' ({value} sztuk) w miejscu. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eTeren w {x} {y} {z} jest nadal planowany. Już postawione części można usunąć poleceniem /iris object undo; uruchom umieszczanie ponownie za chwilę."
[iris.bukkit.commandstudio]
hotloading = "§ePonowne wczytywanie Studio..."
@@ -643,6 +643,7 @@ no_iris_structure_this_pack_2 = "§cSem estrutura íris '{structure}' nesta pack
structure_assembled_0_pieces = "§cEstrutura{structure}' montados 0 peças"
placed_pieces_at_your_location = "§aColocado '{structure}' ({value} peças) na sua localização. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eO terreno em {x} {y} {z} ainda está a ser planeado. As peças já colocadas podem ser removidas com /iris object undo; volte a executar a colocação daqui a pouco."
[iris.bukkit.commandstudio]
hotloading = "§eA recarregar o Studio..."
@@ -648,6 +648,7 @@ no_iris_structure_this_pack_2 = "§cНет структуры радужной
structure_assembled_0_pieces = "§cСтруктура{structure}собранный 0 части"
placed_pieces_at_your_location = "§aПомещение '{structure}' ({value} куски) в вашем месте. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eРельеф в точке {x} {y} {z} ещё планируется. Уже размещённые части можно убрать командой /iris object undo; повторите размещение через мгновение."
[iris.bukkit.commandstudio]
hotloading = "§eГорячая перезагрузка Studio..."
@@ -648,6 +648,7 @@ no_iris_structure_this_pack_2 = "§cyok iris structure \"{structure}“Bu pakett
structure_assembled_0_pieces = "§cYapı \"{structure}\"Bir araya geldi\" 0 parçalar parça parçaları"
placed_pieces_at_your_location = "§ayerleştirildi ‘{structure}' ({value} parçalar) konumunuzda. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§e{x} {y} {z} konumundaki arazi hâlâ planlanıyor. Yerleştirilmiş parçaları /iris object undo ile kaldırabilirsiniz; yerleştirmeyi birazdan yeniden çalıştırın."
[iris.bukkit.commandstudio]
hotloading = "§eStudio yeniden yükleniyor..."
@@ -646,6 +646,7 @@ no_iris_structure_this_pack_2 = "§cKhông có cấu trúc Iris{structure}'Trong
structure_assembled_0_pieces = "§cCấu trúc{structure}Tập hợp 0 mảnh"
placed_pieces_at_your_location = "§aĐã đặt '{structure}' ({value} Các mảnh) tại vị trí. ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§eĐịa hình tại {x} {y} {z} vẫn đang được lập kế hoạch. Có thể gỡ các mảnh đã đặt bằng /iris object undo; hãy chạy lại lệnh đặt sau giây lát."
[iris.bukkit.commandstudio]
hotloading = "§eĐang tải lại Studio..."
@@ -646,6 +646,7 @@ no_iris_structure_this_pack_2 = "§c无Iris结构 '{structure}\"在这个包里\
structure_assembled_0_pieces = "§c结构 '{structure}组装 0 块"
placed_pieces_at_your_location = "§a已放置 '{structure}' ({value}在您的位置。 ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§e{x} {y} {z} 处的地形仍在规划中。已放置的部件可用 /iris object undo 移除;请稍后再次执行放置。"
[iris.bukkit.commandstudio]
hotloading = "§e正在热重载 Studio..."
@@ -646,6 +646,7 @@ no_iris_structure_this_pack_2 = "§c無Iris結構 '{structure}\"在這個包裡\
structure_assembled_0_pieces = "§c結構 '{structure}組裝 0 塊"
placed_pieces_at_your_location = "§a已放置 '{structure}' ({value}在您的位置。 ({value2} block changes)"
placement_changed_no_blocks = "§cStructure '{structure}' assembled {value} pieces but changed 0 blocks at your location. Check that the selected variants contain non-air blocks and that the placement is above the world's minimum height."
place_waits_for_terrain_plan = "§e{x} {y} {z} 處的地形仍在規劃中。已放置的部件可用 /iris object undo 移除;請稍後再次執行放置。"
[iris.bukkit.commandstudio]
hotloading = "§e正在熱重載 Studio..."