Fixed PlaceholderAPI issues.

This commit is contained in:
Vatuu
2022-07-01 20:59:54 +02:00
parent 7d78c69b6e
commit 1c3668047b
@@ -20,6 +20,7 @@ package com.volmit.iris.core.link;
import com.volmit.iris.Iris; import com.volmit.iris.Iris;
import com.volmit.iris.core.tools.IrisToolbelt; import com.volmit.iris.core.tools.IrisToolbelt;
import com.volmit.iris.engine.object.IrisBiome;
import com.volmit.iris.engine.platform.PlatformChunkGenerator; import com.volmit.iris.engine.platform.PlatformChunkGenerator;
import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.Location; import org.bukkit.Location;
@@ -59,15 +60,15 @@ public class IrisPapiExpansion extends PlaceholderExpansion {
if(p.equalsIgnoreCase("biome_name")) { if(p.equalsIgnoreCase("biome_name")) {
if(a != null) { if(a != null) {
return a.getEngine().getBiome(l).getName(); return getBiome(a, l).getName();
} }
} else if(p.equalsIgnoreCase("biome_id")) { } else if(p.equalsIgnoreCase("biome_id")) {
if(a != null) { if(a != null) {
return a.getEngine().getBiome(l).getLoadKey(); return getBiome(a, l).getLoadKey();
} }
} else if(p.equalsIgnoreCase("biome_file")) { } else if(p.equalsIgnoreCase("biome_file")) {
if(a != null) { if(a != null) {
return a.getEngine().getBiome(l).getLoadFile().getPath(); return getBiome(a, l).getLoadFile().getPath();
} }
} else if(p.equalsIgnoreCase("region_name")) { } else if(p.equalsIgnoreCase("region_name")) {
if(a != null) { if(a != null) {
@@ -107,4 +108,8 @@ public class IrisPapiExpansion extends PlaceholderExpansion {
return null; return null;
} }
private IrisBiome getBiome(PlatformChunkGenerator a, Location l) {
return a.getEngine().getBiome(l.getBlockX(), l.getBlockY() - l.getWorld().getMinHeight(), l.getBlockZ());
}
} }