Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/EntityLightning.java
+++ b/net/minecraft/world/entity/EntityLightning.java
@@ -30,6 +30,11 @@
@@ -31,6 +31,11 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
@@ -12,7 +12,7 @@
public class EntityLightning extends Entity {
private static final int START_LIFE = 2;
@@ -121,7 +126,7 @@
@@ -120,7 +125,7 @@
}
}
@@ -21,7 +21,7 @@
} else if (this.life < -this.random.nextInt(10)) {
--this.flashes;
this.life = 1;
@@ -130,7 +135,7 @@
@@ -129,7 +134,7 @@
}
}
@@ -30,37 +30,37 @@
if (!(this.level() instanceof WorldServer)) {
this.level().setSkyFlashTime(2);
} else if (!this.visualOnly) {
@@ -164,8 +169,12 @@
IBlockData iblockdata = BlockFireAbstract.getState(this.level(), blockposition);
@@ -169,8 +174,12 @@
IBlockData iblockdata = BlockFireAbstract.getState(this.level(), blockposition);
if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) {
- this.level().setBlockAndUpdate(blockposition, iblockdata);
- ++this.blocksSetOnFire;
+ // CraftBukkit start - add "!visualOnly"
+ if (!visualOnly && !CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition, this).isCancelled()) {
+ this.level().setBlockAndUpdate(blockposition, iblockdata);
+ ++this.blocksSetOnFire;
+ }
+ // CraftBukkit end
}
if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) {
- this.level().setBlockAndUpdate(blockposition, iblockdata);
- ++this.blocksSetOnFire;
+ // CraftBukkit start - add "!visualOnly"
+ if (!visualOnly && !CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition, this).isCancelled()) {
+ this.level().setBlockAndUpdate(blockposition, iblockdata);
+ ++this.blocksSetOnFire;
+ }
+ // CraftBukkit end
}
for (int j = 0; j < i; ++j) {
@@ -173,8 +182,12 @@
for (int j = 0; j < i; ++j) {
@@ -178,8 +187,12 @@
iblockdata = BlockFireAbstract.getState(this.level(), blockposition1);
if (this.level().getBlockState(blockposition1).isAir() && iblockdata.canSurvive(this.level(), blockposition1)) {
- this.level().setBlockAndUpdate(blockposition1, iblockdata);
- ++this.blocksSetOnFire;
+ // CraftBukkit start - add "!visualOnly"
+ if (!visualOnly && !CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition1, this).isCancelled()) {
+ this.level().setBlockAndUpdate(blockposition1, iblockdata);
+ ++this.blocksSetOnFire;
+ }
+ // CraftBukkit end
}
}
iblockdata = BlockFireAbstract.getState(this.level(), blockposition1);
if (this.level().getBlockState(blockposition1).isAir() && iblockdata.canSurvive(this.level(), blockposition1)) {
- this.level().setBlockAndUpdate(blockposition1, iblockdata);
- ++this.blocksSetOnFire;
+ // CraftBukkit start - add "!visualOnly"
+ if (!visualOnly && !CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition1, this).isCancelled()) {
+ this.level().setBlockAndUpdate(blockposition1, iblockdata);
+ ++this.blocksSetOnFire;
+ }
+ // CraftBukkit end
}
}
@@ -238,8 +251,9 @@
@@ -247,8 +260,9 @@
iblockdata = world.getBlockState(blockposition1);
} while (!(iblockdata.getBlock() instanceof WeatheringCopper));