package stray.blocks.fluid;

import com.badlogic.gdx.graphics.Texture;

import stray.Main;
import stray.blocks.Block;
import stray.util.AssetMap;
import stray.world.World;

public class BlockFluid extends Block {

	public BlockFluid(String path) {
		super(path);
	}

	@Override
	public void render(World world, int x, int y) {
		if (usingMissingTex) {
			world.batch.draw(
					world.main.manager.get(AssetMap.get("blockmissingtexture"), Texture.class),
					x,
					y,
					World.tilesizex,
					World.tilesizey,
					0,
					0,
					world.main.manager.get(AssetMap.get("blockmissingtexture"), Texture.class)
							.getWidth(),
					(int) (world.main.manager.get(AssetMap.get("blockmissingtexture"),
							Texture.class).getHeight() / 1f), false, false);
			return;
		}
		if (animationlink != null) {
			world.batch.draw(world.main.animations.get(animationlink).getCurrentFrame(), x
					* world.tilesizex - world.camera.camerax,
					Main.convertY((y * world.tilesizey - world.camera.cameray) + World.tilesizey),
					World.tilesizex, (World.tilesizey / 1f));
			return;
		}
		if (path == null) return;

		if (!connectedTextures) {
			if (!variants) {
				world.batch
						.draw(world.main.manager.get(sprites.get("defaulttex"), Texture.class),
								x,
								y,
								World.tilesizex,
								World.tilesizey,
								0,
								0,
								world.main.manager.get(sprites.get("defaulttex"), Texture.class)
										.getWidth(),
								(int) (world.main.manager.get(sprites.get("defaulttex"),
										Texture.class).getHeight() / 1f), false, false);
			} else {
				world.batch.draw(
						world.main.manager.get(
								sprites.get("defaulttex"
										+ ((variantNum(world, x, y)) & (varianttypes - 1))),
								Texture.class),
						x,
						y,
						World.tilesizex,
						World.tilesizey,
						0,
						0,
						world.main.manager.get(
								sprites.get("defaulttex"
										+ ((variantNum(world, x, y)) & (varianttypes - 1))),
								Texture.class).getWidth(),
						(int) (world.main.manager.get(
								sprites.get("defaulttex"
										+ ((variantNum(world, x, y)) & (varianttypes - 1))),
								Texture.class).getHeight() / 1f), false, false);
			}
		} else {
			drawConnectedTexture(world, x, y,
					world.main.manager.get(sprites.get("corner"), Texture.class),
					world.main.manager.get(sprites.get("full"), Texture.class),
					world.main.manager.get(sprites.get("edgever"), Texture.class),
					world.main.manager.get(sprites.get("edgehor"), Texture.class));
		}
	}

}

@@ -26,51 +26,8 @@
 d;%0A%0A
-import com.badlogic.gdx.graphics.Texture;%0A%0A
 impo
@@ -41,16 +41,16 @@
 y.Main;%0A
+
 import s
@@ -123,16 +123,99 @@
 World;%0A%0A
+import com.badlogic.gdx.graphics.Texture;%0Aimport com.badlogic.gdx.math.MathUtils;%0A%0A
 public c
@@ -298,16 +298,224 @@
 ath);%0A%09%7D
+%0A%09%0A%09%0A%09%0A%09public int getFluidLevel(World world, int x, int y)%7B%0A%09%09if(world.getMeta(x, y) == null)%7B%0A%09%09%09world.setMeta(8 + %22%22, x, y);%0A%09%09%7D%0A%09%09%0A%09%09return MathUtils.clamp(Integer.parseInt(world.getMeta(x, y)), 1, 8);%0A%09%7D
 %0A%0A%09@Over
@@ -971,34 +971,65 @@
 ).getHeight() / 
-1f
+(getFluidLevel(world, x, y) - 9f)
 ), false, false)
@@ -1330,18 +1330,49 @@
 sizey / 
-1f
+(getFluidLevel(world, x, y) - 9f)
 ));%0A%09%09%09r
@@ -1839,34 +1839,65 @@
 ).getHeight() / 
-1f
+(getFluidLevel(world, x, y) - 9f)
 ), false, false)
@@ -2499,10 +2499,41 @@
 ) / 
-1f
+(getFluidLevel(world, x, y) - 9f)
 ), f

Add getFluidLevel to BlockFluid