Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-17 20:10:10 +01:00
SPIGOT-5467: Don't play sound or increase honey level if bee leaving hive is cancelled
Dieser Commit ist enthalten in:
Ursprung
7d677e7b13
Commit
297ff4000e
@ -1,15 +1,23 @@
|
|||||||
--- a/net/minecraft/server/TileEntityBeehive.java
|
--- a/net/minecraft/server/TileEntityBeehive.java
|
||||||
+++ b/net/minecraft/server/TileEntityBeehive.java
|
+++ b/net/minecraft/server/TileEntityBeehive.java
|
||||||
@@ -194,7 +194,7 @@
|
@@ -161,6 +161,7 @@
|
||||||
|
if (!entity.getEntityType().a(TagsEntity.BEEHIVE_INHABITORS)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
+ if (!this.world.addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BEEHIVE)) return false; // CraftBukkit - SpawnReason, moved from below
|
||||||
|
if (entity instanceof EntityBee) {
|
||||||
|
EntityBee entitybee = (EntityBee) entity;
|
||||||
|
|
||||||
|
@@ -194,7 +195,7 @@
|
||||||
BlockPosition blockposition2 = this.getPosition();
|
BlockPosition blockposition2 = this.getPosition();
|
||||||
|
|
||||||
this.world.playSound((EntityHuman) null, (double) blockposition2.getX(), (double) blockposition2.getY(), (double) blockposition2.getZ(), SoundEffects.BLOCK_BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
this.world.playSound((EntityHuman) null, (double) blockposition2.getX(), (double) blockposition2.getY(), (double) blockposition2.getZ(), SoundEffects.BLOCK_BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||||
- return this.world.addEntity(entity);
|
- return this.world.addEntity(entity);
|
||||||
+ return this.world.addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BEEHIVE); // CraftBukkit
|
+ return true; // return this.world.addEntity(entity); // CraftBukkit - moved up
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -221,6 +221,11 @@
|
@@ -221,6 +222,11 @@
|
||||||
if (this.a(iblockdata, nbttagcompound, (List) null, tileentitybeehive_releasestatus)) {
|
if (this.a(iblockdata, nbttagcompound, (List) null, tileentitybeehive_releasestatus)) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren