#1321: Clean up some stuff which got missed during previous PRs

- Add missing CraftBukkit comment to CommandGive
- Remove no longer needed IRegistryCustom from CraftStructure conversion
- Use setBasePotionType instead of deprecated setBasePotionData

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2023-12-26 07:44:21 +11:00
parent fd3e1799d3
commit 61052d56b5
7 changed files with 8 additions and 12 deletions

View File

@@ -63,7 +63,7 @@ public class CraftStructureTransformer {
private EntityTransformer[] entityTransformers;
public CraftStructureTransformer(Cause cause, GeneratorAccessSeed generatoraccessseed, StructureManager structuremanager, Structure structure, StructureBoundingBox structureboundingbox, ChunkCoordIntPair chunkcoordintpair) {
AsyncStructureGenerateEvent event = new AsyncStructureGenerateEvent(structuremanager.level.getMinecraftWorld().getWorld(), !Bukkit.isPrimaryThread(), cause, CraftStructure.minecraftToBukkit(structure, structuremanager.registryAccess()), new org.bukkit.util.BoundingBox(structureboundingbox.minX(), structureboundingbox.minY(), structureboundingbox.minZ(), structureboundingbox.maxX(), structureboundingbox.maxY(), structureboundingbox.maxZ()), chunkcoordintpair.x, chunkcoordintpair.z);
AsyncStructureGenerateEvent event = new AsyncStructureGenerateEvent(structuremanager.level.getMinecraftWorld().getWorld(), !Bukkit.isPrimaryThread(), cause, CraftStructure.minecraftToBukkit(structure), new org.bukkit.util.BoundingBox(structureboundingbox.minX(), structureboundingbox.minY(), structureboundingbox.minZ(), structureboundingbox.maxX(), structureboundingbox.maxY(), structureboundingbox.maxZ()), chunkcoordintpair.x, chunkcoordintpair.z);
Bukkit.getPluginManager().callEvent(event);
this.blockTransformers = event.getBlockTransformers().values().toArray(BlockTransformer[]::new);
this.entityTransformers = event.getEntityTransformers().values().toArray(EntityTransformer[]::new);