3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00
Paper/nms-patches/MobSpawnerAbstract.patch

40 Zeilen
1.7 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/MobSpawnerAbstract.java
+++ b/net/minecraft/server/MobSpawnerAbstract.java
2018-01-24 07:18:25 +01:00
@@ -12,13 +12,13 @@
private MobSpawnerData spawnData = new MobSpawnerData();
private double d;
private double e;
- private int minSpawnDelay = 200;
- private int maxSpawnDelay = 800;
- private int spawnCount = 4;
+ public int minSpawnDelay = 200; // CraftBukkit private -> public
+ public int maxSpawnDelay = 800; // CraftBukkit private -> public
+ public int spawnCount = 4; // CraftBukkit private -> public
private Entity i;
- private int maxNearbyEntities = 6;
- private int requiredPlayerRange = 16;
- private int spawnRange = 4;
+ public int maxNearbyEntities = 6; // CraftBukkit private -> public
+ public int requiredPlayerRange = 16; // CraftBukkit private -> public
+ public int spawnRange = 4; // CraftBukkit private -> public
public MobSpawnerAbstract() {}
@@ -32,6 +32,7 @@
public void setMobName(@Nullable MinecraftKey minecraftkey) {
if (minecraftkey != null) {
this.spawnData.b().setString("id", minecraftkey.toString());
+ this.mobs.clear(); // CraftBukkit - SPIGOT-3496, MC-92282
}
}
@@ -102,7 +103,7 @@
2016-02-29 22:32:46 +01:00
((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null);
}
- ChunkRegionLoader.a(entity, world);
+ ChunkRegionLoader.a(entity, world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
world.triggerEffect(2004, blockposition, 0);
if (entityinsentient != null) {
entityinsentient.doSpawnEffect();