mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Implement bed explosion options
This commit is contained in:
committed by
granny
parent
295d2c91db
commit
a4af6baa0d
@@ -2,6 +2,7 @@ package org.purpurmc.purpur;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
@@ -267,6 +268,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);
|
||||
|
||||
Reference in New Issue
Block a user