mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 01:34:04 +00:00
Show the biome that placed a structure in dust
Structures start from their origin chunk's biome, cave biome, region or dimension, then reach into neighbouring biomes. Dust on a structure piece now names that owner, found from the structure plan, so it works on chunks generated before this change too. Chest markers that structures record carry the owner as well, and a placement can now be owned by the dimension.
This commit is contained in:
1 parent
ecc08197e8
commit
573e631bb8
32 files changed
+176
-48
No files matched your search
+8
-7
@@ -33,7 +33,6 @@ import art.arcane.iris.modded.ModdedEngineBootstrap;
|
||||
import art.arcane.iris.modded.ModdedScheduler;
|
||||
import art.arcane.iris.util.project.context.IrisContext;
|
||||
import art.arcane.volmlib.util.localization.MessageArgument;
|
||||
import com.volmit.config.Level;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Holder;
|
||||
@@ -296,9 +295,9 @@ public final class ModdedDustRevealer {
|
||||
? IrisLanguage.plain(RuntimeUiMessages.DUST_NONE)
|
||||
: objectKey)
|
||||
), false));
|
||||
PlacementMarkers.OwnerKey owner = objectKey == null ? null : safe(
|
||||
"object owner lookup at " + coordinates(pos),
|
||||
() -> engine.getObjectPlacementOwner(x, relativeY, z));
|
||||
PlacementMarkers.OwnerKey owner = objectKey != null
|
||||
? safe("object owner lookup at " + coordinates(pos), () -> engine.getObjectPlacementOwner(x, relativeY, z))
|
||||
: structurePiece == null ? null : structurePiece.owner().orElse(null);
|
||||
if (owner != null) {
|
||||
lines.add(new DustLine(ownerLine(owner), true));
|
||||
}
|
||||
@@ -401,9 +400,11 @@ public final class ModdedDustRevealer {
|
||||
}
|
||||
|
||||
static String ownerLine(PlacementMarkers.OwnerKey owner) {
|
||||
return owner.level() == Level.REGION
|
||||
? IrisLanguage.plain(RuntimeUiMessages.DUST_OBJECT_FROM_REGION, MessageArgument.untrusted("region", owner.key()))
|
||||
: IrisLanguage.plain(RuntimeUiMessages.DUST_OBJECT_FROM_BIOME, MessageArgument.untrusted("biome", owner.key()));
|
||||
return switch (owner.level()) {
|
||||
case REGION -> IrisLanguage.plain(RuntimeUiMessages.DUST_OBJECT_FROM_REGION, MessageArgument.untrusted("region", owner.key()));
|
||||
case DIMENSION -> IrisLanguage.plain(RuntimeUiMessages.DUST_OBJECT_FROM_DIMENSION, MessageArgument.untrusted("dimension", owner.key()));
|
||||
default -> IrisLanguage.plain(RuntimeUiMessages.DUST_OBJECT_FROM_BIOME, MessageArgument.untrusted("biome", owner.key()));
|
||||
};
|
||||
}
|
||||
|
||||
static String structurePieceLine(ModuleServices.PlannedPlacement structurePiece) {
|
||||
|
||||
Reference in new issue
Block a user