aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/PlaceCommand.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/PlaceCommand.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/PlaceCommand.java.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/PlaceCommand.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/PlaceCommand.java.patch
new file mode 100644
index 0000000000..56cb1597d9
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/PlaceCommand.java.patch
@@ -0,0 +1,47 @@
+--- a/net/minecraft/server/commands/PlaceCommand.java
++++ b/net/minecraft/server/commands/PlaceCommand.java
+@@ -278,30 +130,20 @@
+ if (!structureStart.isValid()) {
+ throw ERROR_STRUCTURE_FAILED.create();
+ } else {
+- BoundingBox boundingBox = structureStart.getBoundingBox();
+- ChunkPos chunkPos = new ChunkPos(SectionPos.blockToSectionCoord(boundingBox.minX()), SectionPos.blockToSectionCoord(boundingBox.minZ()));
+- ChunkPos chunkPos1 = new ChunkPos(SectionPos.blockToSectionCoord(boundingBox.maxX()), SectionPos.blockToSectionCoord(boundingBox.maxZ()));
+- checkLoaded(level, chunkPos, chunkPos1);
+- ChunkPos.rangeClosed(chunkPos, chunkPos1)
+- .forEach(
+- chunkPos2 -> structureStart.placeInChunk(
+- level,
+- level.structureManager(),
+- generator,
+- level.getRandom(),
+- new BoundingBox(
+- chunkPos2.getMinBlockX(),
+- level.getMinBuildHeight(),
+- chunkPos2.getMinBlockZ(),
+- chunkPos2.getMaxBlockX(),
+- level.getMaxBuildHeight(),
+- chunkPos2.getMaxBlockZ()
+- ),
+- chunkPos2
+- )
+- );
+- String string = structure.key().location().toString();
+- source.sendSuccess(() -> Component.translatable("commands.place.structure.success", string, pos.getX(), pos.getY(), pos.getZ()), true);
++ structurestart.generationEventCause = org.bukkit.event.world.AsyncStructureGenerateEvent.Cause.COMMAND; // CraftBukkit - set AsyncStructureGenerateEvent.Cause.COMMAND as generation cause
++ BoundingBox structureboundingbox = structurestart.getBoundingBox();
++ ChunkPos chunkcoordintpair = new ChunkPos(SectionPos.blockToSectionCoord(structureboundingbox.minX()), SectionPos.blockToSectionCoord(structureboundingbox.minZ()));
++ ChunkPos chunkcoordintpair1 = new ChunkPos(SectionPos.blockToSectionCoord(structureboundingbox.maxX()), SectionPos.blockToSectionCoord(structureboundingbox.maxZ()));
++
++ checkLoaded(worldserver, chunkcoordintpair, chunkcoordintpair1);
++ ChunkPos.rangeClosed(chunkcoordintpair, chunkcoordintpair1).forEach((chunkcoordintpair2) -> {
++ structurestart.placeInChunk(worldserver, worldserver.structureManager(), chunkgenerator, worldserver.getRandom(), new BoundingBox(chunkcoordintpair2.getMinBlockX(), worldserver.getMinBuildHeight(), chunkcoordintpair2.getMinBlockZ(), chunkcoordintpair2.getMaxBlockX(), worldserver.getMaxBuildHeight(), chunkcoordintpair2.getMaxBlockZ()), chunkcoordintpair2);
++ });
++ String s = structure.key().location().toString();
++
++ source.sendSuccess(() -> {
++ return Component.translatable("commands.place.structure.success", s, pos.getX(), pos.getY(), pos.getZ());
++ }, true);
+ return 1;
+ }
+ }