Placing structures is broken
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Stack trace
[21:28:14 ERROR]: Error occurred while enabling TestStructure v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Coordinates -16, 74, 33 are not in the region
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:463) ~[guava-32.1.2-jre.jar:?]
at org.bukkit.craftbukkit.generator.CraftLimitedRegion.getBlockState(CraftLimitedRegion.java:185) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at org.bukkit.craftbukkit.util.CraftStructureTransformer.transformCraftState(CraftStructureTransformer.java:117) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.placeInWorld(StructureTemplate.java:298) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at org.bukkit.craftbukkit.structure.CraftStructure.place(CraftStructure.java:99) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at org.bukkit.craftbukkit.structure.CraftStructure.place(CraftStructure.java:65) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at TestStructure-1.0-SNAPSHOT.jar/eu.cafestube.furniture.teststructure.TestStructure.onEnable(TestStructure.java:31) ~[TestStructure-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:519) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:604) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:553) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:675) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:323) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1136) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-125-8e6554a]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Plugin and Datapack List
Test Plugin to test the issue
Actions to reproduce (if known)
- Have a larger nbt schematic(mine has a size of 22, 12, 11 according to the .nbt file)
- Place the schematic via StructureManager API (Mine was placed at -37 74 28. It doesn't happen with every set of coordinates) WITH block transformers (otherwise it works fine as far as I know)
- See the error in the console
Paper version
This server is running Paper version 1.20.6-125-master@8e6554a (2024-05-30T18:14:53Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
You are 1 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
(The 1 version I am behind is unrelated)
Other
My thrown together code of the test plugin to test this issue:
try {
Bukkit.getStructureManager().registerStructure(new NamespacedKey("test", "test"),
Bukkit.getStructureManager().loadStructure(getResource("test.nbt")));
Bukkit.getStructureManager().getStructure(new NamespacedKey("test", "test"))
.place(new Location(Bukkit.getWorlds().get(0), -37, 74, 28), true, StructureRotation.NONE, Mirror.NONE, 0, 1.0F, ThreadLocalRandom.current(), List.of(new BlockTransformer() {
@Override
public @NotNull BlockState transform(@NotNull LimitedRegion limitedRegion, int i, int i1, int i2, @NotNull BlockState blockState, @NotNull BlockTransformer.TransformationState transformationState) {
return Bukkit.createBlockData(Material.DIRT).createBlockState();
}
}), List.of((limitedRegion, i, i1, i2, entity, b) -> true));
} catch (IOException e) {
throw new RuntimeException(e);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the placement using the StructureManager API and the transformer in the provided TestStructure.onEnable code. Trace the call from CraftStructure.place through StructureTemplate.placeInWorld, CraftStructureTransformer.transformCraftState, and CraftLimitedRegion.getBlockState; done means the larger structure places at the reported coordinates with the transformer without an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100