mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-24 01:27:37 +01:00
Support 1.18
This commit is contained in:
parent
5f29846645
commit
f34929c6cf
@ -104,7 +104,7 @@ public class BukkitVersionHelperSpigot118 extends BukkitVersionHelper {
|
||||
|
||||
private static IRegistry<BiomeBase> reg = null;
|
||||
|
||||
private static IRegistry<BiomeBase> getBiomeReg() {
|
||||
public static IRegistry<BiomeBase> getBiomeReg() {
|
||||
if (reg == null) {
|
||||
reg = MinecraftServer.getServer().aV().d(IRegistry.aR);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.dynmap.bukkit.helper.v118;
|
||||
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.level.biome.BiomeBase;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
@ -85,4 +87,19 @@ public class MapChunkCache118 extends GenericMapChunkCache {
|
||||
this.w = dw.getWorld();
|
||||
super.setChunks(dw, chunks);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getFoliageColor(BiomeMap bm, int[] colormap, int x, int z) {
|
||||
if (bm.getResourcelocation() == null) return colormap[bm.biomeLookup()];
|
||||
BiomeBase base = BukkitVersionHelperSpigot118.getBiomeReg().a(MinecraftKey.a(bm.getResourcelocation()));
|
||||
return base == null ? colormap[bm.biomeLookup()] : base.j().e().orElse(colormap[bm.biomeLookup()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGrassColor(BiomeMap bm, int[] colormap, int x, int z) {
|
||||
if (bm.getResourcelocation() == null) return colormap[bm.biomeLookup()];
|
||||
BiomeBase base = BukkitVersionHelperSpigot118.getBiomeReg().a(MinecraftKey.a(bm.getResourcelocation()));
|
||||
return base == null ? colormap[bm.biomeLookup()] : base.j().g().a(x, z, base.j().f().orElse(colormap[bm.biomeLookup()]));
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ runServer {
|
||||
// Configure the Minecraft version for our task.
|
||||
// This is the only required configuration besides applying the plugin.
|
||||
// Your plugin's jar (or shadowJar if present) will be used automatically.
|
||||
minecraftVersion("1.18.2")
|
||||
minecraftVersion("1.18")
|
||||
}
|
||||
shadowJar {
|
||||
dependencies {
|
||||
|
Loading…
Reference in New Issue
Block a user