mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-09-25 12:22:39 +02:00
Add hide-land option for Underwater view shader (default = true)
This commit is contained in:
parent
776d351ab2
commit
4afef4503a
@ -7,6 +7,7 @@ import org.dynmap.utils.MapChunkCache;
|
||||
import org.dynmap.utils.MapIterator;
|
||||
|
||||
public class TexturePackHDUnderwaterShader extends TexturePackHDShader {
|
||||
private boolean hide_land = true;
|
||||
|
||||
class UnderwaterShaderState extends TexturePackHDShader.ShaderState {
|
||||
private boolean ready;
|
||||
@ -19,7 +20,7 @@ public class TexturePackHDUnderwaterShader extends TexturePackHDShader {
|
||||
@Override
|
||||
public void reset(HDPerspectiveState ps) {
|
||||
super.reset(ps);
|
||||
ready = false;
|
||||
ready = (!hide_land); // Start ready if not hiding land
|
||||
}
|
||||
/**
|
||||
* Process next ray step - called for each block on route
|
||||
@ -30,12 +31,14 @@ public class TexturePackHDUnderwaterShader extends TexturePackHDShader {
|
||||
if (bs.isWater() || bs.isWaterlogged()) {
|
||||
ready = true;
|
||||
this.lastblk = full_water;
|
||||
this.lastblkhit = full_water;
|
||||
}
|
||||
return ready ? super.processBlock(ps) : false;
|
||||
}
|
||||
}
|
||||
public TexturePackHDUnderwaterShader(DynmapCore core, ConfigurationNode configuration) {
|
||||
super(core, configuration);
|
||||
hide_land = configuration.getBoolean("hide-land", true);
|
||||
}
|
||||
@Override
|
||||
public HDShaderState getStateInstance(HDMap map, MapChunkCache cache, MapIterator mapiter, int scale) {
|
||||
|
@ -80,6 +80,12 @@ shaders:
|
||||
- class: org.dynmap.hdmap.TexturePackHDUnderwaterShader
|
||||
name: stdtexture-underwater
|
||||
texturepack: standard
|
||||
|
||||
# Standard texture underwater view shader (with land not hidden)
|
||||
- class: org.dynmap.hdmap.TexturePackHDUnderwaterShader
|
||||
name: stdtexture-underwater-keep-land
|
||||
texturepack: standard
|
||||
hide-land: false
|
||||
|
||||
# Texture pack based shader for standard Minecraft textures, without biome-tinted grass/leaves
|
||||
- class: org.dynmap.hdmap.TexturePackHDShader
|
||||
|
Loading…
Reference in New Issue
Block a user