mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
84 lines
5.2 KiB
Diff
84 lines
5.2 KiB
Diff
From 94def13a47b03244a57d1da80c6a9839cd7a9fc3 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Thu, 23 May 2019 16:20:21 -0500
|
|
Subject: [PATCH] Campfires should fall with gravity
|
|
|
|
---
|
|
.../java/net/minecraft/server/BlockCampfire.java | 16 ++++++++++++++--
|
|
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
|
index 3b95dfaaae..418fa6d1fe 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
|
@@ -9,7 +9,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
|
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
|
public static final BlockStateBoolean b = BlockProperties.r; public static BlockStateBoolean lit() { return b; } // Purpur - OBFHELPER
|
|
public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
|
- public static final BlockStateBoolean d = BlockProperties.C;
|
|
+ public static final BlockStateBoolean d = BlockProperties.C; public static BlockStateBoolean waterlogged() { return d; } // Purpur - OBFHELPER
|
|
public static final BlockStateDirection e = BlockProperties.N;
|
|
private static final VoxelShape f = Block.a(6.0D, 0.0D, 6.0D, 10.0D, 16.0D, 10.0D);
|
|
|
|
@@ -75,8 +75,19 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
|
}
|
|
|
|
// Purpur start
|
|
+ @Override
|
|
+ public void onPlace(IBlockData iblockdata, World world, BlockPosition pos, IBlockData iblockdata1, boolean flag) {
|
|
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
|
+ }
|
|
+
|
|
@Override
|
|
public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
|
+ if (world.purpurConfig.campfireFallWithGravity && BlockFalling.canFallThrough(world.getType(pos.down())) && pos.getY() >= 0) {
|
|
+ world.addEntity(new EntityFallingBlock(world, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, world.getType(pos)));
|
|
+ }
|
|
+ if (iblockdata.get(waterlogged()) && iblockdata.get(lit())) {
|
|
+ world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
|
+ }
|
|
if (world.purpurConfig.campfireBurnOutInRain && world.getTime() % 20 == 0L && iblockdata.get(lit()) && world.isRainingAt(pos.shift(EnumDirection.UP))) {
|
|
world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
|
}
|
|
@@ -91,6 +102,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
|
|
|
@Override
|
|
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
|
+ generatoraccess.getBlockTickList().a(blockposition, this, tickRate(generatoraccess)); // Purpur - Campfires should fall with gravity
|
|
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
|
generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess));
|
|
}
|
|
@@ -119,7 +131,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
|
|
|
@Override
|
|
public boolean place(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid) {
|
|
- if (!(Boolean) iblockdata.get(BlockProperties.C) && fluid.getType() == FluidTypes.WATER) {
|
|
+ if (!(Boolean) iblockdata.get(BlockCampfire.d) && fluid.getType() == FluidTypes.WATER) { // Purpur
|
|
boolean flag = (Boolean) iblockdata.get(BlockCampfire.b);
|
|
|
|
if (flag) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index a761b2c734..d6405b2ec5 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -82,6 +82,7 @@ public class PurpurWorldConfig {
|
|
public boolean campfireRegenBoostRequireLineOfSight = false;
|
|
public boolean campfireRequireRegenPotion = true;
|
|
public boolean campfireBurnOutInRain = false;
|
|
+ public boolean campfireFallWithGravity = false;
|
|
private void campfireSettings() {
|
|
campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
|
campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
|
@@ -94,6 +95,7 @@ public class PurpurWorldConfig {
|
|
campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
|
campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
|
campfireBurnOutInRain = getBoolean("blocks.campfire.burn-out-in-rain", campfireBurnOutInRain);
|
|
+ campfireFallWithGravity = getBoolean("blocks.campfire.fall-with-gravity", campfireFallWithGravity);
|
|
}
|
|
|
|
public boolean farmlandGetsMoistFromBelow = false;
|
|
--
|
|
2.24.0
|
|
|