2017-06-11 23:27:34 +02:00
|
|
|
--- a/net/minecraft/server/EntityParrot.java
|
|
|
|
+++ b/net/minecraft/server/EntityParrot.java
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -20,7 +20,7 @@
|
2018-07-15 02:00:00 +02:00
|
|
|
};
|
2020-08-11 23:00:00 +02:00
|
|
|
private static final Item bw = Items.COOKIE;
|
|
|
|
private static final Set<Item> bx = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
|
|
|
|
- private static final Map<EntityTypes<?>, SoundEffect> by = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
|
|
|
+ private static final Map<EntityTypes<?>, SoundEffect> by = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
2018-07-15 02:00:00 +02:00
|
|
|
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
|
|
|
|
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
|
|
|
|
hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER);
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -187,7 +187,7 @@
|
2017-06-11 23:27:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.world.isClientSide) {
|
|
|
|
- if (this.random.nextInt(10) == 0) {
|
|
|
|
+ if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit
|
2019-04-23 04:00:00 +02:00
|
|
|
this.tame(entityhuman);
|
2017-06-11 23:27:34 +02:00
|
|
|
this.world.broadcastEntityEffect(this, (byte) 7);
|
2019-12-10 23:00:00 +01:00
|
|
|
} else {
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -201,7 +201,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
itemstack.subtract(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
- this.addEffect(new MobEffect(MobEffects.POISON, 900));
|
|
|
|
+ this.addEffect(new MobEffect(MobEffects.POISON, 900), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // CraftBukkit
|
2019-04-23 04:00:00 +02:00
|
|
|
if (entityhuman.isCreative() || !this.isInvulnerable()) {
|
2018-07-20 08:04:37 +02:00
|
|
|
this.damageEntity(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
|
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -315,7 +315,7 @@
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCollidable() {
|
|
|
|
- return true;
|
|
|
|
+ return super.isCollidable(); // CraftBukkit - collidable API
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -330,7 +330,7 @@
|
|
|
|
if (this.isInvulnerable(damagesource)) {
|
2017-06-24 02:01:46 +02:00
|
|
|
return false;
|
|
|
|
} else {
|
2020-06-25 02:00:00 +02:00
|
|
|
- this.setWillSit(false);
|
|
|
|
+ // this.setWillSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
|
2017-06-24 02:01:46 +02:00
|
|
|
return super.damageEntity(damagesource, f);
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
|
|
|
}
|