mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Add texture generators for fire, lava, water; fix water lighting and biome shading to match MC client; fix lily, birch, pine leaf shading to match client
This commit is contained in:
parent
a9b9a7c5c6
commit
204b54155a
@ -15,6 +15,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
@ -74,6 +75,9 @@ public class TexturePack {
|
||||
private static final int COLORMOD_INCLINEDTORCH = 10;
|
||||
private static final int COLORMOD_GRASSSIDE = 11;
|
||||
private static final int COLORMOD_CLEARINSIDE = 12;
|
||||
private static final int COLORMOD_PINETONED = 13;
|
||||
private static final int COLORMOD_BIRCHTONED = 14;
|
||||
private static final int COLORMOD_LILYTONED = 15;
|
||||
|
||||
/* Special tile index values */
|
||||
private static final int BLOCKINDEX_BLANK = -1;
|
||||
@ -94,7 +98,8 @@ public class TexturePack {
|
||||
private static final int BLOCKINDEX_PISTONSIDE_EXT = 262;
|
||||
private static final int BLOCKINDEX_PANETOP_X = 263;
|
||||
private static final int BLOCKINDEX_AIRFRAME_EYE = 264;
|
||||
private static final int MAX_BLOCKINDEX = 264; /* Index of last static tile definition */
|
||||
private static final int BLOCKINDEX_FIRE = 265;
|
||||
private static final int MAX_BLOCKINDEX = 265; /* Index of last static tile definition */
|
||||
private static final int BLOCKTABLELEN = 1000; /* Leave room for dynmaic tiles */
|
||||
|
||||
private static int next_dynamic_tile = MAX_BLOCKINDEX+1;
|
||||
@ -123,7 +128,11 @@ public class TexturePack {
|
||||
private static final int IMG_CUSTOMLAVAMOVING = 5;
|
||||
private static final int IMG_CUSTOMLAVASTILL = 6;
|
||||
private static final int IMG_WATERCOLOR = 7;
|
||||
private static final int IMG_CNT = 8;
|
||||
private static final int IMG_WATERMOVING = 8;
|
||||
private static final int IMG_LAVA = 9;
|
||||
private static final int IMG_LAVAMOVING = 10;
|
||||
private static final int IMG_FIRE = 11;
|
||||
private static final int IMG_CNT = 12;
|
||||
/* 0-(IMG_CNT-1) are fixed, IMG_CNT+x is dynamic file x */
|
||||
private LoadedImage[] imgs;
|
||||
|
||||
@ -225,8 +234,17 @@ public class TexturePack {
|
||||
private TexturePack(String tpname) throws FileNotFoundException {
|
||||
ZipFile zf = null;
|
||||
File texturedir = getTexturePackDirectory();
|
||||
|
||||
/* Set up for enough files */
|
||||
imgs = new LoadedImage[IMG_CNT + addonfiles.size()];
|
||||
|
||||
/* Generate still and flowing water defaults */
|
||||
generateWater();
|
||||
generateWaterFlowing();
|
||||
generateLava();
|
||||
generateLavaFlow();
|
||||
generateFire();
|
||||
|
||||
File f = new File(texturedir, tpname);
|
||||
try {
|
||||
/* Try to open zip */
|
||||
@ -244,6 +262,13 @@ public class TexturePack {
|
||||
}
|
||||
loadTerrainPNG(is);
|
||||
is.close();
|
||||
/* Patch in generated defaults */
|
||||
patchTextureWithImage(IMG_WATER, BLOCKINDEX_STATIONARYWATER);
|
||||
patchTextureWithImage(IMG_WATERMOVING, BLOCKINDEX_MOVINGWATER);
|
||||
patchTextureWithImage(IMG_LAVA, BLOCKINDEX_STATIONARYLAVA);
|
||||
patchTextureWithImage(IMG_LAVAMOVING, BLOCKINDEX_MOVINGLAVA);
|
||||
patchTextureWithImage(IMG_FIRE, BLOCKINDEX_FIRE);
|
||||
|
||||
/* Try to find and load misc/grasscolor.png */
|
||||
ze = zf.getEntry(GRASSCOLOR_PNG);
|
||||
if(ze == null) { /* Fall back to standard file */
|
||||
@ -280,20 +305,6 @@ public class TexturePack {
|
||||
}
|
||||
loadBiomeShadingImage(is, IMG_WATERCOLOR);
|
||||
is.close();
|
||||
|
||||
/* Try to find and load misc/water.png */
|
||||
ze = zf.getEntry(WATER_PNG);
|
||||
if(ze == null) {
|
||||
File ff = new File(texturedir, STANDARDTP + "/" + WATER_PNG);
|
||||
is = new FileInputStream(ff);
|
||||
}
|
||||
else {
|
||||
is = zf.getInputStream(ze);
|
||||
}
|
||||
loadImage(is, IMG_WATER);
|
||||
patchTextureWithImage(IMG_WATER, BLOCKINDEX_STATIONARYWATER);
|
||||
patchTextureWithImage(IMG_WATER, BLOCKINDEX_MOVINGWATER);
|
||||
is.close();
|
||||
|
||||
/* Optional files - process if they exist */
|
||||
ze = zf.getEntry(CUSTOMLAVAFLOWING_PNG);
|
||||
@ -354,6 +365,14 @@ public class TexturePack {
|
||||
fis = new FileInputStream(f);
|
||||
loadTerrainPNG(fis);
|
||||
fis.close();
|
||||
|
||||
/* Patch in generated defaults */
|
||||
patchTextureWithImage(IMG_WATER, BLOCKINDEX_STATIONARYWATER);
|
||||
patchTextureWithImage(IMG_WATERMOVING, BLOCKINDEX_MOVINGWATER);
|
||||
patchTextureWithImage(IMG_LAVA, BLOCKINDEX_STATIONARYLAVA);
|
||||
patchTextureWithImage(IMG_LAVAMOVING, BLOCKINDEX_MOVINGLAVA);
|
||||
patchTextureWithImage(IMG_FIRE, BLOCKINDEX_FIRE);
|
||||
|
||||
/* Check for misc/grasscolor.png */
|
||||
f = new File(texturedir, tpname + "/" + GRASSCOLOR_PNG);
|
||||
if(!f.canRead()) {
|
||||
@ -378,16 +397,7 @@ public class TexturePack {
|
||||
fis = new FileInputStream(f);
|
||||
loadBiomeShadingImage(fis, IMG_WATERCOLOR);
|
||||
fis.close();
|
||||
/* Check for misc/water.png */
|
||||
f = new File(texturedir, tpname + "/" + WATER_PNG);
|
||||
if(!f.canRead()) {
|
||||
f = new File(texturedir, STANDARDTP + "/" + WATER_PNG);
|
||||
}
|
||||
fis = new FileInputStream(f);
|
||||
loadImage(fis, IMG_WATER);
|
||||
patchTextureWithImage(IMG_WATER, BLOCKINDEX_STATIONARYWATER);
|
||||
patchTextureWithImage(IMG_WATER, BLOCKINDEX_MOVINGWATER);
|
||||
fis.close();
|
||||
|
||||
/* Optional files - process if they exist */
|
||||
f = new File(texturedir, tpname + "/" + CUSTOMLAVAFLOWING_PNG);
|
||||
if(f.canRead()) {
|
||||
@ -1174,6 +1184,7 @@ public class TexturePack {
|
||||
rslt.setARGB(texture[v*native_scale + u]);
|
||||
|
||||
LoadedImage li = null;
|
||||
int clrmult = -1;
|
||||
/* Switch based on texture modifier */
|
||||
switch(textop) {
|
||||
case COLORMOD_GRASSTONED:
|
||||
@ -1183,23 +1194,31 @@ public class TexturePack {
|
||||
li = imgs[IMG_FOLIAGECOLOR];
|
||||
break;
|
||||
case COLORMOD_WATERTONED:
|
||||
if(water_shaded)
|
||||
li = imgs[IMG_WATERCOLOR];
|
||||
if(swamp_shaded && (mapiter.getBiome() == Biome.SWAMPLAND))
|
||||
clrmult = 0xFFE0FF70;
|
||||
break;
|
||||
case COLORMOD_BIRCHTONED:
|
||||
clrmult = 0xFF80a755; /* From ColorizerFoliage.java in MCP */
|
||||
break;
|
||||
case COLORMOD_PINETONED:
|
||||
clrmult = 0xFF619961; /* From ColorizerFoliage.java in MCP */
|
||||
break;
|
||||
case COLORMOD_LILYTONED:
|
||||
clrmult = 0xFF208030; /* from BlockLilyPad.java in MCP */
|
||||
break;
|
||||
}
|
||||
if(li != null) {
|
||||
int clr;
|
||||
if((li.argb == null) || (!biome_shaded)) {
|
||||
clr = li.trivial_color;
|
||||
clrmult = li.trivial_color;
|
||||
}
|
||||
else {
|
||||
clr = biomeLookup(li.argb, li.width, mapiter.getRawBiomeRainfall(), mapiter.getRawBiomeTemperature());
|
||||
}
|
||||
if((clr & 0xFF000000) != 0) {
|
||||
if(swamp_shaded && (mapiter.getBiome() == Biome.SWAMPLAND))
|
||||
clr = (clr & 0xFF000000) | (((clr & 0x00FEFEFE) + 0x4E0E4E) / 2);
|
||||
rslt.blendColor(clr);
|
||||
clrmult = biomeLookup(li.argb, li.width, mapiter.getRawBiomeRainfall(), mapiter.getRawBiomeTemperature());
|
||||
}
|
||||
if(swamp_shaded && (mapiter.getBiome() == Biome.SWAMPLAND))
|
||||
clrmult = (clrmult & 0xFF000000) | (((clrmult & 0x00FEFEFE) + 0x4E0E4E) / 2);
|
||||
}
|
||||
if((clrmult != -1) && (clrmult != 0)) {
|
||||
rslt.blendColor(clrmult);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1263,4 +1282,382 @@ public class TexturePack {
|
||||
}
|
||||
return f.tile_to_dyntile[tile_id];
|
||||
}
|
||||
|
||||
/* Based on TextureWaterFX.java in MCP */
|
||||
private void generateWater() {
|
||||
imgs[IMG_WATER] = new LoadedImage();
|
||||
imgs[IMG_WATER].width = 16;
|
||||
imgs[IMG_WATER].height = 16;
|
||||
imgs[IMG_WATER].argb = new int[256];
|
||||
|
||||
float[] g = new float[256];
|
||||
float[] h = new float[256];
|
||||
float[] n = new float[256];
|
||||
float[] m = new float[256];
|
||||
Color c = new Color();
|
||||
Random r = new Random(1234); /* Need to be deterministic */
|
||||
int kk;
|
||||
|
||||
for(kk = 0; kk < 200; kk++) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int k = 0; k < 16; k++)
|
||||
{
|
||||
float f = 0.0F;
|
||||
for(int j1 = i - 1; j1 <= i + 1; j1++)
|
||||
{
|
||||
int k1 = j1 & 0xf;
|
||||
int i2 = k & 0xf;
|
||||
f += g[k1 + i2 * 16];
|
||||
}
|
||||
|
||||
h[i + k * 16] = f / 3.3F + n[i + k * 16] * 0.8F;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
for(int l = 0; l < 16; l++)
|
||||
{
|
||||
n[j + l * 16] += m[j + l * 16] * 0.05F;
|
||||
if(n[j + l * 16] < 0.0F)
|
||||
{
|
||||
n[j + l * 16] = 0.0F;
|
||||
}
|
||||
m[j + l * 16] -= 0.1F;
|
||||
if(r.nextDouble() < 0.050000000000000003D)
|
||||
{
|
||||
m[j + l * 16] = 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float af[] = h;
|
||||
h = g;
|
||||
g = af;
|
||||
}
|
||||
for(int i1 = 0; i1 < 256; i1++)
|
||||
{
|
||||
float f1 = g[i1];
|
||||
if(f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
if(f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
float f2 = f1 * f1;
|
||||
int l1 = (int)(32F + f2 * 32F);
|
||||
int j2 = (int)(50F + f2 * 64F);
|
||||
int k2 = 255;
|
||||
int l2 = (int)(146F + f2 * 50F);
|
||||
|
||||
c.setRGBA(l1, j2, k2, l2);
|
||||
imgs[IMG_WATER].argb[i1] = c.getARGB();
|
||||
}
|
||||
}
|
||||
|
||||
/* Based on TextureWaterFlowingFX.java in MCP */
|
||||
private void generateWaterFlowing() {
|
||||
|
||||
imgs[IMG_WATERMOVING] = new LoadedImage();
|
||||
imgs[IMG_WATERMOVING].width = 16;
|
||||
imgs[IMG_WATERMOVING].height = 16;
|
||||
imgs[IMG_WATERMOVING].argb = new int[256];
|
||||
|
||||
float[] g = new float[256];
|
||||
float[] h = new float[256];
|
||||
float[] n = new float[256];
|
||||
float[] m = new float[256];
|
||||
Color c = new Color();
|
||||
Random r = new Random(1234); /* Need to be deterministic */
|
||||
|
||||
int kk;
|
||||
for(kk = 0; kk < 200; kk++) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int k = 0; k < 16; k++)
|
||||
{
|
||||
float f = 0.0F;
|
||||
for(int j1 = k - 2; j1 <= k; j1++)
|
||||
{
|
||||
int k1 = i & 0xf;
|
||||
int i2 = j1 & 0xf;
|
||||
f += g[k1 + i2 * 16];
|
||||
}
|
||||
|
||||
h[i + k * 16] = f / 3.2F + n[i + k * 16] * 0.8F;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
for(int l = 0; l < 16; l++)
|
||||
{
|
||||
n[j + l * 16] += m[j + l * 16] * 0.05F;
|
||||
if(n[j + l * 16] < 0.0F)
|
||||
{
|
||||
n[j + l * 16] = 0.0F;
|
||||
}
|
||||
m[j + l * 16] -= 0.3F;
|
||||
if(r.nextDouble() < 0.20000000000000001D)
|
||||
{
|
||||
m[j + l * 16] = 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float af[] = h;
|
||||
h = g;
|
||||
g = af;
|
||||
}
|
||||
for(int i1 = 0; i1 < 256; i1++)
|
||||
{
|
||||
float f1 = g[i1 - kk * 16 & 0xff];
|
||||
if(f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
if(f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
float f2 = f1 * f1;
|
||||
int l1 = (int)(32F + f2 * 32F);
|
||||
int j2 = (int)(50F + f2 * 64F);
|
||||
int k2 = 255;
|
||||
int l2 = (int)(146F + f2 * 50F);
|
||||
|
||||
c.setRGBA(l1, j2, k2, l2);
|
||||
imgs[IMG_WATERMOVING].argb[i1] = c.getARGB();
|
||||
}
|
||||
}
|
||||
|
||||
/* Based on TextureLavaFX.java in MCP */
|
||||
private void generateLava() {
|
||||
imgs[IMG_LAVA] = new LoadedImage();
|
||||
imgs[IMG_LAVA].width = 16;
|
||||
imgs[IMG_LAVA].height = 16;
|
||||
imgs[IMG_LAVA].argb = new int[256];
|
||||
|
||||
float[] g = new float[256];
|
||||
float[] h = new float[256];
|
||||
float[] n = new float[256];
|
||||
float[] m = new float[256];
|
||||
Color c = new Color();
|
||||
Random r = new Random(1234); /* Need to be deterministic */
|
||||
|
||||
int kk;
|
||||
for(kk = 0; kk < 200; kk++) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
float f = 0.0F;
|
||||
int l = (int)(Math.sin(((float)j * 3.141593F * 2.0F) / 16F) * 1.2F);
|
||||
int i1 = (int)(Math.sin(((float)i * 3.141593F * 2.0F) / 16F) * 1.2F);
|
||||
for(int k1 = i - 1; k1 <= i + 1; k1++)
|
||||
{
|
||||
for(int i2 = j - 1; i2 <= j + 1; i2++)
|
||||
{
|
||||
int k2 = k1 + l & 0xf;
|
||||
int i3 = i2 + i1 & 0xf;
|
||||
f += g[k2 + i3 * 16];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
h[i + j * 16] = f / 10F + ((n[(i + 0 & 0xf) + (j + 0 & 0xf) * 16] + n[(i + 1 & 0xf) + (j + 0 & 0xf) * 16] + n[(i + 1 & 0xf) + (j + 1 & 0xf) * 16] + n[(i + 0 & 0xf) + (j + 1 & 0xf) * 16]) / 4F) * 0.8F;
|
||||
n[i + j * 16] += m[i + j * 16] * 0.01F;
|
||||
if(n[i + j * 16] < 0.0F)
|
||||
{
|
||||
n[i + j * 16] = 0.0F;
|
||||
}
|
||||
m[i + j * 16] -= 0.06F;
|
||||
if(r.nextDouble() < 0.005D)
|
||||
{
|
||||
m[i + j * 16] = 1.5F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float af[] = h;
|
||||
h = g;
|
||||
g = af;
|
||||
}
|
||||
for(int k = 0; k < 256; k++)
|
||||
{
|
||||
float f1 = g[k] * 2.0F;
|
||||
if(f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
if(f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
float f2 = f1;
|
||||
int j1 = (int)(f2 * 100F + 155F);
|
||||
int l1 = (int)(f2 * f2 * 255F);
|
||||
int j2 = (int)(f2 * f2 * f2 * f2 * 128F);
|
||||
|
||||
c.setRGBA(j1, l1, j2, 255);
|
||||
imgs[IMG_LAVA].argb[k] = c.getARGB();
|
||||
}
|
||||
}
|
||||
|
||||
/* Based on TextureLavaFlowFX.java in MCP */
|
||||
private void generateLavaFlow() {
|
||||
imgs[IMG_LAVAMOVING] = new LoadedImage();
|
||||
imgs[IMG_LAVAMOVING].width = 16;
|
||||
imgs[IMG_LAVAMOVING].height = 16;
|
||||
imgs[IMG_LAVAMOVING].argb = new int[256];
|
||||
|
||||
float[] g = new float[256];
|
||||
float[] h = new float[256];
|
||||
float[] n = new float[256];
|
||||
float[] m = new float[256];
|
||||
Color c = new Color();
|
||||
Random r = new Random(1234); /* Need to be deterministic */
|
||||
|
||||
int kk;
|
||||
for(kk = 0; kk < 200; kk++) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int j = 0; j < 16; j++)
|
||||
{
|
||||
float f = 0.0F;
|
||||
int l = (int)(Math.sin(((float)j * 3.141593F * 2.0F) / 16F) * 1.2F);
|
||||
int i1 = (int)(Math.sin(((float)i * 3.141593F * 2.0F) / 16F) * 1.2F);
|
||||
for(int k1 = i - 1; k1 <= i + 1; k1++)
|
||||
{
|
||||
for(int i2 = j - 1; i2 <= j + 1; i2++)
|
||||
{
|
||||
int k2 = k1 + l & 0xf;
|
||||
int i3 = i2 + i1 & 0xf;
|
||||
f += g[k2 + i3 * 16];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
h[i + j * 16] = f / 10F + ((n[(i + 0 & 0xf) + (j + 0 & 0xf) * 16] + n[(i + 1 & 0xf) + (j + 0 & 0xf) * 16] + n[(i + 1 & 0xf) + (j + 1 & 0xf) * 16] + n[(i + 0 & 0xf) + (j + 1 & 0xf) * 16]) / 4F) * 0.8F;
|
||||
n[i + j * 16] += m[i + j * 16] * 0.01F;
|
||||
if(n[i + j * 16] < 0.0F)
|
||||
{
|
||||
n[i + j * 16] = 0.0F;
|
||||
}
|
||||
m[i + j * 16] -= 0.06F;
|
||||
if(r.nextDouble() < 0.005D)
|
||||
{
|
||||
m[i + j * 16] = 1.5F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
float af[] = h;
|
||||
h = g;
|
||||
g = af;
|
||||
}
|
||||
for(int k = 0; k < 256; k++)
|
||||
{
|
||||
float f1 = g[k - (kk / 3) * 16 & 0xff] * 2.0F;
|
||||
if(f1 > 1.0F)
|
||||
{
|
||||
f1 = 1.0F;
|
||||
}
|
||||
if(f1 < 0.0F)
|
||||
{
|
||||
f1 = 0.0F;
|
||||
}
|
||||
float f2 = f1;
|
||||
int j1 = (int)(f2 * 100F + 155F);
|
||||
int l1 = (int)(f2 * f2 * 255F);
|
||||
int j2 = (int)(f2 * f2 * f2 * f2 * 128F);
|
||||
|
||||
c.setRGBA(j1, l1, j2, 255);
|
||||
imgs[IMG_LAVAMOVING].argb[k] = c.getARGB();
|
||||
}
|
||||
|
||||
}
|
||||
/* Adapted from TextureFlamesFX.java in MCP */
|
||||
private void generateFire() {
|
||||
imgs[IMG_FIRE] = new LoadedImage();
|
||||
imgs[IMG_FIRE].width = 16;
|
||||
imgs[IMG_FIRE].height = 16;
|
||||
imgs[IMG_FIRE].argb = new int[256];
|
||||
|
||||
float[] g = new float[320];
|
||||
float[] h = new float[320];
|
||||
Random r = new Random(666);
|
||||
Color cc = new Color();
|
||||
|
||||
for(int kk = 0; kk < 200; kk++) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
for(int j = 0; j < 20; j++)
|
||||
{
|
||||
int l = 18;
|
||||
float f1 = g[i + ((j + 1) % 20) * 16] * (float)l;
|
||||
for(int i1 = i - 1; i1 <= i + 1; i1++)
|
||||
{
|
||||
for(int k1 = j; k1 <= j + 1; k1++)
|
||||
{
|
||||
int i2 = i1;
|
||||
int k2 = k1;
|
||||
if(i2 >= 0 && k2 >= 0 && i2 < 16 && k2 < 20)
|
||||
{
|
||||
f1 += g[i2 + k2 * 16];
|
||||
}
|
||||
l++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
h[i + j * 16] = f1 / ((float)l * 1.06F);
|
||||
if(j >= 19)
|
||||
{
|
||||
h[i + j * 16] = (float)(r.nextDouble() * r.nextDouble() * r.nextDouble() * 4D + r.nextDouble() * 0.10000000149011612D + 0.20000000298023224D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float af[] = h;
|
||||
h = g;
|
||||
g = af;
|
||||
}
|
||||
for(int k = 0; k < 256; k++)
|
||||
{
|
||||
float f = g[k] * 1.8F;
|
||||
if(f > 1.0F)
|
||||
{
|
||||
f = 1.0F;
|
||||
}
|
||||
if(f < 0.0F)
|
||||
{
|
||||
f = 0.0F;
|
||||
}
|
||||
float f2 = f;
|
||||
int j1 = (int)(f2 * 155F + 100F);
|
||||
int l1 = (int)(f2 * f2 * 255F);
|
||||
int j2 = (int)(f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * f2 * 255F);
|
||||
int c = 255;
|
||||
if(f2 < 0.5F)
|
||||
{
|
||||
c = 0;
|
||||
}
|
||||
f2 = (f2 - 0.5F) * 2.0F;
|
||||
cc.setRGBA(j1, l1, j2, c);
|
||||
imgs[IMG_FIRE].argb[k] = cc.getARGB();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
private boolean do_biome_shading;
|
||||
private boolean do_swamp_shading;
|
||||
private boolean do_water_shading;
|
||||
private boolean has_hit;
|
||||
|
||||
private OurShaderState(MapIterator mapiter, HDMap map, MapChunkCache cache) {
|
||||
this.mapiter = mapiter;
|
||||
@ -97,6 +98,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
do_biome_shading = biome_shaded; // && (cache.getWorld().getEnvironment() == Environment.NORMAL);
|
||||
do_swamp_shading = do_biome_shading && swamp_shaded;
|
||||
do_water_shading = do_biome_shading && waterbiomeshaded;
|
||||
has_hit = false;
|
||||
}
|
||||
/**
|
||||
* Get our shader
|
||||
@ -126,6 +128,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
for(int i = 0; i < color.length; i++)
|
||||
color[i].setTransparent();
|
||||
lastblkid = 0;
|
||||
has_hit = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,6 +148,7 @@ public class TexturePackHDShader implements HDShader {
|
||||
scaledtp.readColor(ps, mapiter, c, blocktype, lastblocktype, do_biome_shading, do_swamp_shading, do_water_shading);
|
||||
|
||||
if (c.getAlpha() > 0) {
|
||||
has_hit = true;
|
||||
int subalpha = ps.getSubmodelAlpha();
|
||||
/* Scale brightness depending upon face */
|
||||
switch(ps.getLastBlockStep()) {
|
||||
|
@ -1215,61 +1215,92 @@ rotate:id=63,data=15,rot=180
|
||||
block:id=63,data=11,scale=16
|
||||
rotate:id=63,data=15,rot=270
|
||||
# Fire
|
||||
block:id=51,data=*,scale=8
|
||||
layer:0
|
||||
********
|
||||
********
|
||||
********
|
||||
********
|
||||
********
|
||||
********
|
||||
********
|
||||
********
|
||||
layer:1
|
||||
-**--**-
|
||||
********
|
||||
********
|
||||
-**--**-
|
||||
-**--**-
|
||||
********
|
||||
********
|
||||
-**--**-
|
||||
layer:2
|
||||
--------
|
||||
-**--**-
|
||||
-**--**-
|
||||
--------
|
||||
--------
|
||||
-**--**-
|
||||
-**--**-
|
||||
--------
|
||||
layer:3
|
||||
--------
|
||||
----**--
|
||||
-**-**--
|
||||
-**-----
|
||||
-----**-
|
||||
--**-**-
|
||||
--**----
|
||||
--------
|
||||
layer:4,5
|
||||
--------
|
||||
--*-----
|
||||
--*--**-
|
||||
--------
|
||||
--------
|
||||
-**--*--
|
||||
-----*--
|
||||
--------
|
||||
layer:6,7
|
||||
--------
|
||||
--------
|
||||
--*--*--
|
||||
--------
|
||||
--------
|
||||
--*--*--
|
||||
--------
|
||||
--------
|
||||
block:id=51,data=*,scale=16
|
||||
layer:0,1,2
|
||||
****************
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
****************
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
****************
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
*-----*--*-----*
|
||||
****************
|
||||
layer:3,4,5
|
||||
****************
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
****************
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
****************
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
*----*----*----*
|
||||
****************
|
||||
layer:6,7,8
|
||||
****************
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
****************
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
****************
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
*---*------*---*
|
||||
****************
|
||||
layer:9,10,11
|
||||
****************
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
****************
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
****************
|
||||
*--*--------*--*
|
||||
*--*--------*--*
|
||||
****************
|
||||
layer:12,13,14,15
|
||||
****************
|
||||
*-*----------*-*
|
||||
****************
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
*-*----------*-*
|
||||
****************
|
||||
*-*----------*-*
|
||||
****************
|
||||
# Tall grass
|
||||
block:id=31,data=1,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8,9
|
||||
@ -2380,7 +2411,7 @@ layer:0
|
||||
****************
|
||||
# Water (full)
|
||||
# Lava (full)
|
||||
#block:id=9,id=11,data=0,scale=16
|
||||
#block:id=8,id=9,id=10,id=11,data=0,scale=16
|
||||
#layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
|
||||
#****************
|
||||
#****************
|
||||
@ -2400,8 +2431,8 @@ layer:0
|
||||
#****************
|
||||
# Water (1 down)
|
||||
# Lava (1 down)
|
||||
block:id=9,id=11,data=1,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8,9,10,11,12
|
||||
block:id=8,id=9,id=10,id=11,data=1,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
@ -2420,8 +2451,8 @@ layer:0,1,2,3,4,5,6,7,8,9,10,11,12
|
||||
****************
|
||||
# Water (2 down)
|
||||
# Lava (2 down)
|
||||
block:id=9,id=11,data=2,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8,9,10
|
||||
block:id=8,id=9,id=10,id=11,data=2,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8,9,10,11
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
@ -2440,8 +2471,8 @@ layer:0,1,2,3,4,5,6,7,8,9,10
|
||||
****************
|
||||
# Water (3 down)
|
||||
# Lava (3 down)
|
||||
block:id=9,id=11,data=3,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8
|
||||
block:id=8,id=9,id=10,id=11,data=3,scale=16
|
||||
layer:0,1,2,3,4,5,6,7,8,9
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
@ -2460,8 +2491,8 @@ layer:0,1,2,3,4,5,6,7,8
|
||||
****************
|
||||
# Water (4 down)
|
||||
# Lava (4 down)
|
||||
block:id=9,id=11,data=4,scale=16
|
||||
layer:0,1,2,3,4,5,6
|
||||
block:id=8,id=9,id=10,id=11,data=4,scale=16
|
||||
layer:0,1,2,3,4,5,6,7
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
@ -2480,8 +2511,8 @@ layer:0,1,2,3,4,5,6
|
||||
****************
|
||||
# Water (5 down)
|
||||
# Lava (5 down)
|
||||
block:id=9,id=11,data=5,scale=16
|
||||
layer:0,1,2,3,4
|
||||
block:id=8,id=9,id=10,id=11,data=5,scale=16
|
||||
layer:0,1,2,3,4,5
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
@ -2500,8 +2531,8 @@ layer:0,1,2,3,4
|
||||
****************
|
||||
# Water (6 down)
|
||||
# Lava (6 down)
|
||||
block:id=9,id=11,data=6,scale=16
|
||||
layer:0,1,2
|
||||
block:id=8,id=9,id=10,id=11,data=6,scale=16
|
||||
layer:0,1,2,3
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
@ -2520,8 +2551,8 @@ layer:0,1,2
|
||||
****************
|
||||
# Water (7 down)
|
||||
# Lava (7 down)
|
||||
block:id=9,id=11,data=7,scale=16
|
||||
layer:0
|
||||
block:id=8,id=9,id=10,id=11,data=7,scale=16
|
||||
layer:0,1
|
||||
****************
|
||||
****************
|
||||
****************
|
||||
|
@ -3,7 +3,8 @@
|
||||
# <index>=0-255 (index of patch in terrain.png), -1=clear, 1xxx=biome tint from grasscolor.png,257=stationary water,258=moving water,
|
||||
# 259=stationary lava,260=moving lava,261=extended piston side,262=piston side while extended,263=glass pane top,2xxx=biome tint from foliagecolor.png,4xxx=rotate texture 90,
|
||||
# 5xxx=rotate texture 180, 6xxx=rotate texture 270, 7xxx=flip texture horizontally, 8xxx=shift down 1/2 block, 9=shift down 1/2,flip horiz,
|
||||
# 10xxx=inclined-torch,11xxx=grass-side,12xxx=clear if same block,3xxx=biome tint from watercolor.png, 264=air portal with eye
|
||||
# 10xxx=inclined-torch,11xxx=grass-side,12xxx=clear if same block,3xxx=biome tint from watercolor.png, 13xxx=pine tone, 14xxx=birch tone, 15xxx=lily tone,
|
||||
# 264=air portal with eye, 265=fire texture
|
||||
######
|
||||
# Stone
|
||||
block:id=1,allfaces=1
|
||||
@ -24,13 +25,16 @@ block:id=6,data=2,allsides=79,transparency=TRANSPARENT
|
||||
# Bedrock
|
||||
block:id=7,allfaces=17
|
||||
# Water
|
||||
block:id=8,allfaces=12258,transparency=TRANSPARENT
|
||||
#block:id=8,allfaces=12258,transparency=TRANSPARENT
|
||||
block:id=8,allfaces=12258,transparency=SEMITRANSPARENT
|
||||
# Stationary water
|
||||
block:id=9,allfaces=12257,transparency=TRANSPARENT
|
||||
#block:id=9,allfaces=12257,transparency=TRANSPARENT
|
||||
block:id=9,data=0,data=8,data=9,data=10,data=11,data=12,data=13,data=14,data=15,topbottom=12257,allsides=12258,transparency=SEMITRANSPARENT
|
||||
block:id=9,data=1,data=2,data=3,data=4,data=5,data=6,data=7,allfaces=12258,transparency=SEMITRANSPARENT
|
||||
# Lava
|
||||
block:id=10,allfaces=260,transparency=TRANSPARENT
|
||||
# Stationary Lava
|
||||
block:id=11,allfaces=259,transparency=TRANSPARENT
|
||||
block:id=11,topbottom=259,allsides=260,transparency=TRANSPARENT
|
||||
# Sand
|
||||
block:id=12,allfaces=18
|
||||
# Gravel
|
||||
@ -50,9 +54,9 @@ block:id=17,data=2,allsides=117,top=21,bottom=21
|
||||
# Leaves (std)
|
||||
block:id=18,data=0,data=4,data=8,data=12,allfaces=2052,transparency=TRANSPARENT
|
||||
# Leaves (spruce/pine)
|
||||
block:id=18,data=1,data=5,data=9,data=13,allfaces=2132,transparency=TRANSPARENT
|
||||
block:id=18,data=1,data=5,data=9,data=13,allfaces=13132,transparency=TRANSPARENT
|
||||
# Leaves (birch)
|
||||
block:id=18,data=2,data=6,data=10,data=14,allfaces=2052,transparency=TRANSPARENT
|
||||
block:id=18,data=2,data=6,data=10,data=14,allfaces=14052,transparency=TRANSPARENT
|
||||
# Leaves (std-alpha migrated?)
|
||||
block:id=18,data=3,data=7,data=11,data=15,allfaces=2052,transparency=TRANSPARENT
|
||||
# Sponge
|
||||
@ -292,7 +296,7 @@ block:id=50,data=1,data=2,data=3,data=4,allsides=10080,top=162,bottom=4,transpar
|
||||
# Torch - up
|
||||
block:id=50,data=5,allsides=80,top=162,bottom=4,transparency=TRANSPARENT
|
||||
# Fire
|
||||
block:id=51,allsides=129,top=162,transparency=TRANSPARENT
|
||||
block:id=51,allsides=265,transparency=TRANSPARENT
|
||||
# Monster spawner
|
||||
block:id=52,allfaces=65,transparency=TRANSPARENT
|
||||
# Wooden stairs
|
||||
@ -551,8 +555,8 @@ block:id=108,allfaces=7,transparency=SEMITRANSPARENT
|
||||
block:id=109,allfaces=54,transparency=SEMITRANSPARENT
|
||||
# Mycelium
|
||||
block:id=110,top=78,allsides=77,bottom=2
|
||||
# Lilly pad
|
||||
block:id=111,topbottom=1076,transparency=TRANSPARENT
|
||||
# Lily pad
|
||||
block:id=111,topbottom=15076,transparency=TRANSPARENT
|
||||
# Nether brick
|
||||
block:id=112,allfaces=224
|
||||
# Nether brick fence
|
||||
|
Loading…
Reference in New Issue
Block a user