mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132) c65dcad3 Don't delay chunk unloads during entity ticking bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114 5553e6b3 Disable Sync Events firing Async errors during shutdown e12c51d9 Use better variable for isStopping() API 586ee2bb Remove patch for MC-111480, fixed in 1.14 09a94215 Remove streams from Mob AI System bb5c294e Fix Disabling Asynchronous Chunks 089d8356 Implement Chunk Priority / Urgency System for World Gen fce69af7 Use dedicated thread for main thread blocking chunk loads 588b62e4 Add tick times API and /mspt command (#3102) 11de41c7 Add API MinecraftServer#isStopping (#3129) 942ff3c2 My patches are under MIT (#3130)
70 lines
3.4 KiB
Diff
70 lines
3.4 KiB
Diff
From 915d861a9f0574fcb68fad3466f79dd5d849ea16 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sat, 22 Feb 2020 15:04:29 -0600
|
|
Subject: [PATCH] Implement bed explosion options
|
|
|
|
---
|
|
.../java/net/minecraft/server/BlockBed.java | 2 +-
|
|
.../net/pl3x/purpur/PurpurWorldConfig.java | 18 ++++++++++++++++++
|
|
2 files changed, 19 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java
|
|
index 06a35629ab..df41a7dfcd 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockBed.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockBed.java
|
|
@@ -84,7 +84,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
|
|
world.a(blockposition1, false);
|
|
}
|
|
|
|
- world.createExplosion((Entity) null, DamageSource.a(), (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
|
|
+ if (world.purpurConfig.bedExplode) world.createExplosion(null, DamageSource.a(), blockposition.getX() + 0.5D, blockposition.getY() + 0.5D, blockposition.getZ() + 0.5D, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // Purpur
|
|
return EnumInteractionResult.SUCCESS;
|
|
// CraftBukkit end
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index de6246e230..eaaffc2b30 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -3,6 +3,7 @@ package net.pl3x.purpur;
|
|
import com.destroystokyo.paper.PaperWorldConfig;
|
|
import net.minecraft.server.Block;
|
|
import net.minecraft.server.Blocks;
|
|
+import net.minecraft.server.Explosion;
|
|
import net.minecraft.server.IRegistry;
|
|
import net.minecraft.server.MinecraftKey;
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
@@ -12,6 +13,7 @@ import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
+import java.util.logging.Level;
|
|
|
|
import static net.pl3x.purpur.PurpurConfig.log;
|
|
|
|
@@ -79,6 +81,22 @@ public class PurpurWorldConfig {
|
|
bambooSmallHeight = getInt("blocks.bamboo.small-height", bambooSmallHeight);
|
|
}
|
|
|
|
+ public boolean bedExplode = true;
|
|
+ public double bedExplosionPower = 5.0D;
|
|
+ public boolean bedExplosionFire = true;
|
|
+ public Explosion.Effect bedExplosionEffect = Explosion.Effect.DESTROY;
|
|
+ private void bedSettings() {
|
|
+ bedExplode = getBoolean("blocks.bed.explode", bedExplode);
|
|
+ bedExplosionPower = getDouble("blocks.bed.explosion-power", bedExplosionPower);
|
|
+ bedExplosionFire = getBoolean("blocks.bed.explosion-fire", bedExplosionFire);
|
|
+ try {
|
|
+ bedExplosionEffect = Explosion.Effect.valueOf(getString("blocks.bed.explosion-effect", bedExplosionEffect.name()));
|
|
+ } catch (IllegalArgumentException e) {
|
|
+ log(Level.SEVERE, "Unknown value for `blocks.bed.explosion-effect`! Using default of `DESTROY`");
|
|
+ bedExplosionEffect = Explosion.Effect.DESTROY;
|
|
+ }
|
|
+ }
|
|
+
|
|
public int campfireRegenInterval = 0;
|
|
public int campfireRegenDuration = 80;
|
|
public int campfireRegenRange = 5;
|
|
--
|
|
2.24.0
|
|
|