PaperMC/nms-patches/TileEntityBeehive.patch

32 lines
1.7 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/TileEntityBeehive.java
+++ b/net/minecraft/server/TileEntityBeehive.java
2020-01-21 22:00:00 +01:00
@@ -163,6 +163,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;
2020-01-21 22:00:00 +01:00
@@ -196,7 +197,7 @@
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);
- return this.world.addEntity(entity);
+ return true; // return this.world.addEntity(entity); // CraftBukkit - moved up
}
} else {
return false;
2020-01-21 22:00:00 +01:00
@@ -223,6 +224,11 @@
if (this.a(iblockdata, nbttagcompound, (List) null, tileentitybeehive_releasestatus)) {
iterator.remove();
}
+ // CraftBukkit start
+ else {
2020-01-21 22:00:00 +01:00
+ tileentitybeehive_hivebee.ticksInHive = tileentitybeehive_hivebee.minOccupationTicks / 2; // Not strictly Vanilla behaviour in cases where bees cannot spawn but still reasonable
+ }
+ // CraftBukkit end
} else {
2020-01-21 22:00:00 +01:00
tileentitybeehive_hivebee.ticksInHive++;
}