Files
Purpur/patches/server/0247-Add-local-difficulty-api.patch
granny 200178d7b3 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@7b13d93 Updated Upstream (Bukkit/CraftBukkit) (#11626)
PaperMC/Paper@4e2291e chore: refactor issue templates
PaperMC/Paper@bc4a705 [ci skip] chore: change paste.gg links to mclo.gs (#11629)
PaperMC/Paper@3480489 Update Alternate Current patch to 1.21.3 (#11602)
PaperMC/Paper@575c1c4 Update disableGameRuleLimits casing
PaperMC/Paper@11d708d [ci skip] Add missing feature patch identifiers
PaperMC/Paper@daf3113 Make logs less annoying
PaperMC/Paper@4e01ede Fix inverted global skip check
PaperMC/Paper@d8b66dd fix: move to jline-terminal-ffm on java 22+ and fall back to jni on 21, fixes #10405
PaperMC/Paper@6735c60 Fix enderchest opening animation (#11635)
PaperMC/Paper@de6173b Item DataComponent API (#10845)
PaperMC/Paper@8c5b837 Rework async chunk api implementation
PaperMC/Paper@37b9630 Do not create unneccessary callback in ChunkTaskScheduler#scheduleChunkLoad
PaperMC/Paper@878da16 Fix non block ticking chunks not sending block/light updates
PaperMC/Paper@fdef6d3 Add missing NotNull annotation for getChunksAtAsync cb param
PaperMC/Paper@01dd50f [ci skip] Rebuild patches
PaperMC/Paper@f9f964d Fix drops for shearing bogged (#11628)
PaperMC/Paper@21cc763 Fix drops for shearing mushroom cow (#11632)
PaperMC/Paper@57eab3e Add PlayerItemGroupCooldownEvent (#11625)
PaperMC/Paper@d0dcd7d Fix incorrect invulnerability damage reduction (#11599)
PaperMC/Paper@85bfdc0 Fix NPE when EntityResurrectEvent is uncancelled (#11636)
2024-11-19 03:55:58 -08:00

24 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Sat, 9 Jul 2022 00:57:32 -0500
Subject: [PATCH] Add local difficulty api
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..10413e550895f21cac43f5a15eaf51e51313b06f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2379,6 +2379,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
}
+ // Purpur start
+ public float getLocalDifficultyAt(Location location) {
+ return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty();
+ }
+ // Purpur end
+
@Override
public Collection<GeneratedStructure> getStructures(int x, int z) {
return this.getStructures(x, z, struct -> true);