Support 1.13 water toning for biomes

This commit is contained in:
Mike Primm 2018-08-21 00:34:04 -05:00
parent 40545bdcfb
commit 8c7d1f6181
4 changed files with 30 additions and 6 deletions

View File

@ -132,11 +132,11 @@ texture:id=spruce_sapling
texture:id=birch_sapling texture:id=birch_sapling
texture:id=jungle_sapling texture:id=jungle_sapling
texture:id=bedrock texture:id=bedrock
#texture:id=water_still,material=WATER texture:id=water_still,material=WATER
#TODO: fix when I figure out 1.13 biome shading logic #TODO: fix when I figure out 1.13 biome shading logic
texturefile:id=water_still,filename=assets/minecraft/textures/blocks/water_still.png,xcount=1,ycount=1 #texturefile:id=water_still,filename=assets/minecraft/textures/blocks/water_still.png,xcount=1,ycount=1
#texture:id=water_flow,material=WATER texture:id=water_flow,material=WATER
texturefile:id=water_flow,filename=assets/minecraft/textures/blocks/water_flow.png,xcount=1,ycount=1 #texturefile:id=water_flow,filename=assets/minecraft/textures/blocks/water_flow.png,xcount=1,ycount=1
texture:id=lava_still texture:id=lava_still
texture:id=lava_flow texture:id=lava_flow
texture:id=sand texture:id=sand

View File

@ -27,6 +27,9 @@ import org.dynmap.renderer.DynmapBlockState;
import org.dynmap.utils.MapChunkCache; import org.dynmap.utils.MapChunkCache;
import org.dynmap.utils.Polygon; import org.dynmap.utils.Polygon;
import org.dynmap.bukkit.helper.v113.MapChunkCache113; import org.dynmap.bukkit.helper.v113.MapChunkCache113;
import org.dynmap.common.BiomeMap;
import net.minecraft.server.v1_13_R1.BiomeBase;
import net.minecraft.server.v1_13_R1.Block; import net.minecraft.server.v1_13_R1.Block;
import net.minecraft.server.v1_13_R1.BlockFluids; import net.minecraft.server.v1_13_R1.BlockFluids;
import net.minecraft.server.v1_13_R1.IBlockData; import net.minecraft.server.v1_13_R1.IBlockData;
@ -131,4 +134,13 @@ public class BukkitVersionHelperSpigot113 extends BukkitVersionHelperCB {
c.setChunks(dw, chunks); c.setChunks(dw, chunks);
return c; return c;
} }
/**
* Get biome base water multiplier
*/
@Override
public int getBiomeBaseWaterMult(Object bb) {
return ((BiomeBase)bb).n();
}
} }

View File

@ -169,4 +169,11 @@ public abstract class BukkitVersionHelper {
public Object[] getBlockIDFieldFromSnapshot(ChunkSnapshot css) { public Object[] getBlockIDFieldFromSnapshot(ChunkSnapshot css) {
return null; return null;
} }
/**
* Get biome base water multiplier
*/
public int getBiomeBaseWaterMult(Object bb) {
return -1;
}
} }

View File

@ -746,20 +746,25 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
if(bb != null) { if(bb != null) {
float tmp = helper.getBiomeBaseTemperature(bb); float tmp = helper.getBiomeBaseTemperature(bb);
float hum = helper.getBiomeBaseHumidity(bb); float hum = helper.getBiomeBaseHumidity(bb);
int watermult = helper.getBiomeBaseWaterMult(bb);
BiomeMap bmap = BiomeMap.byBiomeID(i); BiomeMap bmap = BiomeMap.byBiomeID(i);
if (bmap.isDefault()) { if (bmap.isDefault()) {
String id = helper.getBiomeBaseIDString(bb); String id = helper.getBiomeBaseIDString(bb);
if(id == null) { if(id == null) {
id = "BIOME_" + i; id = "BIOME_" + i;
} }
BiomeMap m = new BiomeMap(i, id, tmp, hum); bmap = new BiomeMap(i, id, tmp, hum);
Log.verboseinfo("Add custom biome [" + m.toString() + "] (" + i + ")"); Log.verboseinfo("Add custom biome [" + bmap.toString() + "] (" + i + ")");
cnt++; cnt++;
} }
else { else {
bmap.setTemperature(tmp); bmap.setTemperature(tmp);
bmap.setRainfall(hum); bmap.setRainfall(hum);
} }
if (watermult != -1) {
bmap.setWaterColorMultiplier(watermult);
Log.info("Set watercolormult for " + bmap.toString() + " (" + i + ") to " + Integer.toHexString(watermult));
}
} }
} }
if(cnt > 0) { if(cnt > 0) {