mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Option for beds to explode on villager sleep
This commit is contained in:
@@ -31,3 +31,16 @@
|
||||
}
|
||||
|
||||
private boolean hungry() {
|
||||
@@ -1001,6 +_,12 @@
|
||||
|
||||
@Override
|
||||
public void startSleeping(BlockPos pos) {
|
||||
+ // Purpur start - Option for beds to explode on villager sleep
|
||||
+ if (level().purpurConfig.bedExplodeOnVillagerSleep && this.level().getBlockState(pos).getBlock() instanceof net.minecraft.world.level.block.BedBlock) {
|
||||
+ this.level().explode(null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, (float) this.level().purpurConfig.bedExplosionPower, this.level().purpurConfig.bedExplosionFire, this.level().purpurConfig.bedExplosionEffect);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Purpur end - Option for beds to explode on villager sleep
|
||||
super.startSleeping(pos);
|
||||
this.brain.setMemory(MemoryModuleType.LAST_SLEPT, this.level().getGameTime());
|
||||
this.brain.eraseMemory(MemoryModuleType.WALK_TARGET);
|
||||
|
||||
Reference in New Issue
Block a user