mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@c1bca9a Add exploded block state to BlockExplodeEvent (#6818) PaperMC/Paper@94373f0 Fix OfflinePlayer#getPlayerProfile returning deprecated type (#8543) PaperMC/Paper@7b52db5 Fix buffer-joins-to-world patch PaperMC/Paper@048ee58 Fix OfflinePlayer getPlayerProfile return type (#8710) PaperMC/Paper@e05ba98 Avoid to spam the transform event for hoglin->zoglin conversion (#8712) PaperMC/Paper@8e83c3c Deprecate ProjectileCollideEvent (#8678) PaperMC/Paper@c59922d Expose signed message in chat events (#8694) PaperMC/Paper@5717b84 Add config option for spider worldborder climbing (#6448) PaperMC/Paper@e6f61f7 fix ArmorStandMeta not applying false flags (#8632) PaperMC/Paper@47abd1c Add EntityPushedByEntityEvent (#7704) PaperMC/Paper@f26e9cc Tadpole lock API (#8297) PaperMC/Paper@3331501 Use team display name for quit message (#7127) PaperMC/Paper@1975fbe Respect SpigotConfig logCommands & fix stopDancing() NPE (#8715) PaperMC/Paper@78a91df Fix (again) Player#getPlayerProfile no such method error (#8722) PaperMC/Paper@52718db Updated Upstream (Bukkit/CraftBukkit) (#8714) PaperMC/Paper@2040c1e Player Flying Fall Damage API (#5357)
61 lines
4.1 KiB
Diff
61 lines
4.1 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/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
|
index 64e68bf6decc765274caaabfd34a5b2d7d82434c..321522ca0396100486379fff5b105e07ce9f0aae 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
|
@@ -98,7 +98,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
|
|
Vec3 vec3d = pos.getCenter();
|
|
|
|
- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state
|
|
+ if (world.purpurConfig.bedExplode) world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state // Purpur
|
|
return InteractionResult.SUCCESS;
|
|
} else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) {
|
|
if (!this.kickVillagerOutOfBed(world, pos)) {
|
|
@@ -150,7 +150,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
|
|
Vec3 vec3d = blockposition.getCenter();
|
|
|
|
- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state
|
|
+ if (world.purpurConfig.bedExplode) world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // Paper - exploded block state // Purpur
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 4421f48e9dd433cdcff5b7c5ac249bae49a67bd8..e619b2cf060a8137bc8b3e7d8062e702b3f9e799 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -291,6 +291,27 @@ public class PurpurWorldConfig {
|
|
});
|
|
}
|
|
|
|
+ public boolean bedExplode = true;
|
|
+ public double bedExplosionPower = 5.0D;
|
|
+ public boolean bedExplosionFire = true;
|
|
+ public net.minecraft.world.level.Level.ExplosionInteraction bedExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK;
|
|
+ private void bedSettings() {
|
|
+ if (PurpurConfig.version < 31) {
|
|
+ if ("DESTROY".equals(getString("blocks.bed.explosion-effect", bedExplosionEffect.name()))) {
|
|
+ set("blocks.bed.explosion-effect", "BLOCK");
|
|
+ }
|
|
+ }
|
|
+ bedExplode = getBoolean("blocks.bed.explode", bedExplode);
|
|
+ bedExplosionPower = getDouble("blocks.bed.explosion-power", bedExplosionPower);
|
|
+ bedExplosionFire = getBoolean("blocks.bed.explosion-fire", bedExplosionFire);
|
|
+ try {
|
|
+ bedExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.valueOf(getString("blocks.bed.explosion-effect", bedExplosionEffect.name()));
|
|
+ } catch (IllegalArgumentException e) {
|
|
+ log(Level.SEVERE, "Unknown value for `blocks.bed.explosion-effect`! Using default of `BLOCK`");
|
|
+ bedExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK;
|
|
+ }
|
|
+ }
|
|
+
|
|
public boolean dispenserApplyCursedArmor = true;
|
|
private void dispenserSettings() {
|
|
dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor);
|