mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 02:17:42 +01:00
Add option to campfires for regen potion requirement
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From c53688c4c3bf7053639574370a40ea890001923a Mon Sep 17 00:00:00 2001
|
||||
From b26a3bb41ca58ca161ed36cefe2773bce4e5ac1b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 19 May 2019 18:11:53 -0500
|
||||
Subject: [PATCH] Add regen effect to campfires
|
||||
@@ -7,11 +7,11 @@ Subject: [PATCH] Add regen effect to campfires
|
||||
.../net/minecraft/server/EntityLiving.java | 15 ++++++++--
|
||||
.../net/minecraft/server/EntityPotion.java | 26 ++++++++++++++++
|
||||
.../minecraft/server/TileEntityCampfire.java | 30 +++++++++++++++++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 21 +++++++++++++
|
||||
4 files changed, 89 insertions(+), 3 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 23 ++++++++++++++
|
||||
4 files changed, 91 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 2b7925b5d..8b6dd4527 100644
|
||||
index 2b7925b5..8b6dd452 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2715,10 +2715,19 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -38,7 +38,7 @@ index 2b7925b5d..8b6dd4527 100644
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
index 998336557..2642e86f7 100644
|
||||
index 99833655..2642e86f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
@@ -91,6 +91,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
@@ -82,7 +82,7 @@ index 998336557..2642e86f7 100644
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
|
||||
List<EntityLiving> list = this.world.a(EntityLiving.class, axisalignedbb, EntityPotion.e);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityCampfire.java b/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
index 2317adde4..7360e462d 100644
|
||||
index 2317adde..f112a848 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
@@ -14,6 +14,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
@@ -98,7 +98,7 @@ index 2317adde4..7360e462d 100644
|
||||
} else {
|
||||
if (flag) {
|
||||
+ // Purpur start
|
||||
+ if (splashed && world.purpurConfig.campfireRegenInterval > 0 && world.getTime() % world.purpurConfig.campfireRegenInterval == 0L) {
|
||||
+ if ((splashed || !world.purpurConfig.campfireRequireRegenPotion) && world.purpurConfig.campfireRegenInterval > 0 && world.getTime() % world.purpurConfig.campfireRegenInterval == 0L) {
|
||||
+ boolean signalBoost = getBlock().get(BlockCampfire.c);
|
||||
+ int duration = signalBoost ? world.purpurConfig.campfireRegenBoostDuration : world.purpurConfig.campfireRegenDuration;
|
||||
+ byte amp = (byte) (signalBoost ? world.purpurConfig.campfireRegenBoostAmp : world.purpurConfig.campfireRegenAmp);
|
||||
@@ -151,10 +151,10 @@ index 2317adde4..7360e462d 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 30f11fe26..cea2bcad5 100644
|
||||
index 30f11fe2..22b6a0fd 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -60,4 +60,25 @@ public class PurpurWorldConfig {
|
||||
@@ -60,4 +60,27 @@ public class PurpurWorldConfig {
|
||||
config.addDefault("world-settings.default." + path, def);
|
||||
return config.getString("world-settings." + worldName + "." + path, config.getString("world-settings.default." + path));
|
||||
}
|
||||
@@ -168,6 +168,7 @@ index 30f11fe26..cea2bcad5 100644
|
||||
+ public int campfireRegenBoostRange = 10;
|
||||
+ public int campfireRegenBoostAmp = 1;
|
||||
+ public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
+ public boolean campfireRequireRegenPotion = true;
|
||||
+ private void campfireRegenSettings() {
|
||||
+ campfireRegenInterval = getInt("campfire-regen.interval", campfireRegenInterval);
|
||||
+ campfireRegenDuration = getInt("campfire-regen.duration", campfireRegenDuration);
|
||||
@@ -178,6 +179,7 @@ index 30f11fe26..cea2bcad5 100644
|
||||
+ campfireRegenBoostRange = getInt("campfire-regen.boost-range", campfireRegenBoostRange);
|
||||
+ campfireRegenBoostAmp = getInt("campfire-regen.boost-amplifier", campfireRegenBoostAmp);
|
||||
+ campfireRegenBoostRequireLineOfSight = getBoolean("campfire-regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
+ campfireRequireRegenPotion = getBoolean("campfire-regn.requires-regen-potion-to-activate", campfireRequireRegenPotion);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user