diff options
author | Lulu13022002 <[email protected]> | 2024-09-21 21:19:02 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-21 21:19:02 +0200 |
commit | 1ed64f82704c299d0f7ae9af710579be995af8de (patch) | |
tree | 8de9a329fed8373ae5eccc59a9ee9558a53ee3fd /patches/server/0868-More-DragonBattle-API.patch | |
parent | 593faf4fc3ad433ef523672b6553124dd99f8ca3 (diff) | |
download | Paper-1ed64f82704c299d0f7ae9af710579be995af8de.tar.gz Paper-1ed64f82704c299d0f7ae9af710579be995af8de.zip |
Update launchProjectile API (#11300)
Diffstat (limited to 'patches/server/0868-More-DragonBattle-API.patch')
-rw-r--r-- | patches/server/0868-More-DragonBattle-API.patch | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/patches/server/0868-More-DragonBattle-API.patch b/patches/server/0868-More-DragonBattle-API.patch deleted file mode 100644 index b7b58f6c99..0000000000 --- a/patches/server/0868-More-DragonBattle-API.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 18 Dec 2022 13:40:05 -0800 -Subject: [PATCH] More DragonBattle API - -== AT == -public net.minecraft.world.level.dimension.end.EndDragonFight GATEWAY_COUNT -public net.minecraft.world.level.dimension.end.EndDragonFight gateways -public net.minecraft.world.level.dimension.end.EndDragonFight respawnCrystals -public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V - -diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index bf39f006efef529db697ed4dccbd1657a2673b79..4a0479fcff94bf6a1f239c1f694202345cdea1d4 100644 ---- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -@@ -441,6 +441,24 @@ public class EndDragonFight { - this.gateways.clear(); - } - -+ // Paper start - More DragonBattle API -+ public boolean spawnNewGatewayIfPossible() { -+ if (!this.gateways.isEmpty()) { -+ this.spawnNewGateway(); -+ return true; -+ } -+ return false; -+ } -+ -+ public List<EndCrystal> getSpikeCrystals() { -+ final List<EndCrystal> endCrystals = new java.util.ArrayList<>(); -+ for (final SpikeFeature.EndSpike spike : SpikeFeature.getSpikesForLevel(this.level)) { -+ endCrystals.addAll(this.level.getEntitiesOfClass(EndCrystal.class, spike.getTopBoundingBox())); -+ } -+ return endCrystals; -+ } -+ // Paper end - More DragonBattle API -+ - private void spawnNewGateway() { - if (!this.gateways.isEmpty()) { - int i = (Integer) this.gateways.remove(this.gateways.size() - 1); -diff --git a/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java b/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java -index dc7fdc120f4317ee1b7935ef226eddb0406aee6e..6bfabb38b51115beb2a65a165f235347838b6006 100644 ---- a/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java -+++ b/src/main/java/org/bukkit/craftbukkit/boss/CraftDragonBattle.java -@@ -137,4 +137,46 @@ public class CraftDragonBattle implements DragonBattle { - private DragonRespawnAnimation toNMSRespawnPhase(RespawnPhase phase) { - return (phase != RespawnPhase.NONE) ? DragonRespawnAnimation.values()[phase.ordinal()] : null; - } -+ // Paper start - More DragonBattle API -+ @Override -+ public int getGatewayCount() { -+ return EndDragonFight.GATEWAY_COUNT - this.handle.gateways.size(); -+ } -+ -+ @Override -+ public boolean spawnNewGateway() { -+ return this.handle.spawnNewGatewayIfPossible(); -+ } -+ -+ @Override -+ public void spawnNewGateway(final io.papermc.paper.math.Position position) { -+ this.handle.spawnNewGateway(io.papermc.paper.util.MCUtil.toBlockPos(position)); -+ } -+ -+ @Override -+ public java.util.List<org.bukkit.entity.EnderCrystal> getRespawnCrystals() { -+ if (this.handle.respawnCrystals == null) { -+ return java.util.Collections.emptyList(); -+ } -+ -+ final java.util.List<org.bukkit.entity.EnderCrystal> enderCrystals = new java.util.ArrayList<>(); -+ for (final net.minecraft.world.entity.boss.enderdragon.EndCrystal endCrystal : this.handle.respawnCrystals) { -+ if (!endCrystal.isRemoved() && endCrystal.isAlive() && endCrystal.valid) { -+ enderCrystals.add(((org.bukkit.entity.EnderCrystal) endCrystal.getBukkitEntity())); -+ } -+ } -+ return java.util.Collections.unmodifiableList(enderCrystals); -+ } -+ -+ @Override -+ public java.util.List<org.bukkit.entity.EnderCrystal> getHealingCrystals() { -+ final java.util.List<org.bukkit.entity.EnderCrystal> enderCrystals = new java.util.ArrayList<>(); -+ for (final net.minecraft.world.entity.boss.enderdragon.EndCrystal endCrystal : this.handle.getSpikeCrystals()) { -+ if (!endCrystal.isRemoved() && endCrystal.isAlive() && endCrystal.valid) { -+ enderCrystals.add(((org.bukkit.entity.EnderCrystal) endCrystal.getBukkitEntity())); -+ } -+ } -+ return java.util.Collections.unmodifiableList(enderCrystals); -+ } -+ // Paper end - More DragonBattle API - } |