Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 4deda9501f
commit 65bc2541a3
524 changed files with 7788 additions and 6181 deletions

View File

@@ -26,7 +26,7 @@
}
}
@@ -95,12 +105,26 @@
@@ -92,12 +102,26 @@
return false;
} else {
if (!this.isRemoved() && !this.level().isClientSide) {

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
@@ -53,6 +53,20 @@
import org.joml.Vector3f;
@@ -51,6 +51,20 @@
import net.minecraft.world.phys.Vec3D;
import org.slf4j.Logger;
+// CraftBukkit start
@@ -21,7 +21,7 @@
public class EntityEnderDragon extends EntityInsentient implements IMonster {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -90,6 +104,7 @@
@@ -88,6 +102,7 @@
private final PathPoint[] nodes;
private final int[] nodeAdjacency;
private final Path openSet;
@@ -29,7 +29,7 @@
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
super(EntityTypes.ENDER_DRAGON, world);
@@ -111,6 +126,7 @@
@@ -109,6 +124,7 @@
this.noPhysics = true;
this.noCulling = true;
this.phaseManager = new DragonControllerManager(this);
@@ -37,7 +37,7 @@
}
public void setDragonFight(EnderDragonBattle enderdragonbattle) {
@@ -258,7 +274,7 @@
@@ -256,7 +272,7 @@
Vec3D vec3d1 = idragoncontroller.getFlyTargetLocation();
@@ -46,7 +46,7 @@
double d0 = vec3d1.x - this.getX();
double d1 = vec3d1.y - this.getY();
double d2 = vec3d1.z - this.getZ();
@@ -399,7 +415,14 @@
@@ -397,7 +413,14 @@
if (this.nearestCrystal.isRemoved()) {
this.nearestCrystal = null;
} else if (this.tickCount % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
@@ -62,7 +62,7 @@
}
}
@@ -474,6 +497,9 @@
@@ -472,6 +495,9 @@
int j1 = MathHelper.floor(axisalignedbb.maxZ);
boolean flag = false;
boolean flag1 = false;
@@ -72,7 +72,7 @@
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) {
@@ -483,7 +509,11 @@
@@ -481,7 +507,11 @@
if (!iblockdata.isAir() && !iblockdata.is(TagsBlock.DRAGON_TRANSPARENT)) {
if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !iblockdata.is(TagsBlock.DRAGON_IMMUNE)) {
@@ -85,7 +85,7 @@
} else {
flag = true;
}
@@ -492,6 +522,51 @@
@@ -490,6 +520,51 @@
}
}
@@ -137,7 +137,7 @@
if (flag1) {
BlockPosition blockposition1 = new BlockPosition(i + this.random.nextInt(l - i + 1), j + this.random.nextInt(i1 - j + 1), k + this.random.nextInt(j1 - k + 1));
@@ -547,7 +622,7 @@
@@ -545,7 +620,7 @@
@Override
public void kill() {
@@ -146,7 +146,7 @@
this.gameEvent(GameEvent.ENTITY_DIE);
if (this.dragonFight != null) {
this.dragonFight.updateDragon(this);
@@ -556,6 +631,21 @@
@@ -554,6 +629,21 @@
}
@@ -168,7 +168,7 @@
@Override
protected void tickDeath() {
if (this.dragonFight != null) {
@@ -571,15 +661,20 @@
@@ -569,15 +659,20 @@
this.level().addParticle(Particles.EXPLOSION_EMITTER, this.getX() + (double) f, this.getY() + 2.0D + (double) f1, this.getZ() + (double) f2, 0.0D, 0.0D, 0.0D);
}
@@ -190,7 +190,7 @@
EntityExperienceOrb.award((WorldServer) this.level(), this.position(), MathHelper.floor((float) short0 * 0.08F));
}
@@ -590,7 +685,7 @@
@@ -588,7 +683,7 @@
this.move(EnumMoveType.SELF, new Vec3D(0.0D, 0.10000000149011612D, 0.0D));
if (this.dragonDeathTime == 200 && this.level() instanceof WorldServer) {
@@ -199,7 +199,7 @@
EntityExperienceOrb.award((WorldServer) this.level(), this.position(), MathHelper.floor((float) short0 * 0.2F));
}
@@ -598,7 +693,7 @@
@@ -596,7 +691,7 @@
this.dragonFight.setDragonKilled(this);
}
@@ -208,7 +208,7 @@
this.gameEvent(GameEvent.ENTITY_DIE);
}
@@ -811,6 +906,7 @@
@@ -809,6 +904,7 @@
super.addAdditionalSaveData(nbttagcompound);
nbttagcompound.putInt("DragonPhase", this.phaseManager.getCurrentPhase().getPhase().getId());
nbttagcompound.putInt("DragonDeathTime", this.dragonDeathTime);
@@ -216,7 +216,7 @@
}
@Override
@@ -824,6 +920,11 @@
@@ -822,6 +918,11 @@
this.dragonDeathTime = nbttagcompound.getInt("DragonDeathTime");
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/boss/wither/EntityWither.java
+++ b/net/minecraft/world/entity/boss/wither/EntityWither.java
@@ -55,6 +55,18 @@
@@ -58,6 +58,18 @@
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.phys.Vec3D;
@@ -19,7 +19,7 @@
public class EntityWither extends EntityMonster implements PowerableMob, IRangedEntity {
private static final DataWatcherObject<Integer> DATA_TARGET_A = DataWatcher.defineId(EntityWither.class, DataWatcherRegistry.INT);
@@ -248,15 +260,40 @@
@@ -254,15 +266,40 @@
i = this.getInvulnerableTicks() - 1;
this.bossEvent.setProgress(1.0F - (float) i / 220.0F);
if (i <= 0) {
@@ -63,7 +63,7 @@
}
} else {
@@ -301,6 +338,7 @@
@@ -307,6 +344,7 @@
if (!list.isEmpty()) {
EntityLiving entityliving1 = (EntityLiving) list.get(this.random.nextInt(list.size()));
@@ -71,18 +71,18 @@
this.setAlternativeTarget(i, entityliving1.getId());
}
}
@@ -331,6 +369,11 @@
IBlockData iblockdata = this.level().getBlockState(blockposition);
@@ -333,6 +371,11 @@
IBlockData iblockdata = this.level().getBlockState(blockposition);
if (canDestroy(iblockdata)) {
+ // CraftBukkit start
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) {
+ continue;
+ }
+ // CraftBukkit end
flag = this.level().destroyBlock(blockposition, true, this) || flag;
}
}
if (canDestroy(iblockdata)) {
+ // CraftBukkit start
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) {
+ continue;
+ }
+ // CraftBukkit end
flag = this.level().destroyBlock(blockposition, true, this) || flag;
}
}
@@ -344,7 +387,7 @@
}
@@ -92,7 +92,7 @@
}
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
@@ -498,7 +541,7 @@
@@ -500,7 +543,7 @@
@Override
public void checkDespawn() {
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {