Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -10,11 +10,11 @@
public static final int MAX_AGE = 7;
@@ -76,7 +78,7 @@
float f = a((Block) this, (IBlockAccess) worldserver, blockposition);
float f = getGrowthSpeed(this, worldserver, blockposition);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
- worldserver.setTypeAndData(blockposition, this.setAge(i + 1), 2);
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.setAge(i + 1), 2); // CraftBukkit
- worldserver.setBlock(blockposition, this.getStateForAge(i + 1), 2);
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getStateForAge(i + 1), 2); // CraftBukkit
}
}
}
@@ -22,17 +22,17 @@
i = j;
}
- world.setTypeAndData(blockposition, this.setAge(i), 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.setAge(i), 2); // CraftBukkit
- world.setBlock(blockposition, this.getStateForAge(i), 2);
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.getStateForAge(i), 2); // CraftBukkit
}
protected int a(World world) {
protected int getBonemealAgeIncrease(World world) {
@@ -149,7 +151,7 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
- if (entity instanceof EntityRavager && world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // CraftBukkit
world.a(blockposition, true, entity);
+ if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.defaultBlockState(), !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // CraftBukkit
world.destroyBlock(blockposition, true, entity);
}