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: 97f920bf Fix suggest-player-names-when-null-tab-completions - Fixes #3803 166e52b5 [CI-SKIP] [Auto] Rebuild Patches 5a17ba07 Implements #3761 - Add entity liquid API (#3762) e0cae289 Fix anvils bug - Fixes #3802 4793f774 Move bedrock config under unsupported, add comments to these configs adf1de58 Allow delegation to vanilla chunk gen 40ace3f7 Allow delegation to vanilla chunk gen 178a6e50 Add PrepareResultEvent (#3776) 57697cd5 Report proxy onlinde mode to bstats as online (#3093) 6579ce05 Fix #3701 - Loottables erasing on viewing 030da7b8 [CI-SKIP] [Auto] Rebuild Patches d43def79 Incorrect spawn reason for monsters from spawner - Fixes #3708 (#3764) 97b59df9 [Auto] Updated Upstream (CraftBukkit) 0543f051 [CI-SKIP] [Auto] Rebuild Patches f3cd94c4 Remove streams from classes related to villager gossip (#3748) b49104db add EntityTargetLivingEntityEvent for new 1.16 mobs (#3782) 4faf9703 Fix /plugins list not alphabetical to players (#3790) 7e03e44e [CI-SKIP] [Auto] Rebuild Patches 8bb00272 Update itemstack legacy name and lore (#3741) 6c87b6a0 [Auto] Updated Upstream (CraftBukkit)
63 lines
3.2 KiB
Diff
63 lines
3.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sat, 4 Jul 2020 13:12:43 -0500
|
|
Subject: [PATCH] Implement bed explosion options
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java
|
|
index e7bd9061cc..aeffefa4e7 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockBed.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockBed.java
|
|
@@ -88,7 +88,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
|
|
world.a(blockposition1, false);
|
|
}
|
|
|
|
- world.createExplosion((Entity) null, DamageSource.a(), (ExplosionDamageCalculator) null, (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(), null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // Purpur
|
|
return EnumInteractionResult.SUCCESS;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 80d772e021..56c4f9efd0 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -2,6 +2,7 @@ package net.pl3x.purpur;
|
|
|
|
import net.minecraft.server.Block;
|
|
import net.minecraft.server.Blocks;
|
|
+import net.minecraft.server.Explosion;
|
|
import net.minecraft.server.IRegistry;
|
|
import net.minecraft.server.Item;
|
|
import net.minecraft.server.Items;
|
|
@@ -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;
|
|
|
|
@@ -196,6 +198,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 boolean dispenserApplyCursedArmor = true;
|
|
private void dispenserSettings() {
|
|
dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor);
|