3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00
Paper/nms-patches/BehaviorMakeLove.patch

32 Zeilen
1.7 KiB
Diff

2019-04-23 04:00:00 +02:00
--- a/net/minecraft/server/BehaviorMakeLove.java
+++ b/net/minecraft/server/BehaviorMakeLove.java
2019-06-21 12:00:00 +02:00
@@ -99,6 +99,11 @@
2019-04-23 04:00:00 +02:00
private Optional<EntityVillager> a(EntityVillager entityvillager, EntityVillager entityvillager1) {
EntityVillager entityvillager2 = entityvillager.createChild(entityvillager1);
+ // CraftBukkit start - call EntityBreedEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(entityvillager2, entityvillager, entityvillager1, null, null, 0).isCancelled()) {
+ return Optional.empty();
+ }
+ // CraftBukkit end
if (entityvillager2 == null) {
return Optional.empty();
2019-06-21 12:00:00 +02:00
@@ -107,7 +112,7 @@
2019-04-23 04:00:00 +02:00
entityvillager1.setAgeRaw(6000);
entityvillager2.setAgeRaw(-24000);
entityvillager2.setPositionRotation(entityvillager.locX, entityvillager.locY, entityvillager.locZ, 0.0F, 0.0F);
- entityvillager.world.addEntity(entityvillager2);
+ entityvillager.world.addEntity(entityvillager2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
entityvillager.world.broadcastEntityEffect(entityvillager2, (byte) 12);
return Optional.of(entityvillager2);
}
2019-06-21 12:00:00 +02:00
@@ -116,6 +121,6 @@
2019-04-23 04:00:00 +02:00
private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) {
2019-05-27 22:30:00 +02:00
GlobalPos globalpos = GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition);
2019-04-23 04:00:00 +02:00
2019-05-14 02:00:00 +02:00
- entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, (Object) globalpos);
+ entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error
2019-04-23 04:00:00 +02:00
}
}