mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Add local difficulty api
This commit is contained in:
24
patches/server/0284-Add-local-difficulty-api.patch
Normal file
24
patches/server/0284-Add-local-difficulty-api.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
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 00fbf9ffdfa1c0d821ff86108c33e8b62a3d1268..295e3372d1e986549c96397c6ce26fb37e49f1ac 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2234,6 +2234,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
public DragonBattle getEnderDragonBattle() {
|
||||
return (this.getHandle().dragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().dragonFight());
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public float getLocalDifficultyAt(Location location) {
|
||||
+ return getHandle().getCurrentDifficultyAt(net.minecraft.server.MCUtil.toBlockPosition(location)).getEffectiveDifficulty();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start
|
||||
@Override
|
||||
public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) {
|
||||
Reference in New Issue
Block a user