mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37: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
83 lines
4.5 KiB
Diff
83 lines
4.5 KiB
Diff
From f8286ee301aafa334f5f547a3b0e2763dbaf79a7 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Thu, 6 Jun 2019 21:30:49 -0500
|
|
Subject: [PATCH] Campfires burn out in rain
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/Block.java | 2 +-
|
|
.../net/minecraft/server/BlockCampfire.java | 17 ++++++++++++++++-
|
|
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
3 files changed, 19 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
|
index 8c8dc9d6b8..13981967b3 100644
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
|
@@ -394,7 +394,7 @@ public class Block implements IMaterial {
|
|
PacketDebug.a(world, blockposition);
|
|
}
|
|
|
|
- public int a(IWorldReader iworldreader) {
|
|
+ public int a(IWorldReader world) { return tickRate(world); } public int tickRate(IWorldReader world) { // Purpur - OBFHELPER
|
|
return 10;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
|
index 65f8d803b8..3b95dfaaae 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
|
@@ -7,7 +7,7 @@ import javax.annotation.Nullable;
|
|
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 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 BlockStateDirection e = BlockProperties.N;
|
|
@@ -74,6 +74,21 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
|
return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockCampfire.d, flag)).set(BlockCampfire.c, this.h(world.getType(blockposition.down())))).set(BlockCampfire.b, !flag)).set(BlockCampfire.e, blockactioncontext.f());
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
|
+ 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);
|
|
+ }
|
|
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public int tickRate(IWorldReader world) {
|
|
+ return 1;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
@Override
|
|
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
|
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 8c84431e59..a761b2c734 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -81,6 +81,7 @@ public class PurpurWorldConfig {
|
|
public int campfireRegenBoostAmp = 1;
|
|
public boolean campfireRegenBoostRequireLineOfSight = false;
|
|
public boolean campfireRequireRegenPotion = true;
|
|
+ public boolean campfireBurnOutInRain = false;
|
|
private void campfireSettings() {
|
|
campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
|
campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
|
@@ -92,6 +93,7 @@ public class PurpurWorldConfig {
|
|
campfireRegenBoostAmp = getInt("blocks.campfire.regen.boost-amplifier", campfireRegenBoostAmp);
|
|
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);
|
|
}
|
|
|
|
public boolean farmlandGetsMoistFromBelow = false;
|
|
--
|
|
2.24.0
|
|
|