aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
committerMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
commitbee74680e607c2e29b038329f62181238911cd83 (patch)
tree708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch
parent0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff)
downloadPaper-softspoon.tar.gz
Paper-softspoon.zip
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch
new file mode 100644
index 0000000000..6c5a520ade
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/LightningBolt.java.patch
@@ -0,0 +1,62 @@
+--- a/net/minecraft/world/entity/LightningBolt.java
++++ b/net/minecraft/world/entity/LightningBolt.java
+@@ -24,6 +28,9 @@
+ import net.minecraft.world.level.gameevent.GameEvent;
+ import net.minecraft.world.phys.AABB;
+ import net.minecraft.world.phys.Vec3;
++// CraftBukkit start
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
+
+ public class LightningBolt extends Entity {
+ private static final int START_LIFE = 2;
+@@ -138,7 +132,7 @@
+ }
+ }
+
+- if (this.life >= 0) {
++ if (this.life >= 0 && !this.visualOnly) { // CraftBukkit - add !this.visualOnly
+ if (!(this.level() instanceof ServerLevel)) {
+ this.level().setSkyFlashTime(2);
+ } else if (!this.visualOnly) {
+@@ -168,19 +162,29 @@
+
+ private void spawnFire(int extraIgnitions) {
+ if (!this.visualOnly && !this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
+- BlockPos blockPos = this.blockPosition();
+- BlockState state = BaseFireBlock.getState(this.level(), blockPos);
+- if (this.level().getBlockState(blockPos).isAir() && state.canSurvive(this.level(), blockPos)) {
+- this.level().setBlockAndUpdate(blockPos, state);
+- this.blocksSetOnFire++;
++ BlockPos blockposition = this.blockPosition();
++ IBlockData iblockdata = BaseFireBlock.getState(this.level(), blockposition);
++
++ if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) {
++ // CraftBukkit start - add "!visualOnly"
++ if (!visualOnly && !CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition, this).isCancelled()) {
++ this.level().setBlockAndUpdate(blockposition, iblockdata);
++ ++this.blocksSetOnFire;
++ }
++ // CraftBukkit end
+ }
+
+- for (int i = 0; i < extraIgnitions; i++) {
+- BlockPos blockPos1 = blockPos.offset(this.random.nextInt(3) - 1, this.random.nextInt(3) - 1, this.random.nextInt(3) - 1);
+- state = BaseFireBlock.getState(this.level(), blockPos1);
+- if (this.level().getBlockState(blockPos1).isAir() && state.canSurvive(this.level(), blockPos1)) {
+- this.level().setBlockAndUpdate(blockPos1, state);
+- this.blocksSetOnFire++;
++ for (int j = 0; j < extraIgnitions; ++j) {
++ BlockPos blockposition1 = blockposition.offset(this.random.nextInt(3) - 1, this.random.nextInt(3) - 1, this.random.nextInt(3) - 1);
++
++ iblockdata = BaseFireBlock.getState(this.level(), blockposition1);
++ if (this.level().getBlockState(blockposition1).isAir() && iblockdata.canSurvive(this.level(), blockposition1)) {
++ // CraftBukkit start - add "!visualOnly"
++ if (!visualOnly && !CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition1, this).isCancelled()) {
++ this.level().setBlockAndUpdate(blockposition1, iblockdata);
++ ++this.blocksSetOnFire;
++ }
++ // CraftBukkit end
+ }
+ }
+ }