mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@850b736 Close PRs opened from orgs or bot accounts (#10281) PaperMC/Paper@54a2340 check if itemstack is stackable first (#10285) PaperMC/Paper@9c4bb0d add rich message component support to configuration (#10225) PaperMC/Paper@8870d22 Fire EntityDamageByEntityEvent for unowned wither skulls patch (#10244) PaperMC/Paper@bbc03d8 improve BanList types (#10239) PaperMC/Paper@ce5c8dd Configurable max block/fluid ticks (#10266) PaperMC/Paper@880fef7 Deprecate extra ban methods with raw BanEntry (#9580) PaperMC/Paper@60218cd Don't tick empty worlds (#9025) PaperMC/Paper@b21eb4d add overloads to use suspicious effect entry to mushroom cow and suspicious stew meta (#10245) PaperMC/Paper@89d51d5 Allow enabling sand duping (#10191) PaperMC/Paper@6ad63fb Per world ticks per spawn settings (#6891)
44 lines
2.6 KiB
Diff
44 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: 12emin34 <macanovic.emin@gmail.com>
|
|
Date: Tue, 31 Aug 2021 16:48:29 +0200
|
|
Subject: [PATCH] Option for beds to explode on villager sleep
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
index ee509b5eea71c17ff466fb93fe63168710065add..d2b6d094c4b93055a4e6622372c6a0a83bd992a3 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
|
@@ -1111,6 +1111,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
|
|
|
@Override
|
|
public void startSleeping(BlockPos pos) {
|
|
+ // Purpur start
|
|
+ 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
|
|
super.startSleeping(pos);
|
|
this.brain.setMemory(MemoryModuleType.LAST_SLEPT, this.level().getGameTime()); // CraftBukkit - decompile error
|
|
this.brain.eraseMemory(MemoryModuleType.WALK_TARGET);
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 50429a76847b7c655cf88c49f6f3b0dbccda9d8b..9b19961631c0bd2f922820ce0a33bace926afdf7 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -824,6 +824,7 @@ public class PurpurWorldConfig {
|
|
}
|
|
|
|
public boolean bedExplode = true;
|
|
+ public boolean bedExplodeOnVillagerSleep = false;
|
|
public double bedExplosionPower = 5.0D;
|
|
public boolean bedExplosionFire = true;
|
|
public net.minecraft.world.level.Level.ExplosionInteraction bedExplosionEffect = net.minecraft.world.level.Level.ExplosionInteraction.BLOCK;
|
|
@@ -834,6 +835,7 @@ public class PurpurWorldConfig {
|
|
}
|
|
}
|
|
bedExplode = getBoolean("blocks.bed.explode", bedExplode);
|
|
+ bedExplodeOnVillagerSleep = getBoolean("blocks.bed.explode-on-villager-sleep", bedExplodeOnVillagerSleep);
|
|
bedExplosionPower = getDouble("blocks.bed.explosion-power", bedExplosionPower);
|
|
bedExplosionFire = getBoolean("blocks.bed.explosion-fire", bedExplosionFire);
|
|
try {
|