Added wood walls, fixed some collision detection, added lines and tile
break indicators for the user, added an indicator to tell the user when they can use a certain tile.
|
|
@ -47,6 +47,7 @@ public class DisplayWindow implements IMainloopTask
|
||||||
public int glsl_discard_coords;
|
public int glsl_discard_coords;
|
||||||
public int glsl_do_discard_coords;
|
public int glsl_do_discard_coords;
|
||||||
public int glsl_do_lighting;
|
public int glsl_do_lighting;
|
||||||
|
public int glsl_do_texture;
|
||||||
public int glsl_model;
|
public int glsl_model;
|
||||||
public int glsl_camera;
|
public int glsl_camera;
|
||||||
public int glsl_projection;
|
public int glsl_projection;
|
||||||
|
|
@ -144,6 +145,7 @@ public class DisplayWindow implements IMainloopTask
|
||||||
glsl_discard_coords = GL33.glGetUniformLocation(environmentRenderer.program, "discard_coords");
|
glsl_discard_coords = GL33.glGetUniformLocation(environmentRenderer.program, "discard_coords");
|
||||||
glsl_do_discard_coords = GL33.glGetUniformLocation(environmentRenderer.program, "do_discard_coords");
|
glsl_do_discard_coords = GL33.glGetUniformLocation(environmentRenderer.program, "do_discard_coords");
|
||||||
glsl_do_lighting = GL33.glGetUniformLocation(environmentRenderer.program, "do_lighting");
|
glsl_do_lighting = GL33.glGetUniformLocation(environmentRenderer.program, "do_lighting");
|
||||||
|
glsl_do_texture = GL33.glGetUniformLocation(environmentRenderer.program, "do_texture");
|
||||||
glsl_color = GL33.glGetUniformLocation(environmentRenderer.program, "color");
|
glsl_color = GL33.glGetUniformLocation(environmentRenderer.program, "color");
|
||||||
glsl_contrast = GL33.glGetUniformLocation(environmentRenderer.program, "contrast");
|
glsl_contrast = GL33.glGetUniformLocation(environmentRenderer.program, "contrast");
|
||||||
glsl_billboard = GL33.glGetUniformLocation(environmentRenderer.program, "billboard");
|
glsl_billboard = GL33.glGetUniformLocation(environmentRenderer.program, "billboard");
|
||||||
|
|
@ -214,7 +216,8 @@ public class DisplayWindow implements IMainloopTask
|
||||||
environmentRenderer.use();
|
environmentRenderer.use();
|
||||||
DisplayLighting.updateLighting();
|
DisplayLighting.updateLighting();
|
||||||
|
|
||||||
GL33.glUniform1f(glsl_mist, 0);
|
GL33.glUniform1f(glsl_mist, 0.0078125f);
|
||||||
|
GL33.glUniform1i(glsl_do_texture, 1);
|
||||||
|
|
||||||
if(Main.player.getHydration() < 0.2) {
|
if(Main.player.getHydration() < 0.2) {
|
||||||
GL33.glUniform1f(glsl_contrast, (float)(0.2 - Main.player.getHydration()) * 1.6f);
|
GL33.glUniform1f(glsl_contrast, (float)(0.2 - Main.player.getHydration()) * 1.6f);
|
||||||
|
|
|
||||||
|
|
@ -320,47 +320,60 @@ public abstract class Entity implements ClassBdf
|
||||||
|
|
||||||
private boolean moveIsLegal(Vec2d pos)
|
private boolean moveIsLegal(Vec2d pos)
|
||||||
{
|
{
|
||||||
Vec2i t_pos = new Vec2i(MathHelpers.floor(pos.x)+0, MathHelpers.floor(pos.y)+0);
|
Layer layer = Main.world.getLayer();
|
||||||
Chunk chunk = Main.world.getLayer().getChunk(pos);
|
|
||||||
tile_back = chunk.getBackTile(t_pos);
|
|
||||||
tile_front = chunk.getFrontTile(t_pos);
|
|
||||||
|
|
||||||
// Is this entity solid
|
// Is this entity solid
|
||||||
if(isSolid)
|
if(isSolid)
|
||||||
{
|
{
|
||||||
// Check the tile the player is standing on
|
final Vec2i[] positions = {
|
||||||
Vec2i tpos = new Vec2i(MathHelpers.floor(pos.x)+0, MathHelpers.floor(pos.y)+0);
|
new Vec2i(-1, -1),
|
||||||
|
new Vec2i(1, -1),
|
||||||
|
new Vec2i(1, 1),
|
||||||
|
new Vec2i(-1, 1),
|
||||||
|
new Vec2i(1, 0),
|
||||||
|
new Vec2i(0, 1),
|
||||||
|
new Vec2i(-1, 0),
|
||||||
|
new Vec2i(0, -1),
|
||||||
|
new Vec2i(0, 0),
|
||||||
|
};
|
||||||
|
|
||||||
|
for(Vec2i tpos_offset : positions)
|
||||||
{
|
{
|
||||||
// Get the tile
|
// Check the tile the player is standing on
|
||||||
Tile t = tile_back.tile;
|
Vec2i tpos = new Vec2i(
|
||||||
|
MathHelpers.floor(pos.x) + tpos_offset.x,
|
||||||
|
MathHelpers.floor(pos.y) + tpos_offset.y);
|
||||||
|
|
||||||
|
TileState tile_back = layer.getBackTile(tpos);
|
||||||
|
TileState tile_front = layer.getFrontTile(tpos);
|
||||||
|
|
||||||
// Check the tiles hitbox if the tile is solid
|
|
||||||
if(t.tileSolid)
|
|
||||||
{
|
{
|
||||||
// Is the entity in the tiles hitbox
|
// Get the tile
|
||||||
Vec2d check = pos.subtract(new Vec2d(tpos.x + 0.5, tpos.y + 0.5));
|
Tile t = tile_back.tile;
|
||||||
if(Math.max(Math.abs(check.x), Math.abs(check.y)) <= t.tileHitbox)
|
|
||||||
|
// Check the tiles hitbox if the tile is solid
|
||||||
|
if(t.tileSolid)
|
||||||
{
|
{
|
||||||
// Send back false
|
// Is the entity in the tiles hitbox
|
||||||
return false;
|
Vec2d check = pos.subtract(tpos.toDouble());
|
||||||
|
if(t.inHitbox(tile_back, check)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// Get the front tile
|
|
||||||
Tile t = tile_front.tile;
|
|
||||||
|
|
||||||
// Check the tiles hitbox if the tile is solid
|
|
||||||
if(t.tileSolid)
|
|
||||||
{
|
{
|
||||||
// Is the entity in the tiles hitbox
|
// Get the front tile
|
||||||
Vec2d check = pos.subtract(new Vec2d(tpos.x + 0.5, tpos.y + 0.5));
|
Tile t = tile_front.tile;
|
||||||
if(Math.max(Math.abs(check.x), Math.abs(check.y)) <= t.tileHitbox)
|
|
||||||
|
// Check the tiles hitbox if the tile is solid
|
||||||
|
if(t.tileSolid)
|
||||||
{
|
{
|
||||||
// Send back false
|
// Is the entity in the tiles hitbox
|
||||||
return false;
|
Vec2d check = pos.subtract(tpos.toDouble());
|
||||||
|
if(t.inHitbox(tile_front, check)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ public class EntityPlayer extends Entity implements
|
||||||
public boolean dead = false;
|
public boolean dead = false;
|
||||||
public boolean in_animation = false;
|
public boolean in_animation = false;
|
||||||
public int attackedCooldown = 0;
|
public int attackedCooldown = 0;
|
||||||
|
private int particle_spawn_cooldown = 0;
|
||||||
|
|
||||||
private ArrayList<Task> tasks;
|
private ArrayList<Task> tasks;
|
||||||
private Inventory inventory;
|
private Inventory inventory;
|
||||||
|
|
@ -285,7 +286,7 @@ public class EntityPlayer extends Entity implements
|
||||||
|
|
||||||
if(is.isEmpty() || !is.item.onPlayerLeftClick(is, Main.world.getLayer(), this, place_pos))
|
if(is.isEmpty() || !is.item.onPlayerLeftClick(is, Main.world.getLayer(), this, place_pos))
|
||||||
{
|
{
|
||||||
boolean isTool = is.item instanceof ItemTool;
|
boolean isTool = !is.isEmpty() && is.item instanceof ItemTool;
|
||||||
ItemTool tool = isTool ? (ItemTool) is.item : null;
|
ItemTool tool = isTool ? (ItemTool) is.item : null;
|
||||||
double speed = isTool ? ((ItemTool) is.item).toolSpeed(is) : 1;
|
double speed = isTool ? ((ItemTool) is.item).toolSpeed(is) : 1;
|
||||||
Vec2i pos = place_pos.toInt();
|
Vec2i pos = place_pos.toInt();
|
||||||
|
|
@ -309,6 +310,16 @@ public class EntityPlayer extends Entity implements
|
||||||
break_pos = pos;
|
break_pos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
particle_spawn_cooldown += 1;
|
||||||
|
|
||||||
|
if(particle_spawn_cooldown > 10) {
|
||||||
|
particle_spawn_cooldown -= 10;
|
||||||
|
|
||||||
|
layer.spawnEntity(new ParticleBreak(
|
||||||
|
new Vec3d(pos.x + 0.5, 0, pos.y + 0.5),
|
||||||
|
new Vec3d(0, 0, 0), ts.tile.getModel(ts.meta), 2));
|
||||||
|
}
|
||||||
|
|
||||||
if(break_progress > ts.tile.hardness)
|
if(break_progress > ts.tile.hardness)
|
||||||
{
|
{
|
||||||
ItemStack[] stacks = ts.tile.getTileDrops(ts);
|
ItemStack[] stacks = ts.tile.getTileDrops(ts);
|
||||||
|
|
@ -431,11 +442,37 @@ public class EntityPlayer extends Entity implements
|
||||||
model.render();
|
model.render();
|
||||||
|
|
||||||
ItemStack holding = inventory.getItem(inventory_hand);
|
ItemStack holding = inventory.getItem(inventory_hand);
|
||||||
|
Vec2d place_pos = getPos().xz().add(MathHelpers.moveTowards2(0.5, Math.toRadians(angle)));
|
||||||
|
Vec3d ppos = getPos();
|
||||||
|
|
||||||
|
{
|
||||||
|
boolean isTool = !holding.isEmpty() && holding.item instanceof ItemTool;
|
||||||
|
ItemTool tool = isTool ? (ItemTool) holding.item : null;
|
||||||
|
Vec2i pos = place_pos.toInt();
|
||||||
|
|
||||||
|
for(int ti=0;ti<2;ti++)
|
||||||
|
{
|
||||||
|
TileState ts;
|
||||||
|
|
||||||
|
if(ti == 0) {
|
||||||
|
ts = layer.getFrontTile(pos);
|
||||||
|
} else {
|
||||||
|
ts = layer.getBackTile(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ts.tile.canTileBreak(ts, holding, tool) || ts.tile.canUse(ts))
|
||||||
|
{
|
||||||
|
Models.TILE_BORDER.setModel(Matrix4.translate(
|
||||||
|
new Vec3d(pos.x + 0.5 - ppos.x, 0, pos.y + 0.5 - ppos.z)));
|
||||||
|
Models.TILE_BORDER.render();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(holding != null && !holding.isEmpty())
|
if(holding != null && !holding.isEmpty())
|
||||||
{
|
{
|
||||||
Vec3d ppos = getPos();
|
|
||||||
|
|
||||||
Model model_place = holding.item.getPlaceModel(holding);
|
Model model_place = holding.item.getPlaceModel(holding);
|
||||||
Model model_spawn = holding.item.getSpawnModel(holding);
|
Model model_spawn = holding.item.getSpawnModel(holding);
|
||||||
Vec2d pos = ppos.xz().add(MathHelpers.moveTowards2(1, Math.toRadians(angle)));
|
Vec2d pos = ppos.xz().add(MathHelpers.moveTowards2(1, Math.toRadians(angle)));
|
||||||
|
|
@ -449,13 +486,15 @@ public class EntityPlayer extends Entity implements
|
||||||
|
|
||||||
if(render_place_model)
|
if(render_place_model)
|
||||||
{
|
{
|
||||||
model_place.setModel(Matrix4.translate(Math.floor(pos.x) - ppos.x + 0.5, 0.001, Math.floor(pos.y) - ppos.z + 0.5));
|
model_place.setModel(Matrix4.translate(new Vec3d(
|
||||||
|
MathHelpers.floor(pos.x) + 0.5 - ppos.x, 0.00390625,
|
||||||
|
MathHelpers.floor(pos.y) + 0.5 - ppos.z)));
|
||||||
model_place.render();
|
model_place.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(model_spawn != null)
|
if(model_spawn != null)
|
||||||
{
|
{
|
||||||
model_spawn.setModel(Matrix4.translate(pos.x - ppos.x, 0.001, pos.y - ppos.z));
|
model_spawn.setModel(Matrix4.translate(pos.x - ppos.x, 0, pos.y - ppos.z));
|
||||||
model_spawn.render();
|
model_spawn.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import projectzombie.model.ModelRandom;
|
||||||
import projectzombie.model.ModelRock;
|
import projectzombie.model.ModelRock;
|
||||||
import projectzombie.model.ModelTallGrass;
|
import projectzombie.model.ModelTallGrass;
|
||||||
import projectzombie.model.ModelTile;
|
import projectzombie.model.ModelTile;
|
||||||
|
import projectzombie.model.ModelTileBorder;
|
||||||
import projectzombie.model.ModelTree;
|
import projectzombie.model.ModelTree;
|
||||||
import projectzombie.model.ModelTreeSnow;
|
import projectzombie.model.ModelTreeSnow;
|
||||||
import projectzombie.model.ModelVertical;
|
import projectzombie.model.ModelVertical;
|
||||||
|
|
@ -24,6 +25,7 @@ public class Models
|
||||||
{
|
{
|
||||||
public static final Model EMPTY = new ModelEmpty();
|
public static final Model EMPTY = new ModelEmpty();
|
||||||
public static final Model TILE_MISSING = new ModelTile(Resources.TEX_EMPTY);
|
public static final Model TILE_MISSING = new ModelTile(Resources.TEX_EMPTY);
|
||||||
|
public static final Model TILE_BORDER = new ModelTileBorder();
|
||||||
|
|
||||||
public static final Model TILE_TALL_GRASS = new ModelTallGrass();
|
public static final Model TILE_TALL_GRASS = new ModelTallGrass();
|
||||||
public static final Model TILE_GRASS = new ModelGrass();
|
public static final Model TILE_GRASS = new ModelGrass();
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import projectzombie.tiles.TileVoid;
|
||||||
import projectzombie.tiles.TileWall;
|
import projectzombie.tiles.TileWall;
|
||||||
import projectzombie.tiles.TileWater;
|
import projectzombie.tiles.TileWater;
|
||||||
import projectzombie.tiles.TileWoodFloor;
|
import projectzombie.tiles.TileWoodFloor;
|
||||||
|
import projectzombie.tiles.TileWoodWall;
|
||||||
import projectzombie.tiles.TileWorkbench;
|
import projectzombie.tiles.TileWorkbench;
|
||||||
|
|
||||||
public class Tiles
|
public class Tiles
|
||||||
|
|
@ -90,6 +91,7 @@ public class Tiles
|
||||||
register(ORE);
|
register(ORE);
|
||||||
register(COAL);
|
register(COAL);
|
||||||
register(WOOD_FLOOR);
|
register(WOOD_FLOOR);
|
||||||
|
register(WOOD_WALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Tile GRASS = new TileGrass();
|
public static final Tile GRASS = new TileGrass();
|
||||||
|
|
@ -127,4 +129,5 @@ public class Tiles
|
||||||
public static final Tile ORE = new TileOre();
|
public static final Tile ORE = new TileOre();
|
||||||
public static final Tile COAL = new TileCoal();
|
public static final Tile COAL = new TileCoal();
|
||||||
public static final Tile WOOD_FLOOR = new TileWoodFloor();
|
public static final Tile WOOD_FLOOR = new TileWoodFloor();
|
||||||
|
public static final Tile WOOD_WALL = new TileWoodWall();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,18 @@
|
||||||
package projectzombie.items;
|
package projectzombie.items;
|
||||||
|
|
||||||
import gl_engine.MathHelpers;
|
import gl_engine.MathHelpers;
|
||||||
|
import gl_engine.vec.Vec2d;
|
||||||
|
import gl_engine.vec.Vec2i;
|
||||||
import projectzombie.Main;
|
import projectzombie.Main;
|
||||||
|
import projectzombie.entity.player.EntityPlayer;
|
||||||
import projectzombie.init.Models;
|
import projectzombie.init.Models;
|
||||||
|
import projectzombie.init.Tiles;
|
||||||
|
import projectzombie.items.modifier.ItemModifierMeta;
|
||||||
import projectzombie.model.Model;
|
import projectzombie.model.Model;
|
||||||
import projectzombie.model.ModelItem;
|
import projectzombie.model.ModelItem;
|
||||||
import projectzombie.util.ItemStack;
|
import projectzombie.util.ItemStack;
|
||||||
|
import projectzombie.util.TileState;
|
||||||
|
import projectzombie.world.layer.Layer;
|
||||||
|
|
||||||
public class ItemWoodWall extends Item
|
public class ItemWoodWall extends Item
|
||||||
{
|
{
|
||||||
|
|
@ -22,6 +29,28 @@ public class ItemWoodWall extends Item
|
||||||
return Models.ITEM_WOOD_WALL;
|
return Models.ITEM_WOOD_WALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean showPlaceModel(Layer layer, Vec2i pos, ItemStack stack) {
|
||||||
|
return layer.getFrontTile(pos).tile.isNaturalFloorItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPlayerRightClick(ItemStack stack, Layer layer, EntityPlayer player, Vec2d place_pos)
|
||||||
|
{
|
||||||
|
Vec2i pos = place_pos.toInt();
|
||||||
|
|
||||||
|
if(!showPlaceModel(layer, pos, stack)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int angle = (int)MathHelpers.mod(Main.player.angle / 90 + 0.5, 4);
|
||||||
|
|
||||||
|
stack.count -= 1;
|
||||||
|
layer.setFrontTile(new TileState(Tiles.WOOD_WALL, ItemModifierMeta.getStackMeta(stack) * 4 + angle), pos);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(ItemStack stack) {
|
public String getName(ItemStack stack) {
|
||||||
return "Wood Wall";
|
return "Wood Wall";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package projectzombie.model;
|
package projectzombie.model;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL33;
|
||||||
|
|
||||||
import gl_engine.texture.TextureRef3D;
|
import gl_engine.texture.TextureRef3D;
|
||||||
import gl_engine.vec.Vec2d;
|
import gl_engine.vec.Vec2d;
|
||||||
|
import projectzombie.Main;
|
||||||
import projectzombie.init.Resources;
|
import projectzombie.init.Resources;
|
||||||
|
|
||||||
public class ModelChunkBorder extends Model
|
public class ModelChunkBorder extends Model
|
||||||
|
|
@ -10,61 +13,58 @@ public class ModelChunkBorder extends Model
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return 16;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIndexSize() {
|
public int getIndexSize() {
|
||||||
return 24;
|
return 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render()
|
||||||
|
{
|
||||||
|
if(bound != this) {
|
||||||
|
bind();
|
||||||
|
}
|
||||||
|
|
||||||
|
GL33.glUniform1i(Main.window.glsl_do_texture, 0);
|
||||||
|
GL33.glDrawElements(GL33.GL_LINES, getIndexSize(), GL33.GL_UNSIGNED_INT, 0);
|
||||||
|
GL33.glUniform1i(Main.window.glsl_do_texture, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float[] getVerticies()
|
public float[] getVerticies()
|
||||||
{
|
{
|
||||||
float w = 16;
|
float w = 16;
|
||||||
float h = 0.0625f;
|
float h = 0.03125f;
|
||||||
float f = 0b10;
|
float f = 0b10;
|
||||||
float c = 0b000000111111111111;
|
float c = 0b000000111111111111;
|
||||||
float o = 0.5f;
|
float o = 0.5f;
|
||||||
|
|
||||||
return new float[]
|
return new float[]
|
||||||
{
|
{
|
||||||
0-o, 0, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
0-o, h, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
w-o, 0, 0-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
w-o, h, 0-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
w-o, h, 0-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
0-o, h, 0-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
|
|
||||||
0-o, 0, w-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
0-o, h, w-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
w-o, 0, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
w-o, h, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
w-o, h, w-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
0-o, h, w-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
|
|
||||||
0-o, 0, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
0-o, h, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
0-o, 0, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
0-o, h, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
0-o, h, w-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
0-o, h, 0-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
|
|
||||||
w-o, 0, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
w-o, h, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
w-o, 0, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
w-o, h, w-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
w-o, h, w-o, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
w-o, h, 0-o, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getIndicies() {
|
public int[] getIndicies() {
|
||||||
return new int[] {
|
return new int[] {
|
||||||
0, 1, 2,
|
0, 1,
|
||||||
2, 3, 0,
|
2, 3,
|
||||||
|
4, 5,
|
||||||
4, 5, 6,
|
6, 7,
|
||||||
6, 7, 4,
|
|
||||||
|
|
||||||
8, 9, 10,
|
|
||||||
10, 11, 8,
|
|
||||||
|
|
||||||
12, 13, 14,
|
|
||||||
14, 15, 12,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,8 +74,6 @@ public class ModelChunkBorder extends Model
|
||||||
return new TextureRef3D[] {
|
return new TextureRef3D[] {
|
||||||
ref, ref, ref, ref,
|
ref, ref, ref, ref,
|
||||||
ref, ref, ref, ref,
|
ref, ref, ref, ref,
|
||||||
ref, ref, ref, ref,
|
|
||||||
ref, ref, ref, ref,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package projectzombie.model;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL33;
|
||||||
|
|
||||||
|
import gl_engine.texture.TextureRef3D;
|
||||||
|
import projectzombie.Main;
|
||||||
|
import projectzombie.init.Resources;
|
||||||
|
|
||||||
|
public class ModelTileBorder extends Model
|
||||||
|
{
|
||||||
|
private static final TextureRef3D ref = Resources.ATLAS.get("/gui/pixel_white.png");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSize() {
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIndexSize() {
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render()
|
||||||
|
{
|
||||||
|
if(bound != this) {
|
||||||
|
bind();
|
||||||
|
}
|
||||||
|
|
||||||
|
GL33.glUniform1i(Main.window.glsl_do_texture, 0);
|
||||||
|
GL33.glDrawElements(GL33.GL_LINES, getIndexSize(), GL33.GL_UNSIGNED_INT, 0);
|
||||||
|
GL33.glUniform1i(Main.window.glsl_do_texture, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float[] getVerticies()
|
||||||
|
{
|
||||||
|
float h = 0.03125f;
|
||||||
|
float f = 0b10;
|
||||||
|
float c = 0b101111101111101111;
|
||||||
|
float o = 0.5f;
|
||||||
|
|
||||||
|
return new float[]
|
||||||
|
{
|
||||||
|
0-o, h, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
1-o, h, 0-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
|
||||||
|
0-o, h, 1-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
1-o, h, 1-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
|
||||||
|
0-o, h, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
0-o, h, 1-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
|
||||||
|
1-o, h, 0-o, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
1-o, h, 1-o, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, c, f,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getIndicies() {
|
||||||
|
return new int[] {
|
||||||
|
0, 1,
|
||||||
|
2, 3,
|
||||||
|
4, 5,
|
||||||
|
6, 7,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRef3D[] getTextures()
|
||||||
|
{
|
||||||
|
return new TextureRef3D[] {
|
||||||
|
ref, ref, ref, ref,
|
||||||
|
ref, ref, ref, ref,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getHeight() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getWidth() {
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -48,90 +48,109 @@ public class ModelWall extends Model
|
||||||
@Override
|
@Override
|
||||||
public float[] getVerticies()
|
public float[] getVerticies()
|
||||||
{
|
{
|
||||||
float x1=0, x2=0, x3=0, x4=0, z1=0, z2=0, z3=0, z4=0;
|
float x1=0, x2=0, x3=0, x4=0, x5=0, x6=0, z1=0, z2=0, z3=0, z4=0, z5=0, z6=0;
|
||||||
|
|
||||||
switch(rotation)
|
switch(rotation)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
z1 = -0.5f;
|
z1 = 0.5f;
|
||||||
z2 = -0.5f;
|
z2 = 0.25f;
|
||||||
z3 = -0.25f;
|
|
||||||
z4 = -0.25f;
|
|
||||||
x1 = 0.5f;
|
x1 = 0.5f;
|
||||||
x2 = 0.5f;
|
x2 = -0.5f;
|
||||||
x3 = -0.5f;
|
|
||||||
x4 = -0.5f;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
x1 = -0.5f;
|
x1 = 0.5f;
|
||||||
x2 = -0.5f;
|
x2 = 0.25f;
|
||||||
x3 = -0.25f;
|
|
||||||
x4 = -0.25f;
|
|
||||||
z1 = 0.5f;
|
z1 = 0.5f;
|
||||||
z2 = 0.5f;
|
z2 = -0.5f;
|
||||||
z3 = -0.5f;
|
|
||||||
z4 = -0.5f;
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
z1 = 0.5f;
|
z1 = -0.5f;
|
||||||
z2 = 0.5f;
|
z2 = -0.25f;
|
||||||
z3 = 0.25f;
|
|
||||||
z4 = 0.25f;
|
|
||||||
x1 = 0.5f;
|
x1 = 0.5f;
|
||||||
x2 = 0.5f;
|
x2 = -0.5f;
|
||||||
x3 = -0.5f;
|
|
||||||
x4 = -0.5f;
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
x1 = 0.5f;
|
x1 = -0.5f;
|
||||||
x2 = 0.5f;
|
x2 = -0.25f;
|
||||||
x3 = 0.25f;
|
|
||||||
x4 = 0.25f;
|
|
||||||
z1 = 0.5f;
|
z1 = 0.5f;
|
||||||
z2 = 0.5f;
|
z2 = -0.5f;
|
||||||
z3 = -0.5f;
|
|
||||||
z4 = -0.5f;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(rotation % 2 == 0) {
|
||||||
|
x3 = x1;
|
||||||
|
x4 = x2;
|
||||||
|
x5 = x2;
|
||||||
|
x6 = x1;
|
||||||
|
z3 = z1;
|
||||||
|
z4 = z1;
|
||||||
|
z5 = z2;
|
||||||
|
z6 = z2;
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
x3 = x1;
|
||||||
|
x4 = x1;
|
||||||
|
x5 = x2;
|
||||||
|
x6 = x2;
|
||||||
|
z3 = z1;
|
||||||
|
z4 = z2;
|
||||||
|
z5 = z2;
|
||||||
|
z6 = z1;
|
||||||
|
}
|
||||||
|
|
||||||
return new float[]
|
return new float[]
|
||||||
{
|
{
|
||||||
x1, 0, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 0, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x2, 0, z3, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 0, z2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x2, 1, z3, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 1, z2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x1, 1, z1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 1, z1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
|
|
||||||
x3, 0, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 0, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x4, 0, z3, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 0, z2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x4, 1, z3, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 1, z2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 1, z1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 1, z1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
|
|
||||||
x1, 0, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 0, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 0, z2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 0, z1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 1, z2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 1, z1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x1, 1, z1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 1, z1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
|
|
||||||
x1, 0, z3, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 0, z2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 0, z4, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 0, z2, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 1, z4, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x2, 1, z2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x1, 1, z3, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x1, 1, z2, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
|
|
||||||
x1, 1, z1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x3, 1, z3, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 1, z1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x4, 1, z4, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x3, 1, z3, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x5, 1, z5, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
x1, 1, z3, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
x6, 1, z6, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextureRef3D[] getTextures() {
|
public TextureRef3D[] getTextures()
|
||||||
return new TextureRef3D[] {
|
{
|
||||||
front, front, front, front,
|
if(rotation % 2 == 0) {
|
||||||
front, front, front, front,
|
return new TextureRef3D[] {
|
||||||
side, side, side, side,
|
side, side, side, side,
|
||||||
side, side, side, side,
|
side, side, side, side,
|
||||||
top, top, top, top,
|
front, front, front, front,
|
||||||
};
|
front, front, front, front,
|
||||||
|
top, top, top, top,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
return new TextureRef3D[] {
|
||||||
|
front, front, front, front,
|
||||||
|
front, front, front, front,
|
||||||
|
side, side, side, side,
|
||||||
|
side, side, side, side,
|
||||||
|
top, top, top, top,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package projectzombie.tiles;
|
package projectzombie.tiles;
|
||||||
|
|
||||||
|
import gl_engine.vec.Vec2d;
|
||||||
import gl_engine.vec.Vec2i;
|
import gl_engine.vec.Vec2i;
|
||||||
import projectzombie.entity.Entity;
|
import projectzombie.entity.Entity;
|
||||||
import projectzombie.items.ItemTool;
|
import projectzombie.items.ItemTool;
|
||||||
|
|
@ -23,6 +24,17 @@ public abstract class Tile
|
||||||
public boolean isNaturalFloorItem = false;
|
public boolean isNaturalFloorItem = false;
|
||||||
public int hardness = -1;
|
public int hardness = -1;
|
||||||
|
|
||||||
|
public boolean inHitbox(TileState state, Vec2d pos) {
|
||||||
|
return (pos.x > 0.5 - tileHitbox &&
|
||||||
|
pos.x < 0.5 + tileHitbox &&
|
||||||
|
pos.y > 0.5 - tileHitbox &&
|
||||||
|
pos.y < 0.5 + tileHitbox);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void onWalkedOn(Chunk chunk, Layer layer, Vec2i pos, Entity entity, TileState state) {
|
public void onWalkedOn(Chunk chunk, Layer layer, Vec2i pos, Entity entity, TileState state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package projectzombie.tiles;
|
||||||
|
|
||||||
|
import gl_engine.vec.Vec2d;
|
||||||
|
import projectzombie.util.TileState;
|
||||||
|
|
||||||
|
public abstract class TileAbstractWall extends Tile
|
||||||
|
{
|
||||||
|
public TileAbstractWall() {
|
||||||
|
tileSolid = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean inHitbox(TileState state, Vec2d pos)
|
||||||
|
{
|
||||||
|
switch(state.meta % 4)
|
||||||
|
{
|
||||||
|
case 0: return pos.x > -0.125 && pos.x < 1.125 && pos.y > 0.5 && pos.y < 1.125;
|
||||||
|
case 1: return pos.y > -0.125 && pos.y < 1.125 && pos.x > 0.5 && pos.x < 1.125;
|
||||||
|
case 2: return pos.x > -0.125 && pos.x < 1.125 && pos.y > -0.125 && pos.y < 0.5;
|
||||||
|
case 3: return pos.y > -0.125 && pos.y < 1.125 && pos.x > -0.125 && pos.x < 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -38,6 +38,11 @@ public class TileBlastFurnace extends Tile
|
||||||
return Models.TILE_BLAST_FURNACE;
|
return Models.TILE_BLAST_FURNACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated(Layer layer, Vec2i tpos, Entity entity, TileState state) {
|
public boolean onActivated(Layer layer, Vec2i tpos, Entity entity, TileState state) {
|
||||||
super.onActivated(layer, tpos, entity, state);
|
super.onActivated(layer, tpos, entity, state);
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,11 @@ public class TileBossPortal extends Tile
|
||||||
this.unbreakable = true;
|
this.unbreakable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getLightLevel(TileState state, Vec2i pos) {
|
public double getLightLevel(TileState state, Vec2i pos) {
|
||||||
return 0.6;
|
return 0.6;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,11 @@ public class TileCampfire extends Tile
|
||||||
this.hardness = 800;
|
this.hardness = 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getLightLevel(TileState state, Vec2i pos) {
|
public double getLightLevel(TileState state, Vec2i pos) {
|
||||||
return 1 - MathHelpers.squared(1 - state.meta / 16.0);
|
return 1 - MathHelpers.squared(1 - state.meta / 16.0);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,11 @@ public class TileChest extends Tile implements TileBulletBreakable
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void spawnItem(Chunk chunk, Vec2i pos, ItemStack stack) {
|
private void spawnItem(Chunk chunk, Vec2i pos, ItemStack stack) {
|
||||||
chunk.spawnEntity(new EntityItem(pos.xny().toDouble(), new Vec3d(0, 0, 0), stack));
|
chunk.spawnEntity(new EntityItem(pos.xny().toDouble(), new Vec3d(0, 0, 0), stack));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,11 @@ public class TileClayPot extends Tile
|
||||||
hardness = 100;
|
hardness = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Model getModel(byte meta)
|
public Model getModel(byte meta)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,11 @@ public class TileHemp extends Tile
|
||||||
this.hardness = 5000;
|
this.hardness = 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return state.meta > 3;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tickRandomly(Layer layer, Chunk chunk, TileState state, Vec2i pos) {
|
public void tickRandomly(Layer layer, Chunk chunk, TileState state, Vec2i pos) {
|
||||||
super.tickRandomly(layer, chunk, state, pos);
|
super.tickRandomly(layer, chunk, state, pos);
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,11 @@ public class TileLadderUp extends Tile
|
||||||
this.unbreakable = true;
|
this.unbreakable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated(Layer layer, Vec2i pos, Entity entity, TileState state)
|
public boolean onActivated(Layer layer, Vec2i pos, Entity entity, TileState state)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@ public class TilePortalDown extends Tile
|
||||||
this.unbreakable = true;
|
this.unbreakable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onActivated(Layer layer, Vec2i pos, Entity entity, TileState state)
|
public boolean onActivated(Layer layer, Vec2i pos, Entity entity, TileState state)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,11 @@ public class TileWater extends Tile
|
||||||
this.slowness = 0.5;
|
this.slowness = 0.5;
|
||||||
this.unbreakable = true;
|
this.unbreakable = true;
|
||||||
this.hardness = 800;
|
this.hardness = 800;
|
||||||
this.isNaturalFloorItem = true;
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,17 @@ import projectzombie.model.Model;
|
||||||
import projectzombie.util.ItemStack;
|
import projectzombie.util.ItemStack;
|
||||||
import projectzombie.util.TileState;
|
import projectzombie.util.TileState;
|
||||||
|
|
||||||
public class TileWoodWall extends Tile
|
public class TileWoodWall extends TileAbstractWall
|
||||||
{
|
{
|
||||||
public TileWoodWall()
|
public TileWoodWall()
|
||||||
{
|
{
|
||||||
tileSolid = true;
|
light_dissipation = 0.5;
|
||||||
|
hardness = 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTileBreak(TileState state, ItemStack stack, ItemTool tool) {
|
public boolean canTileBreak(TileState state, ItemStack stack, ItemTool tool) {
|
||||||
return tool.toolType(stack) == ItemToolType.HATCHET;
|
return tool != null && tool.toolType(stack) == ItemToolType.HATCHET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@ public class TileWorkbench extends Tile
|
||||||
hardness = 200;
|
hardness = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canUse(TileState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Model getModel(byte meta) {
|
public Model getModel(byte meta) {
|
||||||
return Models.TILE_WORKBENCH;
|
return Models.TILE_WORKBENCH;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ uniform vec2 lightmap_size;
|
||||||
|
|
||||||
uniform int do_lighting;
|
uniform int do_lighting;
|
||||||
uniform int do_discard_coords;
|
uniform int do_discard_coords;
|
||||||
|
uniform int do_texture;
|
||||||
uniform vec4 discard_coords;
|
uniform vec4 discard_coords;
|
||||||
uniform vec4 color;
|
uniform vec4 color;
|
||||||
|
|
||||||
|
|
@ -70,7 +71,7 @@ vec3 interpolate2RGB(float x, float y, vec3 v00, vec3 v01, vec3 v10, vec3 v11) {
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 textureRGB = texture(atlas, pTexture);
|
vec4 textureRGB = do_texture == 0 ? vec4(1) : texture(atlas, pTexture);
|
||||||
|
|
||||||
if(mode == 0)
|
if(mode == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |