aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch
blob: ecca70df29e4dc22b79fbbc2916f561aa2d18e6b (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
--- a/net/minecraft/world/entity/monster/WitherSkeleton.java
+++ b/net/minecraft/world/entity/monster/WitherSkeleton.java
@@ -11,119 +11,107 @@
 import net.minecraft.world.effect.MobEffects;
 import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.EntityDimensions;
+import net.minecraft.world.entity.EntityPose;
 import net.minecraft.world.entity.EntityType;
+import net.minecraft.world.entity.EnumMobSpawn;
 import net.minecraft.world.entity.EquipmentSlot;
+import net.minecraft.world.entity.GroupDataEntity;
 import net.minecraft.world.entity.LivingEntity;
-import net.minecraft.world.entity.MobSpawnType;
-import net.minecraft.world.entity.Pose;
-import net.minecraft.world.entity.SpawnGroupData;
 import net.minecraft.world.entity.ai.attributes.Attributes;
 import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
 import net.minecraft.world.entity.monster.piglin.AbstractPiglin;
 import net.minecraft.world.entity.projectile.AbstractArrow;
 import net.minecraft.world.item.ItemStack;
 import net.minecraft.world.item.Items;
-import net.minecraft.world.level.ItemLike;
+import net.minecraft.world.level.IMaterial;
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.ServerLevelAccessor;
 import net.minecraft.world.level.pathfinder.BlockPathTypes;
 
 public class WitherSkeleton extends AbstractSkeleton {
 
-    public WitherSkeleton(EntityType<? extends WitherSkeleton> entitytype, Level level) {
-        super(entitytype, level);
+    public WitherSkeleton(EntityType<? extends WitherSkeleton> entityType, Level level) {
+        super(entityType, level);
         this.setPathfindingMalus(BlockPathTypes.LAVA, 8.0F);
     }
 
     @Override
-    @Override
     protected void registerGoals() {
         this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractPiglin.class, true));
         super.registerGoals();
     }
 
     @Override
-    @Override
     protected SoundEvent getAmbientSound() {
         return SoundEvents.WITHER_SKELETON_AMBIENT;
     }
 
     @Override
-    @Override
-    protected SoundEvent getHurtSound(DamageSource damagesource) {
+    protected SoundEvent getHurtSound(DamageSource damageSource) {
         return SoundEvents.WITHER_SKELETON_HURT;
     }
 
     @Override
-    @Override
     protected SoundEvent getDeathSound() {
         return SoundEvents.WITHER_SKELETON_DEATH;
     }
 
     @Override
-    @Override
     SoundEvent getStepSound() {
         return SoundEvents.WITHER_SKELETON_STEP;
     }
 
     @Override
-    @Override
-    protected void dropCustomDeathLoot(DamageSource damagesource, int i, boolean flag) {
-        super.dropCustomDeathLoot(damagesource, i, flag);
-        Entity entity = damagesource.getEntity();
+    protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHit) {
+        super.dropCustomDeathLoot(source, looting, recentlyHit);
+        Entity entity = source.getEntity();
 
         if (entity instanceof Creeper) {
-            Creeper creeper = (Creeper) entity;
+            Creeper entitycreeper = (Creeper) entity;
 
-            if (creeper.canDropMobsSkull()) {
-                creeper.increaseDroppedSkulls();
-                this.spawnAtLocation((ItemLike) Items.WITHER_SKELETON_SKULL);
+            if (entitycreeper.canDropMobsSkull()) {
+                entitycreeper.increaseDroppedSkulls();
+                this.spawnAtLocation((IMaterial) Items.WITHER_SKELETON_SKULL);
             }
         }
 
     }
 
     @Override
-    @Override
-    protected void populateDefaultEquipmentSlots(RandomSource randomsource, DifficultyInstance difficultyinstance) {
+    protected void populateDefaultEquipmentSlots(RandomSource random, DifficultyInstance difficulty) {
         this.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD));
     }
 
     @Override
-    @Override
-    protected void populateDefaultEquipmentEnchantments(RandomSource randomsource, DifficultyInstance difficultyinstance) {}
+    protected void populateDefaultEquipmentEnchantments(RandomSource random, DifficultyInstance difficulty) {}
 
     @Nullable
     @Override
-    @Override
-    public SpawnGroupData finalizeSpawn(ServerLevelAccessor serverlevelaccessor, DifficultyInstance difficultyinstance, MobSpawnType mobspawntype, @Nullable SpawnGroupData spawngroupdata, @Nullable CompoundTag compoundtag) {
-        SpawnGroupData spawngroupdata1 = super.finalizeSpawn(serverlevelaccessor, difficultyinstance, mobspawntype, spawngroupdata, compoundtag);
+    public GroupDataEntity finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, EnumMobSpawn reason, @Nullable GroupDataEntity spawnData, @Nullable CompoundTag dataTag) {
+        GroupDataEntity groupdataentity1 = super.finalizeSpawn(level, difficulty, reason, spawnData, dataTag);
 
         this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(4.0D);
         this.reassessWeaponGoal();
-        return spawngroupdata1;
+        return groupdataentity1;
     }
 
     @Override
-    @Override
-    protected float getStandingEyeHeight(Pose pose, EntityDimensions entitydimensions) {
+    protected float getStandingEyeHeight(EntityPose pose, EntityDimensions size) {
         return 2.1F;
     }
 
     @Override
-    @Override
     protected float ridingOffset(Entity entity) {
         return -0.875F;
     }
 
     @Override
-    @Override
     public boolean doHurtTarget(Entity entity) {
         if (!super.doHurtTarget(entity)) {
             return false;
         } else {
             if (entity instanceof LivingEntity) {
-                ((LivingEntity) entity).addEffect(new MobEffectInstance(MobEffects.WITHER, 200), this);
+                ((LivingEntity) entity).addEffect(new MobEffectInstance(MobEffects.WITHER, 200), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
             }
 
             return true;
@@ -131,17 +119,15 @@
     }
 
     @Override
-    @Override
-    protected AbstractArrow getArrow(ItemStack itemstack, float f) {
-        AbstractArrow abstractarrow = super.getArrow(itemstack, f);
+    protected AbstractArrow getArrow(ItemStack arrowStack, float distanceFactor) {
+        AbstractArrow entityarrow = super.getArrow(arrowStack, distanceFactor);
 
-        abstractarrow.setSecondsOnFire(100);
-        return abstractarrow;
+        entityarrow.setSecondsOnFire(100);
+        return entityarrow;
     }
 
     @Override
-    @Override
-    public boolean canBeAffected(MobEffectInstance mobeffectinstance) {
-        return mobeffectinstance.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(mobeffectinstance);
+    public boolean canBeAffected(MobEffectInstance potioneffect) {
+        return potioneffect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(potioneffect);
     }
 }