Support 1.17
This commit is contained in:
parent
065585e418
commit
cf508baf2b
3 changed files with 20 additions and 3 deletions
|
|
@ -85,9 +85,9 @@ public class BukkitVersionHelperSpigot117 extends BukkitVersionHelper {
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IRegistry<BiomeBase> reg = null;
|
private static IRegistry<BiomeBase> reg = null;
|
||||||
|
|
||||||
private IRegistry<BiomeBase> getBiomeReg() {
|
public static IRegistry<BiomeBase> getBiomeReg() {
|
||||||
if (reg == null) {
|
if (reg == null) {
|
||||||
reg = MinecraftServer.getServer().getCustomRegistry().b(IRegistry.aO);
|
reg = MinecraftServer.getServer().getCustomRegistry().b(IRegistry.aO);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
package org.dynmap.bukkit.helper.v117;
|
package org.dynmap.bukkit.helper.v117;
|
||||||
|
|
||||||
|
import net.minecraft.resources.MinecraftKey;
|
||||||
|
import net.minecraft.world.level.biome.BiomeBase;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||||
import org.dynmap.DynmapChunk;
|
import org.dynmap.DynmapChunk;
|
||||||
import org.dynmap.bukkit.helper.BukkitWorld;
|
import org.dynmap.bukkit.helper.BukkitWorld;
|
||||||
|
import org.dynmap.common.BiomeMap;
|
||||||
import org.dynmap.common.chunk.GenericChunk;
|
import org.dynmap.common.chunk.GenericChunk;
|
||||||
import org.dynmap.common.chunk.GenericChunkCache;
|
import org.dynmap.common.chunk.GenericChunkCache;
|
||||||
import org.dynmap.common.chunk.GenericMapChunkCache;
|
import org.dynmap.common.chunk.GenericMapChunkCache;
|
||||||
|
|
@ -66,4 +69,18 @@ public class MapChunkCache117 extends GenericMapChunkCache {
|
||||||
this.w = dw.getWorld();
|
this.w = dw.getWorld();
|
||||||
super.setChunks(dw, chunks);
|
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 = BukkitVersionHelperSpigot117.getBiomeReg().get(MinecraftKey.a(bm.getResourcelocation()));
|
||||||
|
return base == null ? colormap[bm.biomeLookup()] : base.l().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 = BukkitVersionHelperSpigot117.getBiomeReg().get(MinecraftKey.a(bm.getResourcelocation()));
|
||||||
|
return base == null ? colormap[bm.biomeLookup()] : base.l().g().a(x, z, base.l().f().orElse(colormap[bm.biomeLookup()]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ runServer {
|
||||||
// Configure the Minecraft version for our task.
|
// Configure the Minecraft version for our task.
|
||||||
// This is the only required configuration besides applying the plugin.
|
// This is the only required configuration besides applying the plugin.
|
||||||
// Your plugin's jar (or shadowJar if present) will be used automatically.
|
// Your plugin's jar (or shadowJar if present) will be used automatically.
|
||||||
minecraftVersion("1.18")
|
minecraftVersion("1.17")
|
||||||
}
|
}
|
||||||
shadowJar {
|
shadowJar {
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue