Update to Minecraft 1.20

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-06-08 01:30:00 +10:00
parent bac55e67d6
commit 9d740b84b0
269 changed files with 2605 additions and 2568 deletions

View File

@@ -9,17 +9,6 @@
public class EntityFallingBlock extends Entity {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -57,8 +59,8 @@
public boolean dropItem;
private boolean cancelDrop;
public boolean hurtEntities;
- private int fallDamageMax;
- private float fallDamagePerDistance;
+ public int fallDamageMax;
+ public float fallDamagePerDistance;
@Nullable
public NBTTagCompound blockData;
protected static final DataWatcherObject<BlockPosition> DATA_START_POS = DataWatcher.defineId(EntityFallingBlock.class, DataWatcherRegistry.BLOCK_POS);
@@ -83,10 +85,17 @@
}
@@ -49,24 +38,15 @@
+ return;
+ }
+ // CraftBukkit end
if (this.level.setBlock(blockposition, this.blockState, 3)) {
((WorldServer) this.level).getChunkSource().chunkMap.broadcast(this, new PacketPlayOutBlockChange(blockposition, this.level.getBlockState(blockposition)));
if (this.level().setBlock(blockposition, this.blockState, 3)) {
((WorldServer) this.level()).getChunkSource().chunkMap.broadcast(this, new PacketPlayOutBlockChange(blockposition, this.level().getBlockState(blockposition)));
this.discard();
@@ -239,7 +254,7 @@
if (i < 0) {
return false;
} else {
- Predicate predicate;
+ Predicate<Entity> predicate; // CraftBukkit - decompile error
DamageSource damagesource1;
if (this.blockState.getBlock() instanceof Fallable) {
@@ -255,7 +270,9 @@
float f2 = (float) Math.min(MathHelper.floor((float) i * this.fallDamagePerDistance), this.fallDamageMax);
this.level.getEntities((Entity) this, this.getBoundingBox(), predicate).forEach((entity) -> {
this.level().getEntities((Entity) this, this.getBoundingBox(), predicate).forEach((entity) -> {
+ CraftEventFactory.entityDamage = this; // CraftBukkit
entity.hurt(damagesource1, f2);
entity.hurt(damagesource2, f2);
+ CraftEventFactory.entityDamage = null; // CraftBukkit
});
boolean flag = this.blockState.is(TagsBlock.ANVIL);