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

Paper Changes:
PaperMC/Paper@4d111a3 Un-experimentalize Entity TP APIs (#9964)
PaperMC/Paper@2182d47 Update mapping-io (#9975)
PaperMC/Paper@9993eb9 Updates documentation in EntityEquipment.java (#9992)
PaperMC/Paper@2184fbc Log correct recipes and advancement count on server start (#9978)
PaperMC/Paper@8bda1f7 Remove unnecessary durability check in ItemStack#isSimilar (#9979)
PaperMC/Paper@977a729 [ci skip] Correct Windows requiring path to gradlew (#9976)
PaperMC/Paper@3766afa [ci skip] Add mention of FQ imports (#9994)
PaperMC/Paper@40872ec Fix CraftMetaItem#addAttributeModifier duplication check (#9995)
PaperMC/Paper@ffa4115 Configurable Dry and Wet Farmland Tick Rates (#9968)
PaperMC/Paper@37bee09 Restore vanilla entity drops behavior (#7650)
PaperMC/Paper@5cbd535 Fix Mushroom cow stew api (#9934)
PaperMC/Paper@8e061ce Add Structure check API (#9062)
PaperMC/Paper@9271ee7 Dont resend blocks on interactions (#9413)
PaperMC/Paper@931781c [ci skip] rebuild patches
2023-12-06 16:18:27 -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 90c76ddcb8af13409490b8976263d27a71954668..99df34c7efb003d63142a1cd191d863c5315b4cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2354,6 +2354,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 PersistentDataContainer getPersistentDataContainer() {
return this.persistentDataContainer;