aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Evoker.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Evoker.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Evoker.java.patch379
1 files changed, 379 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Evoker.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Evoker.java.patch
new file mode 100644
index 0000000000..1a3b8ee1a8
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/monster/Evoker.java.patch
@@ -0,0 +1,379 @@
+--- a/net/minecraft/world/entity/monster/Evoker.java
++++ b/net/minecraft/world/entity/monster/Evoker.java
+@@ -12,11 +12,11 @@
+ import net.minecraft.world.damagesource.DamageSource;
+ import net.minecraft.world.entity.Entity;
+ 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.Mob;
+-import net.minecraft.world.entity.MobSpawnType;
+-import net.minecraft.world.entity.MobType;
+-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.AvoidEntityGoal;
+@@ -35,7 +35,7 @@
+ import net.minecraft.world.item.DyeColor;
+ import net.minecraft.world.level.GameRules;
+ import net.minecraft.world.level.Level;
+-import net.minecraft.world.level.block.state.BlockState;
++import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.gameevent.GameEvent;
+ import net.minecraft.world.phys.Vec3;
+ import net.minecraft.world.phys.shapes.VoxelShape;
+@@ -46,13 +46,12 @@
+ @Nullable
+ private Sheep wololoTarget;
+
+- public Evoker(EntityType<? extends Evoker> entitytype, Level level) {
+- super(entitytype, level);
++ public Evoker(EntityType<? extends Evoker> entityType, Level level) {
++ super(entityType, level);
+ this.xpReward = 10;
+ }
+
+ @Override
+- @Override
+ protected void registerGoals() {
+ super.registerGoals();
+ this.goalSelector.addGoal(0, new FloatGoal(this));
+@@ -75,61 +74,52 @@
+ }
+
+ @Override
+- @Override
+ protected void defineSynchedData() {
+ super.defineSynchedData();
+ }
+
+ @Override
+- @Override
+- public void readAdditionalSaveData(CompoundTag compoundtag) {
+- super.readAdditionalSaveData(compoundtag);
++ public void readAdditionalSaveData(CompoundTag compound) {
++ super.readAdditionalSaveData(compound);
+ }
+
+ @Override
+- @Override
+ public SoundEvent getCelebrateSound() {
+ return SoundEvents.EVOKER_CELEBRATE;
+ }
+
+ @Override
+- @Override
+- public void addAdditionalSaveData(CompoundTag compoundtag) {
+- super.addAdditionalSaveData(compoundtag);
++ public void addAdditionalSaveData(CompoundTag compound) {
++ super.addAdditionalSaveData(compound);
+ }
+
+ @Override
+- @Override
+ protected void customServerAiStep() {
+ super.customServerAiStep();
+ }
+
+ @Override
+- @Override
+ public boolean isAlliedTo(Entity entity) {
+- return entity == null ? false : (entity == this ? true : (super.isAlliedTo(entity) ? true : (entity instanceof Vex ? this.isAlliedTo((Entity) ((Vex) entity).getOwner()) : (entity instanceof LivingEntity && ((LivingEntity) entity).getMobType() == MobType.ILLAGER ? this.getTeam() == null && entity.getTeam() == null : false))));
++ return entity == null ? false : (entity == this ? true : (super.isAlliedTo(entity) ? true : (entity instanceof Vex ? this.isAlliedTo((Entity) ((Vex) entity).getOwner()) : (entity instanceof LivingEntity && ((LivingEntity) entity).getMobType() == EnumMonsterType.ILLAGER ? this.getTeam() == null && entity.getTeam() == null : false))));
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getAmbientSound() {
+ return SoundEvents.EVOKER_AMBIENT;
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getDeathSound() {
+ return SoundEvents.EVOKER_DEATH;
+ }
+
+ @Override
+- @Override
+- protected SoundEvent getHurtSound(DamageSource damagesource) {
++ protected SoundEvent getHurtSound(DamageSource damageSource) {
+ return SoundEvents.EVOKER_HURT;
+ }
+
+- void setWololoTarget(@Nullable Sheep sheep) {
+- this.wololoTarget = sheep;
++ void setWololoTarget(@Nullable Sheep wololoTarget) {
++ this.wololoTarget = wololoTarget;
+ }
+
+ @Nullable
+@@ -138,14 +128,12 @@
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getCastingSoundEvent() {
+ return SoundEvents.EVOKER_CAST_SPELL;
+ }
+
+ @Override
+- @Override
+- public void applyRaidBuffs(int i, boolean flag) {}
++ public void applyRaidBuffs(int wave, boolean unusedFalse) {}
+
+ private class EvokerCastingSpellGoal extends SpellcasterIllager.SpellcasterCastingSpellGoal {
+
+@@ -154,7 +142,6 @@
+ }
+
+ @Override
+- @Override
+ public void tick() {
+ if (Evoker.this.getTarget() != null) {
+ Evoker.this.getLookControl().setLookAt(Evoker.this.getTarget(), (float) Evoker.this.getMaxHeadYRot(), (float) Evoker.this.getMaxHeadXRot());
+@@ -174,7 +161,6 @@
+ }
+
+ @Override
+- @Override
+ public boolean canUse() {
+ if (!super.canUse()) {
+ return false;
+@@ -186,52 +172,47 @@
+ }
+
+ @Override
+- @Override
+ protected int getCastingTime() {
+ return 100;
+ }
+
+ @Override
+- @Override
+ protected int getCastingInterval() {
+ return 340;
+ }
+
+ @Override
+- @Override
+ protected void performSpellCasting() {
+- ServerLevel serverlevel = (ServerLevel) Evoker.this.level();
+- PlayerTeam playerteam = Evoker.this.getTeam();
++ ServerLevel worldserver = (ServerLevel) Evoker.this.level();
++ PlayerTeam scoreboardteam = Evoker.this.getTeam();
+
+ for (int i = 0; i < 3; ++i) {
+- BlockPos blockpos = Evoker.this.blockPosition().offset(-2 + Evoker.this.random.nextInt(5), 1, -2 + Evoker.this.random.nextInt(5));
+- Vex vex = (Vex) EntityType.VEX.create(Evoker.this.level());
++ BlockPos blockposition = Evoker.this.blockPosition().offset(-2 + Evoker.this.random.nextInt(5), 1, -2 + Evoker.this.random.nextInt(5));
++ Vex entityvex = (Vex) EntityType.VEX.create(Evoker.this.level());
+
+- if (vex != null) {
+- vex.moveTo(blockpos, 0.0F, 0.0F);
+- vex.finalizeSpawn(serverlevel, Evoker.this.level().getCurrentDifficultyAt(blockpos), MobSpawnType.MOB_SUMMONED, (SpawnGroupData) null, (CompoundTag) null);
+- vex.setOwner(Evoker.this);
+- vex.setBoundOrigin(blockpos);
+- vex.setLimitedLife(20 * (30 + Evoker.this.random.nextInt(90)));
+- if (playerteam != null) {
+- serverlevel.getScoreboard().addPlayerToTeam(vex.getScoreboardName(), playerteam);
++ if (entityvex != null) {
++ entityvex.moveTo(blockposition, 0.0F, 0.0F);
++ entityvex.finalizeSpawn(worldserver, Evoker.this.level().getCurrentDifficultyAt(blockposition), EnumMobSpawn.MOB_SUMMONED, (GroupDataEntity) null, (CompoundTag) null);
++ entityvex.setOwner(Evoker.this);
++ entityvex.setBoundOrigin(blockposition);
++ entityvex.setLimitedLife(20 * (30 + Evoker.this.random.nextInt(90)));
++ if (scoreboardteam != null) {
++ worldserver.getScoreboard().addPlayerToTeam(entityvex.getScoreboardName(), scoreboardteam);
+ }
+
+- serverlevel.addFreshEntityWithPassengers(vex);
+- serverlevel.gameEvent(GameEvent.ENTITY_PLACE, blockpos, GameEvent.Context.of((Entity) Evoker.this));
++ worldserver.addFreshEntityWithPassengers(entityvex, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPELL); // CraftBukkit - Add SpawnReason
++ worldserver.gameEvent(GameEvent.ENTITY_PLACE, blockposition, GameEvent.Context.of((Entity) Evoker.this));
+ }
+ }
+
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getSpellPrepareSound() {
+ return SoundEvents.EVOKER_PREPARE_SUMMON;
+ }
+
+ @Override
+- @Override
+ protected SpellcasterIllager.IllagerSpell getSpell() {
+ return SpellcasterIllager.IllagerSpell.SUMMON_VEX;
+ }
+@@ -244,27 +225,24 @@
+ }
+
+ @Override
+- @Override
+ protected int getCastingTime() {
+ return 40;
+ }
+
+ @Override
+- @Override
+ protected int getCastingInterval() {
+ return 100;
+ }
+
+ @Override
+- @Override
+ protected void performSpellCasting() {
+- LivingEntity livingentity = Evoker.this.getTarget();
+- double d0 = Math.min(livingentity.getY(), Evoker.this.getY());
+- double d1 = Math.max(livingentity.getY(), Evoker.this.getY()) + 1.0D;
+- float f = (float) Mth.atan2(livingentity.getZ() - Evoker.this.getZ(), livingentity.getX() - Evoker.this.getX());
++ LivingEntity entityliving = Evoker.this.getTarget();
++ double d0 = Math.min(entityliving.getY(), Evoker.this.getY());
++ double d1 = Math.max(entityliving.getY(), Evoker.this.getY()) + 1.0D;
++ float f = (float) Mth.atan2(entityliving.getZ() - Evoker.this.getZ(), entityliving.getX() - Evoker.this.getX());
+ int i;
+
+- if (Evoker.this.distanceToSqr((Entity) livingentity) < 9.0D) {
++ if (Evoker.this.distanceToSqr((Entity) entityliving) < 9.0D) {
+ float f1;
+
+ for (i = 0; i < 5; ++i) {
+@@ -287,19 +265,19 @@
+
+ }
+
+- private void createSpellEntity(double d0, double d1, double d2, double d3, float f, int i) {
+- BlockPos blockpos = BlockPos.containing(d0, d3, d1);
++ private void createSpellEntity(double x, double d1, double z, double d3, float minY, int i) {
++ BlockPos blockposition = BlockPos.containing(x, d3, d1);
+ boolean flag = false;
+ double d4 = 0.0D;
+
+ do {
+- BlockPos blockpos1 = blockpos.below();
+- BlockState blockstate = Evoker.this.level().getBlockState(blockpos1);
++ BlockPos blockposition1 = blockposition.below();
++ IBlockData iblockdata = Evoker.this.level().getBlockState(blockposition1);
+
+- if (blockstate.isFaceSturdy(Evoker.this.level(), blockpos1, Direction.UP)) {
+- if (!Evoker.this.level().isEmptyBlock(blockpos)) {
+- BlockState blockstate1 = Evoker.this.level().getBlockState(blockpos);
+- VoxelShape voxelshape = blockstate1.getCollisionShape(Evoker.this.level(), blockpos);
++ if (iblockdata.isFaceSturdy(Evoker.this.level(), blockposition1, Direction.UP)) {
++ if (!Evoker.this.level().isEmptyBlock(blockposition)) {
++ IBlockData iblockdata1 = Evoker.this.level().getBlockState(blockposition);
++ VoxelShape voxelshape = iblockdata1.getCollisionShape(Evoker.this.level(), blockposition);
+
+ if (!voxelshape.isEmpty()) {
+ d4 = voxelshape.max(Direction.Axis.Y);
+@@ -310,24 +288,22 @@
+ break;
+ }
+
+- blockpos = blockpos.below();
+- } while (blockpos.getY() >= Mth.floor(d2) - 1);
++ blockposition = blockposition.below();
++ } while (blockposition.getY() >= Mth.floor(z) - 1);
+
+ if (flag) {
+- Evoker.this.level().addFreshEntity(new EvokerFangs(Evoker.this.level(), d0, (double) blockpos.getY() + d4, d1, f, i, Evoker.this));
+- Evoker.this.level().gameEvent(GameEvent.ENTITY_PLACE, new Vec3(d0, (double) blockpos.getY() + d4, d1), GameEvent.Context.of((Entity) Evoker.this));
++ Evoker.this.level().addFreshEntity(new EvokerFangs(Evoker.this.level(), x, (double) blockposition.getY() + d4, d1, minY, i, Evoker.this));
++ Evoker.this.level().gameEvent(GameEvent.ENTITY_PLACE, new Vec3(x, (double) blockposition.getY() + d4, d1), GameEvent.Context.of((Entity) Evoker.this));
+ }
+
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getSpellPrepareSound() {
+ return SoundEvents.EVOKER_PREPARE_ATTACK;
+ }
+
+ @Override
+- @Override
+ protected SpellcasterIllager.IllagerSpell getSpell() {
+ return SpellcasterIllager.IllagerSpell.FANGS;
+ }
+@@ -335,8 +311,8 @@
+
+ public class EvokerWololoSpellGoal extends SpellcasterIllager.SpellcasterUseSpellGoal {
+
+- private final TargetingConditions wololoTargeting = TargetingConditions.forNonCombat().range(16.0D).selector((livingentity) -> {
+- return ((Sheep) livingentity).getColor() == DyeColor.BLUE;
++ private final TargetingConditions wololoTargeting = TargetingConditions.forNonCombat().range(16.0D).selector((entityliving) -> {
++ return ((Sheep) entityliving).getColor() == DyeColor.BLUE;
+ });
+
+ public EvokerWololoSpellGoal() {
+@@ -344,7 +320,6 @@
+ }
+
+ @Override
+- @Override
+ public boolean canUse() {
+ if (Evoker.this.getTarget() != null) {
+ return false;
+@@ -367,55 +342,47 @@
+ }
+
+ @Override
+- @Override
+ public boolean canContinueToUse() {
+ return Evoker.this.getWololoTarget() != null && this.attackWarmupDelay > 0;
+ }
+
+ @Override
+- @Override
+ public void stop() {
+ super.stop();
+ Evoker.this.setWololoTarget((Sheep) null);
+ }
+
+ @Override
+- @Override
+ protected void performSpellCasting() {
+- Sheep sheep = Evoker.this.getWololoTarget();
++ Sheep entitysheep = Evoker.this.getWololoTarget();
+
+- if (sheep != null && sheep.isAlive()) {
+- sheep.setColor(DyeColor.RED);
++ if (entitysheep != null && entitysheep.isAlive()) {
++ entitysheep.setColor(DyeColor.RED);
+ }
+
+ }
+
+ @Override
+- @Override
+ protected int getCastWarmupTime() {
+ return 40;
+ }
+
+ @Override
+- @Override
+ protected int getCastingTime() {
+ return 60;
+ }
+
+ @Override
+- @Override
+ protected int getCastingInterval() {
+ return 140;
+ }
+
+ @Override
+- @Override
+ protected SoundEvent getSpellPrepareSound() {
+ return SoundEvents.EVOKER_PREPARE_WOLOLO;
+ }
+
+ @Override
+- @Override
+ protected SpellcasterIllager.IllagerSpell getSpell() {
+ return SpellcasterIllager.IllagerSpell.WOLOLO;
+ }