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

Paper Changes:
PaperMC/Paper@29b17a8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9088)
PaperMC/Paper@b5ce6e3 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9104)
PaperMC/Paper@9cda284 Updated Upstream (Bukkit/CraftBukkit)
PaperMC/Paper@f8c0112 {ci skip} add missing labels to project status map (#9106)
PaperMC/Paper@6a7fef0 Allow entity effect changes off the main thread for worldgen (#8942)
PaperMC/Paper@f8d2f82 Resolve Plugin Dependency Issues, Improve PluginLoading Compat, Small Loading Issues (#9068)
PaperMC/Paper@b626528 Updated Upstream (Bukkit/CraftBukkit)
PaperMC/Paper@058d7c1 Updated Upstream (Bukkit/CraftBukkit/Spigot)
PaperMC/Paper@ab72b12 Update Adventure to 4.13.1 (#9113)
PaperMC/Paper@8be7a60 Fix getBrightness and getRawBrightness throwing exception in BlockStateListPopulator (#9111)
PaperMC/Paper@e811927 Revert "Resolve Plugin Dependency Issues, Improve PluginLoading Compat, Small Loading Issues (#9068)"

Pufferfish Changes:
pufferfish-gg/Pufferfish@da9fd85 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@751dfb0 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@c09a154 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@b778163 Updated Upstream (Paper)
2023-04-10 04:07:19 -07: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 86ffc869b57410fd4993c0fd0ae000da2e2c070c..ada46470d5b774d44b16a6f22fffeae631576690 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2263,6 +2263,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return (this.getHandle().dragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().dragonFight());
}
+ // 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;