Allow changing the EnderDragon podium

This commit is contained in:
Doc
2022-04-03 11:31:42 -04:00
parent 96c7383ba4
commit 3dc8a5ce57
7 changed files with 128 additions and 22 deletions

View File

@@ -73,4 +73,22 @@ public class CraftEnderDragon extends CraftMob implements EnderDragon, CraftEnem
public int getDeathAnimationTicks() {
return this.getHandle().dragonDeathTime;
}
// Paper start - Allow changing the EnderDragon podium
@Override
public org.bukkit.Location getPodium() {
net.minecraft.core.BlockPos blockPosOrigin = this.getHandle().getPodium();
return new org.bukkit.Location(getWorld(), blockPosOrigin.getX(), blockPosOrigin.getY(), blockPosOrigin.getZ());
}
@Override
public void setPodium(org.bukkit.Location location) {
if (location == null) {
this.getHandle().setPodium(null);
} else {
org.apache.commons.lang.Validate.isTrue(location.getWorld() == null || location.getWorld().equals(getWorld()), "You cannot set a podium in a different world to where the dragon is");
this.getHandle().setPodium(io.papermc.paper.util.MCUtil.toBlockPos(location));
}
}
// Paper end - Allow changing the EnderDragon podium
}