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

Paper Changes:
PaperMC/Paper@1cc86be Update setup-gradle action
PaperMC/Paper@b0d7153 fix item meta
PaperMC/Paper@2206b9a fix components
PaperMC/Paper@e73d396 fix asset id
PaperMC/Paper@2a4ba00 add missing effect cause, for bee being poisoned
PaperMC/Paper@4806ce5 properly override push/knockback methods
PaperMC/Paper@bb4fb53 call EntityInsideBlockEvent for eyeblossom
PaperMC/Paper@ae060b3 Finish PlayerPickItemEvent
PaperMC/Paper@c54c062 Port exact choice improvements (#11705)
PaperMC/Paper@e4e24f3 Move around patches again
PaperMC/Paper@4c39ea2 More moving around of hunks
PaperMC/Paper@77afb9a Add new bundle animation (#11708)
PaperMC/Paper@346b9b8 Fixup PlayerPickItemEvent docs more
PaperMC/Paper@d4630f1 Fix broken joml metadata resulting in kotlin being included on compile/runtime classpath (#11712)
2024-12-06 00:45:30 -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 92d9f0ea8f7810ae20d3996f49aefa539b4bcb69..4f3da35084d1c69d1b697196a17f932fedee9b88 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2374,6 +2374,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);