summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityParrot.patch
blob: 432c1d9750d76b14eac57d1e18a6b6f4af35fbe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
--- a/net/minecraft/server/EntityParrot.java
+++ b/net/minecraft/server/EntityParrot.java
@@ -15,7 +15,7 @@
     private static final DataWatcherObject<Integer> bG = DataWatcher.a(EntityParrot.class, DataWatcherRegistry.b);
     private static final Predicate<EntityInsentient> bH = new Predicate() {
         public boolean a(@Nullable EntityInsentient entityinsentient) {
-            return entityinsentient != null && EntityParrot.bK.containsKey(EntityTypes.b.a((Object) entityinsentient.getClass()));
+            return entityinsentient != null && EntityParrot.bK.containsKey(EntityTypes.b.a(entityinsentient.getClass())); // CraftBukkit - decompile error
         }
 
         public boolean apply(@Nullable Object object) {
@@ -114,7 +114,7 @@
                 EntityInsentient entityinsentient = (EntityInsentient) list.get(world.random.nextInt(list.size()));
 
                 if (!entityinsentient.isSilent()) {
-                    SoundEffect soundeffect = g(EntityTypes.b.a((Object) entityinsentient.getClass()));
+                    SoundEffect soundeffect = g(EntityTypes.b.a(entityinsentient.getClass())); // CraftBukkit - decompile error
 
                     world.a((EntityHuman) null, entity.locX, entity.locY, entity.locZ, soundeffect, entity.bK(), 0.7F, b(world.random));
                     return true;
@@ -140,7 +140,7 @@
             }
 
             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
                     this.c(entityhuman);
                     this.p(true);
                     this.world.broadcastEntityEffect(this, (byte) 7);
@@ -276,7 +276,8 @@
             return false;
         } else {
             if (this.goalSit != null) {
-                this.goalSit.setSitting(false);
+                // CraftBukkit - moved into EntityLiving.d(DamageSource, float)
+                // this.goalSit.setSitting(false);
             }
 
             return super.damageEntity(damagesource, f);
@@ -316,33 +317,35 @@
     }
 
     static {
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityBlaze.class), SoundEffects.eM);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityCaveSpider.class), SoundEffects.fc);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityCreeper.class), SoundEffects.eN);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityGuardianElder.class), SoundEffects.eO);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityEnderDragon.class), SoundEffects.eP);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityEnderman.class), SoundEffects.eQ);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityEndermite.class), SoundEffects.eR);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityEvoker.class), SoundEffects.eS);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityGhast.class), SoundEffects.eT);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityZombieHusk.class), SoundEffects.eU);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityIllagerIllusioner.class), SoundEffects.eV);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityMagmaCube.class), SoundEffects.eW);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityPigZombie.class), SoundEffects.fl);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityPolarBear.class), SoundEffects.eX);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityShulker.class), SoundEffects.eY);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntitySilverfish.class), SoundEffects.eZ);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntitySkeleton.class), SoundEffects.fa);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntitySlime.class), SoundEffects.fb);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntitySpider.class), SoundEffects.fc);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntitySkeletonStray.class), SoundEffects.fd);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityVex.class), SoundEffects.fe);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityVindicator.class), SoundEffects.ff);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityWitch.class), SoundEffects.fg);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityWither.class), SoundEffects.fh);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntitySkeletonWither.class), SoundEffects.fi);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityWolf.class), SoundEffects.fj);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityZombie.class), SoundEffects.fk);
-        EntityParrot.bK.put(EntityTypes.b.a((Object) EntityZombieVillager.class), SoundEffects.fm);
+        // CraftBukkit start
+        EntityParrot.bK.put(EntityTypes.b.a(EntityBlaze.class), SoundEffects.eM);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityCaveSpider.class), SoundEffects.fc);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityCreeper.class), SoundEffects.eN);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityGuardianElder.class), SoundEffects.eO);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityEnderDragon.class), SoundEffects.eP);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityEnderman.class), SoundEffects.eQ);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityEndermite.class), SoundEffects.eR);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityEvoker.class), SoundEffects.eS);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityGhast.class), SoundEffects.eT);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityZombieHusk.class), SoundEffects.eU);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityIllagerIllusioner.class), SoundEffects.eV);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityMagmaCube.class), SoundEffects.eW);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityPigZombie.class), SoundEffects.fl);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityPolarBear.class), SoundEffects.eX);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityShulker.class), SoundEffects.eY);
+        EntityParrot.bK.put(EntityTypes.b.a(EntitySilverfish.class), SoundEffects.eZ);
+        EntityParrot.bK.put(EntityTypes.b.a(EntitySkeleton.class), SoundEffects.fa);
+        EntityParrot.bK.put(EntityTypes.b.a(EntitySlime.class), SoundEffects.fb);
+        EntityParrot.bK.put(EntityTypes.b.a(EntitySpider.class), SoundEffects.fc);
+        EntityParrot.bK.put(EntityTypes.b.a(EntitySkeletonStray.class), SoundEffects.fd);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityVex.class), SoundEffects.fe);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityVindicator.class), SoundEffects.ff);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityWitch.class), SoundEffects.fg);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityWither.class), SoundEffects.fh);
+        EntityParrot.bK.put(EntityTypes.b.a(EntitySkeletonWither.class), SoundEffects.fi);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityWolf.class), SoundEffects.fj);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityZombie.class), SoundEffects.fk);
+        EntityParrot.bK.put(EntityTypes.b.a(EntityZombieVillager.class), SoundEffects.fm);
+        // CraftBukkit end
     }
 }