Add local difficulty api

This commit is contained in:
BillyGalbreath
2025-01-12 15:42:34 -08:00
committed by granny
parent dc60c29e5d
commit c544757d8c
2 changed files with 2 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2346,6 +_,12 @@
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
}
+ // Purpur start - Add local difficulty api
+ public float getLocalDifficultyAt(Location location) {
+ return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty();
+ }
+ // Purpur end - Add local difficulty api
+
@Override
public Collection<GeneratedStructure> getStructures(int x, int z) {
return this.getStructures(x, z, struct -> true);