diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Spider.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Spider.java.patch | 260 |
1 files changed, 260 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Spider.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Spider.java.patch new file mode 100644 index 0000000000..37be51da3e --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Spider.java.patch @@ -0,0 +1,260 @@ +--- a/net/minecraft/world/entity/monster/Spider.java ++++ b/net/minecraft/world/entity/monster/Spider.java +@@ -17,12 +17,12 @@ + 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.EnumMonsterType; ++import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.LivingEntity; +-import net.minecraft.world.entity.MobSpawnType; +-import net.minecraft.world.entity.MobType; +-import net.minecraft.world.entity.Pose; +-import net.minecraft.world.entity.SpawnGroupData; + import net.minecraft.world.entity.ai.attributes.AttributeSupplier; + import net.minecraft.world.entity.ai.attributes.Attributes; + import net.minecraft.world.entity.ai.goal.FloatGoal; +@@ -40,7 +40,7 @@ + import net.minecraft.world.level.Level; + import net.minecraft.world.level.ServerLevelAccessor; + import net.minecraft.world.level.block.Blocks; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.Vec3; + import org.joml.Vector3f; + +@@ -49,12 +49,11 @@ + private static final EntityDataAccessor<Byte> DATA_FLAGS_ID = SynchedEntityData.defineId(Spider.class, EntityDataSerializers.BYTE); + private static final float SPIDER_SPECIAL_EFFECT_CHANCE = 0.1F; + +- public Spider(EntityType<? extends Spider> entitytype, Level level) { +- super(entitytype, level); ++ public Spider(EntityType<? extends Spider> entityType, Level level) { ++ super(entityType, level); + } + + @Override +- @Override + protected void registerGoals() { + this.goalSelector.addGoal(1, new FloatGoal(this)); + this.goalSelector.addGoal(3, new LeapAtTargetGoal(this, 0.4F)); +@@ -68,26 +67,22 @@ + } + + @Override +- @Override +- protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitydimensions, float f) { +- return new Vector3f(0.0F, entitydimensions.height * 0.85F, 0.0F); ++ protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entitysize, float f) { ++ return new Vector3f(0.0F, entitysize.height * 0.85F, 0.0F); + } + + @Override +- @Override + protected PathNavigation createNavigation(Level level) { + return new WallClimberNavigation(this, level); + } + + @Override +- @Override + protected void defineSynchedData() { + super.defineSynchedData(); + this.entityData.define(Spider.DATA_FLAGS_ID, (byte) 0); + } + + @Override +- @Override + public void tick() { + super.tick(); + if (!this.level().isClientSide) { +@@ -101,64 +96,56 @@ + } + + @Override +- @Override + protected SoundEvent getAmbientSound() { + return SoundEvents.SPIDER_AMBIENT; + } + + @Override +- @Override +- protected SoundEvent getHurtSound(DamageSource damagesource) { ++ protected SoundEvent getHurtSound(DamageSource damageSource) { + return SoundEvents.SPIDER_HURT; + } + + @Override +- @Override + protected SoundEvent getDeathSound() { + return SoundEvents.SPIDER_DEATH; + } + + @Override +- @Override +- protected void playStepSound(BlockPos blockpos, BlockState blockstate) { ++ protected void playStepSound(BlockPos pos, IBlockData block) { + this.playSound(SoundEvents.SPIDER_STEP, 0.15F, 1.0F); + } + + @Override +- @Override + public boolean onClimbable() { + return this.isClimbing(); + } + + @Override +- @Override +- public void makeStuckInBlock(BlockState blockstate, Vec3 vec3) { +- if (!blockstate.is(Blocks.COBWEB)) { +- super.makeStuckInBlock(blockstate, vec3); ++ public void makeStuckInBlock(IBlockData state, Vec3 motionMultiplier) { ++ if (!state.is(Blocks.COBWEB)) { ++ super.makeStuckInBlock(state, motionMultiplier); + } + + } + + @Override +- @Override +- public MobType getMobType() { +- return MobType.ARTHROPOD; ++ public EnumMonsterType getMobType() { ++ return EnumMonsterType.ARTHROPOD; + } + + @Override +- @Override +- public boolean canBeAffected(MobEffectInstance mobeffectinstance) { +- return mobeffectinstance.getEffect() == MobEffects.POISON ? false : super.canBeAffected(mobeffectinstance); ++ public boolean canBeAffected(MobEffectInstance potioneffect) { ++ return potioneffect.getEffect() == MobEffects.POISON ? false : super.canBeAffected(potioneffect); + } + + public boolean isClimbing() { + return ((Byte) this.entityData.get(Spider.DATA_FLAGS_ID) & 1) != 0; + } + +- public void setClimbing(boolean flag) { ++ public void setClimbing(boolean climbing) { + byte b0 = (Byte) this.entityData.get(Spider.DATA_FLAGS_ID); + +- if (flag) { ++ if (climbing) { + b0 = (byte) (b0 | 1); + } else { + b0 &= -2; +@@ -169,48 +156,45 @@ + + @Nullable + @Override +- @Override +- public SpawnGroupData finalizeSpawn(ServerLevelAccessor serverlevelaccessor, DifficultyInstance difficultyinstance, MobSpawnType mobspawntype, @Nullable SpawnGroupData spawngroupdata, @Nullable CompoundTag compoundtag) { +- Object object = super.finalizeSpawn(serverlevelaccessor, difficultyinstance, mobspawntype, spawngroupdata, compoundtag); +- RandomSource randomsource = serverlevelaccessor.getRandom(); ++ public GroupDataEntity finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, EnumMobSpawn reason, @Nullable GroupDataEntity spawnData, @Nullable CompoundTag dataTag) { ++ Object object = super.finalizeSpawn(level, difficulty, reason, spawnData, dataTag); ++ RandomSource randomsource = level.getRandom(); + + if (randomsource.nextInt(100) == 0) { +- Skeleton skeleton = (Skeleton) EntityType.SKELETON.create(this.level()); ++ Skeleton entityskeleton = (Skeleton) EntityType.SKELETON.create(this.level()); + +- if (skeleton != null) { +- skeleton.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F); +- skeleton.finalizeSpawn(serverlevelaccessor, difficultyinstance, mobspawntype, (SpawnGroupData) null, (CompoundTag) null); +- skeleton.startRiding(this); ++ if (entityskeleton != null) { ++ entityskeleton.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F); ++ entityskeleton.finalizeSpawn(level, difficulty, reason, (GroupDataEntity) null, (CompoundTag) null); ++ entityskeleton.startRiding(this); + } + } + + if (object == null) { + object = new Spider.SpiderEffectsGroupData(); +- if (serverlevelaccessor.getDifficulty() == Difficulty.HARD && randomsource.nextFloat() < 0.1F * difficultyinstance.getSpecialMultiplier()) { ++ if (level.getDifficulty() == Difficulty.HARD && randomsource.nextFloat() < 0.1F * difficulty.getSpecialMultiplier()) { + ((Spider.SpiderEffectsGroupData) object).setRandomEffect(randomsource); + } + } + + if (object instanceof Spider.SpiderEffectsGroupData) { +- Spider.SpiderEffectsGroupData spider_spidereffectsgroupdata = (Spider.SpiderEffectsGroupData) object; +- MobEffect mobeffect = spider_spidereffectsgroupdata.effect; ++ Spider.SpiderEffectsGroupData entityspider_groupdataspider = (Spider.SpiderEffectsGroupData) object; ++ MobEffect mobeffectlist = entityspider_groupdataspider.effect; + +- if (mobeffect != null) { +- this.addEffect(new MobEffectInstance(mobeffect, -1)); ++ if (mobeffectlist != null) { ++ this.addEffect(new MobEffectInstance(mobeffectlist, -1), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.SPIDER_SPAWN); // CraftBukkit + } + } + +- return (SpawnGroupData) object; ++ return (GroupDataEntity) object; + } + + @Override +- @Override +- protected float getStandingEyeHeight(Pose pose, EntityDimensions entitydimensions) { ++ protected float getStandingEyeHeight(EntityPose pose, EntityDimensions size) { + return 0.65F; + } + + @Override +- @Override + protected float ridingOffset(Entity entity) { + return entity.getBbWidth() <= this.getBbWidth() ? -0.3125F : 0.0F; + } +@@ -222,13 +206,11 @@ + } + + @Override +- @Override + public boolean canUse() { + return super.canUse() && !this.mob.isVehicle(); + } + + @Override +- @Override + public boolean canContinueToUse() { + float f = this.mob.getLightLevelDependentMagicValue(); + +@@ -243,12 +225,11 @@ + + private static class SpiderTargetGoal<T extends LivingEntity> extends NearestAttackableTargetGoal<T> { + +- public SpiderTargetGoal(Spider spider, Class<T> oclass) { +- super(spider, oclass, true); ++ public SpiderTargetGoal(Spider spider, Class<T> entityTypeToTarget) { ++ super(spider, entityTypeToTarget, true); + } + + @Override +- @Override + public boolean canUse() { + float f = this.mob.getLightLevelDependentMagicValue(); + +@@ -256,15 +237,15 @@ + } + } + +- public static class SpiderEffectsGroupData implements SpawnGroupData { ++ public static class SpiderEffectsGroupData implements GroupDataEntity { + + @Nullable + public MobEffect effect; + + public SpiderEffectsGroupData() {} + +- public void setRandomEffect(RandomSource randomsource) { +- int i = randomsource.nextInt(5); ++ public void setRandomEffect(RandomSource random) { ++ int i = random.nextInt(5); + + if (i <= 1) { + this.effect = MobEffects.MOVEMENT_SPEED; |