56 lines
1.2 KiB
Java
Executable File
56 lines
1.2 KiB
Java
Executable File
package projectzombie.tiles;
|
|
|
|
import projectzombie.init.Items;
|
|
import projectzombie.init.Models;
|
|
import projectzombie.items.ItemTool;
|
|
import projectzombie.model.Model;
|
|
import projectzombie.util.math.ItemStack;
|
|
import projectzombie.util.math.TileState;
|
|
|
|
public class TileRock extends Tile implements TileBulletBreakable
|
|
{
|
|
|
|
public TileRock() {
|
|
|
|
// Set some settings
|
|
this.tileSolid = true;
|
|
this.tileHitbox = 0.4;
|
|
this.hardness = 200;
|
|
}
|
|
|
|
@Override
|
|
public double getLightDissipation(TileState state) {
|
|
return 1/8.0;
|
|
}
|
|
|
|
@Override
|
|
public int getBulletBreakChance() {
|
|
return 15;
|
|
}
|
|
|
|
@Override
|
|
public boolean canTileBreak(TileState state, ItemStack stack, ItemTool tool) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public ItemStack[] getTileDrops(TileState state) {
|
|
return new ItemStack[] {
|
|
new ItemStack(Items.ROCK, 1, state.meta),
|
|
new ItemStack(Items.FLINT, state.meta == 0 && Math.random() > 0.9 ? 1 : 0, (short)0),
|
|
};
|
|
}
|
|
|
|
@Override
|
|
public Model getModel(byte meta) {
|
|
switch(meta)
|
|
{
|
|
case 0: return Models.TILE_ROCK;
|
|
case 1: return Models.TILE_ROCK_ICE;
|
|
case 2: return Models.TILE_ROCK_SANDSTONE;
|
|
default: return Models.TILE_ROCK;
|
|
}
|
|
}
|
|
|
|
}
|