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

Paper Changes:
PaperMC/Paper@eda3d53 [ci skip] Improve PlayerChatEvent Deprecation Message (#9956)
PaperMC/Paper@e1cd9e5 Update paperweight to 1.5.10 and Gradle to 8.4 (#9957)
PaperMC/Paper@96d5e6c Code Generation for TypedKeys (#9233)
PaperMC/Paper@ed753d3 Re-add missing vanilla safeMode arg
PaperMC/Paper@334b2f2 Fix max nearby entities class check (#9967)
PaperMC/Paper@faa2f47 Lazily create LootContext for criterions (#9969)
PaperMC/Paper@8280211 Fix yaw being ignored for first spawn pos (#9959)
PaperMC/Paper@8eac3e1 Don't fire EntityPotionEffectEvent during worldgen (#9965)
PaperMC/Paper@0b20f94 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9953)
PaperMC/Paper@f9938d3 Fix plugin bootstrap dependency tree population (#9963)
PaperMC/Paper@b37bbcf Use ? super in Consumer/Predicate API (#9939)
2023-11-26 22:27:45 -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 f19f2199cac5a7eb275f40cc23472416a40ec0da..14e9e5ad1338c8cbb7fd6302794fa98c707cb2d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2348,6 +2348,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;