geforkt von Mirrors/Paper
SPIGOT-7855: Fire does not spread or burn blocks
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
3fb8f4b1d1
Commit
2f0c34a2cf
@ -1,10 +1,11 @@
|
|||||||
--- a/net/minecraft/world/level/block/BlockFire.java
|
--- a/net/minecraft/world/level/block/BlockFire.java
|
||||||
+++ b/net/minecraft/world/level/block/BlockFire.java
|
+++ b/net/minecraft/world/level/block/BlockFire.java
|
||||||
@@ -29,6 +29,14 @@
|
@@ -29,6 +29,15 @@
|
||||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||||
|
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
|
+import net.minecraft.world.item.context.ItemActionContext;
|
||||||
+import org.bukkit.craftbukkit.block.CraftBlockState;
|
+import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||||
+import org.bukkit.craftbukkit.block.CraftBlockStates;
|
+import org.bukkit.craftbukkit.block.CraftBlockStates;
|
||||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||||
@ -15,7 +16,7 @@
|
|||||||
public class BlockFire extends BlockFireAbstract {
|
public class BlockFire extends BlockFireAbstract {
|
||||||
|
|
||||||
public static final MapCodec<BlockFire> CODEC = simpleCodec(BlockFire::new);
|
public static final MapCodec<BlockFire> CODEC = simpleCodec(BlockFire::new);
|
||||||
@@ -100,7 +108,24 @@
|
@@ -100,7 +109,24 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
protected IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||||
@ -41,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -149,7 +174,7 @@
|
@@ -149,7 +175,7 @@
|
||||||
worldserver.scheduleTick(blockposition, (Block) this, getFireTickDelay(worldserver.random));
|
worldserver.scheduleTick(blockposition, (Block) this, getFireTickDelay(worldserver.random));
|
||||||
if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
|
if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
|
||||||
if (!iblockdata.canSurvive(worldserver, blockposition)) {
|
if (!iblockdata.canSurvive(worldserver, blockposition)) {
|
||||||
@ -50,7 +51,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition.below());
|
IBlockData iblockdata1 = worldserver.getBlockState(blockposition.below());
|
||||||
@@ -157,7 +182,7 @@
|
@@ -157,7 +183,7 @@
|
||||||
int i = (Integer) iblockdata.getValue(BlockFire.AGE);
|
int i = (Integer) iblockdata.getValue(BlockFire.AGE);
|
||||||
|
|
||||||
if (!flag && worldserver.isRaining() && this.isNearRain(worldserver, blockposition) && randomsource.nextFloat() < 0.2F + (float) i * 0.03F) {
|
if (!flag && worldserver.isRaining() && this.isNearRain(worldserver, blockposition) && randomsource.nextFloat() < 0.2F + (float) i * 0.03F) {
|
||||||
@ -59,7 +60,7 @@
|
|||||||
} else {
|
} else {
|
||||||
int j = Math.min(15, i + randomsource.nextInt(3) / 2);
|
int j = Math.min(15, i + randomsource.nextInt(3) / 2);
|
||||||
|
|
||||||
@@ -171,14 +196,14 @@
|
@@ -171,14 +197,14 @@
|
||||||
BlockPosition blockposition1 = blockposition.below();
|
BlockPosition blockposition1 = blockposition.below();
|
||||||
|
|
||||||
if (!worldserver.getBlockState(blockposition1).isFaceSturdy(worldserver, blockposition1, EnumDirection.UP) || i > 3) {
|
if (!worldserver.getBlockState(blockposition1).isFaceSturdy(worldserver, blockposition1, EnumDirection.UP) || i > 3) {
|
||||||
@ -76,7 +77,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,12 +211,14 @@
|
@@ -186,12 +212,14 @@
|
||||||
boolean flag1 = worldserver.getBiome(blockposition).is(BiomeTags.INCREASED_FIRE_BURNOUT);
|
boolean flag1 = worldserver.getBiome(blockposition).is(BiomeTags.INCREASED_FIRE_BURNOUT);
|
||||||
int k = flag1 ? -50 : 0;
|
int k = flag1 ? -50 : 0;
|
||||||
|
|
||||||
@ -97,7 +98,7 @@
|
|||||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||||
|
|
||||||
for (int l = -1; l <= 1; ++l) {
|
for (int l = -1; l <= 1; ++l) {
|
||||||
@@ -217,7 +244,15 @@
|
@@ -217,7 +245,15 @@
|
||||||
if (i2 > 0 && randomsource.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.isNearRain(worldserver, blockposition_mutableblockposition))) {
|
if (i2 > 0 && randomsource.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.isNearRain(worldserver, blockposition_mutableblockposition))) {
|
||||||
int j2 = Math.min(15, i + randomsource.nextInt(5) / 4);
|
int j2 = Math.min(15, i + randomsource.nextInt(5) / 4);
|
||||||
|
|
||||||
@ -114,7 +115,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,12 +276,28 @@
|
@@ -241,12 +277,28 @@
|
||||||
return iblockdata.hasProperty(BlockProperties.WATERLOGGED) && (Boolean) iblockdata.getValue(BlockProperties.WATERLOGGED) ? 0 : this.igniteOdds.getInt(iblockdata.getBlock());
|
return iblockdata.hasProperty(BlockProperties.WATERLOGGED) && (Boolean) iblockdata.getValue(BlockProperties.WATERLOGGED) ? 0 : this.igniteOdds.getInt(iblockdata.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,3 +145,16 @@
|
|||||||
if (randomsource.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
|
if (randomsource.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
|
||||||
int l = Math.min(j + randomsource.nextInt(5) / 4, 15);
|
int l = Math.min(j + randomsource.nextInt(5) / 4, 15);
|
||||||
|
|
||||||
|
@@ -310,8 +362,10 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
- protected void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
|
||||||
|
- super.onPlace(iblockdata, world, blockposition, iblockdata1, flag);
|
||||||
|
+ // CraftBukkit start - context
|
||||||
|
+ protected void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag, ItemActionContext context) {
|
||||||
|
+ super.onPlace(iblockdata, world, blockposition, iblockdata1, flag, context);
|
||||||
|
+ // CraftBukkit end
|
||||||
|
world.scheduleTick(blockposition, (Block) this, getFireTickDelay(world.random));
|
||||||
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren