3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

fixed spawn reason for spawners (#4843)

Dieser Commit ist enthalten in:
Jake Potrebic 2020-12-03 11:54:50 -08:00 committet von GitHub
Ursprung 9bc721428f
Commit d52a9ed0fb
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 20 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -58,8 +58,20 @@ index 9368c4afa7bbb336894d73069b3c0858231d1e81..ae0f5e5a71502c432a4dcaa42a3fc9ee
// Paper end
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..f606382963f79fba8c282fa6ca820a10e9ec598d 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -162,6 +162,7 @@ public abstract class MobSpawnerAbstract {
// Spigot End
}
entity.spawnedViaMobSpawner = true; // Paper
+ entity.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER; // Paper
// Spigot Start
flag = true; // Paper
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 68ec2ef427bee5940c62b61964b5436e6ef425f6..79ab45540081c8e2f5dd1d84c6ae602f3664920f 100644
index 6c0bd57a75f7fc65f412054529793273940d9ff4..c673f3579f868b4a25a46815877289c568e7763b 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -240,7 +240,7 @@ public abstract class PlayerList {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Mob Spawner API Enhancements
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..41001b02a654194c4a8e25ad5f7af8fdd91090b2 100644
index f606382963f79fba8c282fa6ca820a10e9ec598d..820e470cdf5e6d32edae75520a5f6a5d5462b222 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -47,6 +47,7 @@ public abstract class MobSpawnerAbstract {
@ -16,7 +16,7 @@ index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..41001b02a654194c4a8e25ad5f7af8fd
private boolean h() {
BlockPosition blockposition = this.b();
@@ -207,6 +208,7 @@ public abstract class MobSpawnerAbstract {
@@ -208,6 +209,7 @@ public abstract class MobSpawnerAbstract {
}
}
@ -24,7 +24,7 @@ index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..41001b02a654194c4a8e25ad5f7af8fd
private void i() {
if (this.maxSpawnDelay <= this.minSpawnDelay) {
this.spawnDelay = this.minSpawnDelay;
@@ -224,7 +226,13 @@ public abstract class MobSpawnerAbstract {
@@ -225,7 +227,13 @@ public abstract class MobSpawnerAbstract {
}
public void a(NBTTagCompound nbttagcompound) {
@ -38,7 +38,7 @@ index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..41001b02a654194c4a8e25ad5f7af8fd
this.mobs.clear();
if (nbttagcompound.hasKeyOfType("SpawnPotentials", 9)) {
NBTTagList nbttaglist = nbttagcompound.getList("SpawnPotentials", 10);
@@ -239,10 +247,15 @@ public abstract class MobSpawnerAbstract {
@@ -240,10 +248,15 @@ public abstract class MobSpawnerAbstract {
} else if (!this.mobs.isEmpty()) {
this.setSpawnData((MobSpawnerData) WeightedRandom.a(this.a().random, this.mobs));
}
@ -57,7 +57,7 @@ index cb7cb789b82461093fbbb4c8ae6d03fcbfe57383..41001b02a654194c4a8e25ad5f7af8fd
this.spawnCount = nbttagcompound.getShort("SpawnCount");
}
@@ -267,9 +280,20 @@ public abstract class MobSpawnerAbstract {
@@ -268,9 +281,20 @@ public abstract class MobSpawnerAbstract {
if (minecraftkey == null) {
return nbttagcompound;
} else {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] only add passanger entities once from spawners
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 41001b02a654194c4a8e25ad5f7af8fdd91090b2..df494d37be687860878c2709ae7996510118a559 100644
index 820e470cdf5e6d32edae75520a5f6a5d5462b222..699e4d0d7349a50ee106209c394cdab85356d50b 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -196,7 +196,7 @@ public abstract class MobSpawnerAbstract {
@@ -197,7 +197,7 @@ public abstract class MobSpawnerAbstract {
}
private void a(Entity entity) {