aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch
new file mode 100644
index 0000000000..7ece9183c9
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/monster/WitherSkeleton.java.patch
@@ -0,0 +1,110 @@
+--- a/net/minecraft/world/entity/monster/WitherSkeleton.java
++++ b/net/minecraft/world/entity/monster/WitherSkeleton.java
+@@ -11,23 +11,25 @@
+ 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.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);
+ this.setPathfindingMalus(BlockPathTypes.LAVA, 8.0F);
+@@ -62,10 +64,17 @@
+ @Override
+ protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHit) {
+ super.dropCustomDeathLoot(source, looting, recentlyHit);
+- if (source.getEntity() instanceof Creeper creeper && creeper.canDropMobsSkull()) {
+- creeper.increaseDroppedSkulls();
+- this.spawnAtLocation(Items.WITHER_SKELETON_SKULL);
++ Entity entity = source.getEntity();
++
++ if (entity instanceof Creeper) {
++ Creeper entitycreeper = (Creeper) entity;
++
++ if (entitycreeper.canDropMobsSkull()) {
++ entitycreeper.increaseDroppedSkulls();
++ this.spawnAtLocation((IMaterial) Items.WITHER_SKELETON_SKULL);
++ }
+ }
++
+ }
+
+ @Override
+@@ -74,22 +83,20 @@
+ }
+
+ @Override
+- protected void populateDefaultEquipmentEnchantments(RandomSource random, DifficultyInstance difficulty) {
+- }
++ protected void populateDefaultEquipmentEnchantments(RandomSource random, DifficultyInstance difficulty) {}
+
+ @Nullable
+ @Override
+- public SpawnGroupData finalizeSpawn(
+- ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType reason, @Nullable SpawnGroupData spawnData, @Nullable CompoundTag dataTag
+- ) {
+- SpawnGroupData spawnGroupData = super.finalizeSpawn(level, difficulty, reason, spawnData, dataTag);
+- this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(4.0);
++ 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 spawnGroupData;
++ return groupdataentity1;
+ }
+
+ @Override
+- protected float getStandingEyeHeight(Pose pose, EntityDimensions size) {
++ protected float getStandingEyeHeight(EntityPose pose, EntityDimensions size) {
+ return 2.1F;
+ }
+
+@@ -104,7 +111,7 @@
+ 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;
+@@ -113,13 +120,14 @@
+
+ @Override
+ protected AbstractArrow getArrow(ItemStack arrowStack, float distanceFactor) {
+- AbstractArrow abstractArrow = super.getArrow(arrowStack, distanceFactor);
+- abstractArrow.setSecondsOnFire(100);
+- return abstractArrow;
++ AbstractArrow entityarrow = super.getArrow(arrowStack, distanceFactor);
++
++ entityarrow.setSecondsOnFire(100);
++ return entityarrow;
+ }
+
+ @Override
+ public boolean canBeAffected(MobEffectInstance potioneffect) {
+- return potioneffect.getEffect() != MobEffects.WITHER && super.canBeAffected(potioneffect);
++ return potioneffect.getEffect() == MobEffects.WITHER ? false : super.canBeAffected(potioneffect);
+ }
+ }