Fix Shafts

This commit is contained in:
Brian Neumann-Fopiano
2026-02-22 07:09:59 -05:00
parent 2ca8cc7ad3
commit 130073989d
7 changed files with 1151 additions and 169 deletions
File diff suppressed because it is too large Load Diff
@@ -341,6 +341,8 @@ public class ServerConfigurator {
definition.isReplaceVanilla(),
definition.isSupportSmartBore(),
definition.getReplaceTargets(),
definition.getStructureAliases(),
definition.getStructureSetAliases(),
definition.getStructurePatches(),
Set.of(),
scopeKey,
@@ -370,6 +372,8 @@ public class ServerConfigurator {
group.replaceVanilla(),
definition.isSupportSmartBore(),
definition.getReplaceTargets(),
definition.getStructureAliases(),
definition.getStructureSetAliases(),
definition.getStructurePatches(),
group.forcedBiomeKeys(),
group.scopeKey(),
@@ -28,6 +28,7 @@ import art.arcane.volmlib.util.director.annotations.Director;
import art.arcane.volmlib.util.director.annotations.Param;
import art.arcane.iris.util.common.director.specialhandlers.ObjectHandler;
import art.arcane.iris.util.common.format.C;
import art.arcane.iris.util.common.plugin.VolmitSender;
import art.arcane.iris.util.common.scheduling.J;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -106,15 +107,20 @@ public class CommandFind implements DirectorExecutor {
}
Set<String> structures = ExternalDataPackPipeline.resolveLocateStructuresForObjectKey(object);
VolmitSender commandSender = sender();
if (structures.isEmpty()) {
sender().sendMessage(C.RED + object + " is not configured in any region/biome object placements and has no external structure mapping.");
sender().sendMessage(C.GRAY + "Try /iris locateexternal <datapack-id> for external structure lookups.");
if (commandSender != null) {
commandSender.sendMessage(C.RED + object + " is not configured in any region/biome object placements and has no external structure mapping.");
commandSender.sendMessage(C.GRAY + "Try /iris locateexternal <datapack-id> for external structure lookups.");
}
return;
}
Player target = player();
if (target == null) {
sender().sendMessage(C.RED + "No active player sender was available for object lookup.");
if (commandSender != null) {
commandSender.sendMessage(C.RED + "No active player sender was available for object lookup.");
}
return;
}
@@ -124,21 +130,31 @@ public class CommandFind implements DirectorExecutor {
String command = "locate structure " + structure;
boolean accepted = Bukkit.dispatchCommand(target, command);
if (!accepted) {
sender().sendMessage(C.RED + "Failed to dispatch: /" + command);
if (commandSender != null) {
commandSender.sendMessage(C.RED + "Failed to dispatch: /" + command);
}
} else {
sender().sendMessage(C.GREEN + "Dispatched: /" + command);
if (commandSender != null) {
commandSender.sendMessage(C.GREEN + "Dispatched: /" + command);
}
dispatched++;
}
}
if (teleport) {
sender().sendMessage(C.YELLOW + "External object lookups are structure-backed and dispatch locate commands instead of direct teleport.");
if (commandSender != null) {
commandSender.sendMessage(C.YELLOW + "External object lookups are structure-backed and dispatch locate commands instead of direct teleport.");
}
}
if (commandSender != null) {
commandSender.sendMessage(C.GREEN + "External object mapping matched locateTargets=" + structures.size() + ", dispatched=" + dispatched + ".");
}
sender().sendMessage(C.GREEN + "External object mapping matched locateTargets=" + structures.size() + ", dispatched=" + dispatched + ".");
};
if (!J.runEntity(target, dispatchTask)) {
sender().sendMessage(C.RED + "Failed to schedule external object locate dispatch on your region thread.");
if (commandSender != null) {
commandSender.sendMessage(C.RED + "Failed to schedule external object locate dispatch on your region thread.");
}
}
}
}
@@ -35,6 +35,14 @@ public class IrisExternalDatapack {
@Desc("Explicit replacement targets for minecraft namespace assets")
private IrisExternalDatapackReplaceTargets replaceTargets = new IrisExternalDatapackReplaceTargets();
@ArrayType(type = IrisExternalDatapackStructureAlias.class, min = 1)
@Desc("Optional structure alias mappings used to synthesize vanilla structure replacements from non-minecraft source keys")
private KList<IrisExternalDatapackStructureAlias> structureAliases = new KList<>();
@ArrayType(type = IrisExternalDatapackStructureSetAlias.class, min = 1)
@Desc("Optional structure-set alias mappings used to synthesize vanilla structure_set replacements from non-minecraft source keys")
private KList<IrisExternalDatapackStructureSetAlias> structureSetAliases = new KList<>();
@ArrayType(type = IrisExternalDatapackStructurePatch.class, min = 1)
@Desc("Structure placement patches applied when this external datapack is projected")
private KList<IrisExternalDatapackStructurePatch> structurePatches = new KList<>();
@@ -0,0 +1,20 @@
package art.arcane.iris.engine.object;
import art.arcane.iris.engine.object.annotations.Desc;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Desc("Maps a vanilla structure replacement target to a source structure key from an external datapack")
public class IrisExternalDatapackStructureAlias {
@Desc("Vanilla replacement target structure id")
private String target = "";
@Desc("Source structure id to clone when the target id is not provided directly")
private String source = "";
}
@@ -0,0 +1,20 @@
package art.arcane.iris.engine.object;
import art.arcane.iris.engine.object.annotations.Desc;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Desc("Maps a vanilla structure_set replacement target to a source structure_set key from an external datapack")
public class IrisExternalDatapackStructureSetAlias {
@Desc("Vanilla replacement target structure_set id")
private String target = "";
@Desc("Source structure_set id to clone when the target id is not provided directly")
private String source = "";
}