Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 21:10:10 +01:00
Added EntityTame event. Fixes BUKKIT-1109
Dieser Commit ist enthalten in:
Ursprung
e625999f24
Commit
fce3386aa0
@ -115,7 +115,8 @@ public class EntityOcelot extends EntityTameableAnimal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
if (this.random.nextInt(3) == 0) {
|
// CraftBukkit - added event call and isCancelled check.
|
||||||
|
if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
|
||||||
this.setTamed(true);
|
this.setTamed(true);
|
||||||
this.setCatType(1 + this.world.random.nextInt(3));
|
this.setCatType(1 + this.world.random.nextInt(3));
|
||||||
this.setOwnerName(entityhuman.name);
|
this.setOwnerName(entityhuman.name);
|
||||||
|
@ -186,7 +186,8 @@ public class EntityWolf extends EntityTameableAnimal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
if (this.random.nextInt(3) == 0) {
|
// CraftBukkit - added event call and isCancelled check.
|
||||||
|
if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) {
|
||||||
this.setTamed(true);
|
this.setTamed(true);
|
||||||
this.setPathEntity((PathEntity) null);
|
this.setPathEntity((PathEntity) null);
|
||||||
this.b((EntityLiving) null);
|
this.b((EntityLiving) null);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren