Added more textures

This commit is contained in:
josua 2020-09-22 09:18:05 +10:00
parent 9394ae9ac1
commit 8ca2fe6b91
13 changed files with 341 additions and 245 deletions

View File

@ -1,7 +1,13 @@
package projectzombie.items; package projectzombie.items;
import gl_engine.vec.Vec2d;
import projectzombie.entity.Entity;
import projectzombie.entity.EntityAlive;
import projectzombie.entity.player.EntityPlayer;
import projectzombie.items.modifier.ItemModifierClickCooldown;
import projectzombie.items.modifier.ItemModifierDamage; import projectzombie.items.modifier.ItemModifierDamage;
import projectzombie.util.ItemStack; import projectzombie.util.ItemStack;
import projectzombie.world.layer.Layer;
public abstract class ItemAbstractTool extends Item implements ItemTool public abstract class ItemAbstractTool extends Item implements ItemTool
{ {
@ -10,6 +16,8 @@ public abstract class ItemAbstractTool extends Item implements ItemTool
} }
protected abstract int getMaxDamage(); protected abstract int getMaxDamage();
protected abstract double getEntityDamage();
protected abstract int getEntityHitDelay();
@Override @Override
public void toolOnUse(ItemStack stack) public void toolOnUse(ItemStack stack)
@ -27,4 +35,44 @@ public abstract class ItemAbstractTool extends Item implements ItemTool
stack.count = 0; stack.count = 0;
} }
} }
@Override
public boolean onPlayerRightClick(ItemStack stack, Layer layer, EntityPlayer player, Vec2d place_pos)
{
boolean usedOnEntity = false;
ItemModifierClickCooldown cooldown = (ItemModifierClickCooldown)stack.getModifier(ItemModifierClickCooldown.class);
if(cooldown != null && !cooldown.canClick()) {
return false;
}
for(Entity entity : layer.getNearbyEntities(place_pos, 0.5))
{
if(entity instanceof EntityAlive && entity != player)
{
usedOnEntity = true;
((EntityAlive)entity).addDamage(getEntityDamage());
}
}
if(usedOnEntity)
{
toolOnUse(stack);
if(cooldown == null) {
cooldown = new ItemModifierClickCooldown(getEntityHitDelay());
stack.addModifier(cooldown);
}
else {
cooldown.click();
}
return true;
}
return super.onPlayerRightClick(stack, layer, player, place_pos);
}
} }

View File

@ -39,4 +39,14 @@ public class ItemFlintHatchet extends ItemAbstractTool
return Models.ITEM_FLINT_HATCHET; return Models.ITEM_FLINT_HATCHET;
} }
@Override
protected double getEntityDamage() {
return 10;
}
@Override
protected int getEntityHitDelay() {
return 100;
}
} }

View File

@ -37,4 +37,14 @@ public class ItemStoneHatchet extends ItemAbstractTool
return "Stone Hatchet"; return "Stone Hatchet";
} }
@Override
protected double getEntityDamage() {
return 12;
}
@Override
protected int getEntityHitDelay() {
return 88;
}
} }

View File

@ -37,4 +37,14 @@ public class ItemStonePick extends ItemAbstractTool
return "Stone Pick"; return "Stone Pick";
} }
@Override
protected double getEntityDamage() {
return 6;
}
@Override
protected int getEntityHitDelay() {
return 60;
}
} }

View File

@ -37,4 +37,14 @@ public class ItemStoneShovel extends ItemAbstractTool
return "Stone Shovel"; return "Stone Shovel";
} }
@Override
protected double getEntityDamage() {
return 8;
}
@Override
protected int getEntityHitDelay() {
return 100;
}
} }

View File

@ -1,5 +1,6 @@
package projectzombie.tiles; package projectzombie.tiles;
import projectzombie.init.Items;
import projectzombie.init.Models; import projectzombie.init.Models;
import projectzombie.items.ItemTool; import projectzombie.items.ItemTool;
import projectzombie.items.ItemToolType; import projectzombie.items.ItemToolType;
@ -26,6 +27,11 @@ public class TileCoal extends Tile
return canTileBreak(state, stack, tool); return canTileBreak(state, stack, tool);
} }
@Override
public ItemStack[] getTileDrops(TileState state) {
return new ItemStack[] {new ItemStack(Items.COAL, 1)};
}
@Override @Override
public Model getModel(byte meta) { public Model getModel(byte meta) {
return Models.TILE_ROCK_COAL; return Models.TILE_ROCK_COAL;

View File

@ -26,7 +26,7 @@ public class TileTallGrass extends Tile
@Override @Override
public ItemStack[] getTileDrops(TileState state) { public ItemStack[] getTileDrops(TileState state) {
return new ItemStack[] { return new ItemStack[] {
new ItemStack(Items.PLANT_FIBRE, Math.random() > 0.6 ? 1 : 0), new ItemStack(Items.PLANT_FIBRE, 1),
}; };
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -1,257 +1,259 @@
./tile/hemp6.png ./text/char_question.png
./tile/rock_gold.png ./text/char_l_a.png
./tile/hemp7.png ./text/char_u_j.png
./tile/hemp1.png ./text/char_l_u.png
./tile/rock.png ./text/char_u_s.png
./tile/rock_ice.png ./text/char_l_s.png
./tile/sapling3.png ./text/char_apostrophe.png
./tile/ladder.png ./text/char_plus.png
./tile/tree_leaves_snow.png ./text/char_l_e.png
./tile/ice_wall.png ./text/char_7.png
./tile/water.png ./text/char_minus.png
./tile/sandstone_wall.png ./text/char_u_r.png
./tile/ladder_up.png ./text/char_u_l.png
./tile/rock_copper.png ./text/char_obracket.png
./tile/cactus4.png ./text/char_pow.png
./tile/tall_grass.png ./text/char_u_m.png
./tile/cactus2.png ./text/char_l_t.png
./tile/grass_infested.png ./text/char_percent.png
./tile/tree_branch_leaves.png ./text/char_l_y.png
./tile/dirt.png ./text/char_0.png
./tile/wall.png ./text/char_4.png
./tile/rock_tin.png ./text/char_l_r.png
./tile/tree_base.png ./text/char_l_m.png
./tile/cactus1.png ./text/char_cbracket.png
./tile/sapling4.png ./text/char_u_g.png
./tile/hemp3.png ./text/char_u_q.png
./tile/cactus_top.png ./text/char_u_i.png
./tile/tunnel_down.png ./text/char_tilde.png
./tile/stone.png ./text/char_l_w.png
./tile/snow.png ./text/char_l_v.png
./tile/boss_portal.png ./text/char_fslash.png
./tile/rock_coal.png ./text/char_u_p.png
./tile/hemp4.png ./text/char_gthan.png
./tile/sand.png ./text/char_8.png
./tile/rock_iron.png ./text/char_unknown.png
./tile/lantern.png ./text/char_and.png
./tile/ice.png ./text/char_osbracket.png
./tile/rock_uranium.png ./text/char_u_n.png
./tile/sapling1.png ./text/char_l_i.png
./tile/campfire_lit.png ./text/char_u_y.png
./tile/grass_burnt.png ./text/char_l_p.png
./tile/chest.png ./text/char_lthan.png
./tile/hemp2.png ./text/char_l_g.png
./tile/hemp8.png ./text/char_bslash.png
./tile/cactus3.png ./text/char_1.png
./tile/lava.png ./text/char_u_z.png
./tile/tree_leaves.png ./text/char_l_f.png
./tile/hemp5.png ./text/char_u_w.png
./tile/campfire_unlit.png ./text/char_9.png
./tile/lava_flow.png ./text/char_l_x.png
./tile/grass.png ./text/char_ccbracket.png
./tile/tree_branch.png ./text/char_l_o.png
./tile/sandstone.png ./text/char_equals.png
./tile/tree_branch_leaves_snow.png ./text/char_l_d.png
./tile/rock_sandstone.png ./text/char_dollar.png
./tile/sapling2.png ./text/char_hashtag.png
./text/char_l_q.png
./text/char_u_o.png
./text/char_6.png
./text/char_u_d.png
./text/char_u_e.png
./text/char_exclamation.png
./text/char_vertical.png
./text/char_ocbracket.png
./text/char_u_k.png
./text/char_u_c.png
./text/char_l_n.png
./text/char_semicolon.png
./text/char_u_b.png
./text/char_u_f.png
./text/char_l_h.png
./text/char_l_k.png
./text/char_u_t.png
./text/char_3.png
./text/char_u_v.png
./text/char_u_h.png
./text/char_quotation.png
./text/char_u_a.png
./text/char_l_b.png
./text/char_underscore.png
./text/char_u_x.png
./text/char_comma.png
./text/char_csbracket.png
./text/char_l_l.png
./text/char_5.png
./text/char_star.png
./text/char_colon.png
./text/char_l_z.png
./text/char_space.png
./text/char_2.png
./text/char_at.png
./text/char_grave.png
./text/char_l_j.png
./text/char_fullstop.png
./text/char_l_c.png
./text/char_u_u.png
./list.txt ./list.txt
./item/rock_gold.png ./player/player_white_front_moving.png
./item/log.png ./player/player_white_back_moving.png
./item/rock.png ./player/player_black_back_moving.png
./item/stone_shovel.png ./player/player_black_back_still.png
./item/coal.png
./item/rock_copper.png
./item/acorn.png
./item/clay.png
./item/stone_pick.png
./item/rock_tin.png
./item/ammo_box.png
./item/plant_fibre.png
./item/torch_lit.png
./item/rock_iron.png
./item/stone_hatchet.png
./item/flint_hatchet.png
./item/rock_uranium.png
./item/hemp_seed.png
./item/shield_upgrade.png
./item/grappling_hook.png
./item/log_snow.png
./item/health_potion.png
./item/snow_pile.png
./item/torch_unlit.png
./item/gun_upgrade.png
./item/sandstone.png
./item/flint.png
./player/player_white_back_still.png ./player/player_white_back_still.png
./player/player_white_front_still.png ./player/player_white_front_still.png
./player/player_black_front_moving.png ./player/player_black_front_moving.png
./player/player_black_front_still.png ./player/player_black_front_still.png
./player/player_black_back_moving.png ./particle/smoke_trail.png
./player/player_black_back_still.png ./particle/water.png
./player/player_white_back_moving.png ./particle/smoke_0.png
./player/player_white_front_moving.png ./particle/smoke_1.png
./gui/selection_box_wide.png ./particle/blood.png
./gui/item_slot_storage.png ./particle/lava.png
./gui/text_box.png ./particle/bullet.png
./gui/pixel_white.png ./particle/smoke_2.png
./gui/water.png ./particle/snow.png
./gui/gun.png ./particle/rain.png
./gui/selection_box_storage.png ./particle/smoke_4.png
./gui/button_delete.png ./particle/smoke_3.png
./gui/button_delete_hover.png ./particle/smoke_5.png
./gui/slot_armor_chest.png
./gui/pixel_black.png
./gui/slot_clothing_shirt.png
./gui/button_play.png
./gui/slot_armor_legs.png
./gui/inventory.png
./gui/label.png
./gui/slot_clothing_pants.png
./gui/health_empty.png
./gui/label_recipe.png
./gui/hotbar_selected.png
./gui/health_full.png
./gui/temperature.png ./gui/temperature.png
./gui/button_play_hover.png ./gui/slot_armor_chest.png
./gui/text_cursor.png ./gui/health_empty.png
./gui/button_hover.png
./gui/item_slot_storage.png
./gui/water.png
./gui/slot_armor_legs.png
./gui/button_normal.png
./gui/label.png
./gui/hotbar.png
./gui/slot_armor_helmet.png ./gui/slot_armor_helmet.png
./gui/selection_box_crafting.png ./gui/selection_box_crafting.png
./gui/slot_clothing_boots.png ./gui/button_delete.png
./gui/hotbar.png ./gui/text_cursor.png
./gui/button_normal.png ./gui/inventory.png
./gui/button_delete_hover.png
./gui/button_play_hover.png
./gui/health_full.png
./gui/hotbar_selected.png
./gui/slot_clothing_shirt.png
./gui/selection_box_storage.png
./gui/pixel_white.png
./gui/pixel_black.png
./gui/slot_clothing_pants.png
./gui/text_box.png
./gui/shield.png ./gui/shield.png
./gui/button_hover.png ./gui/label_recipe.png
./text/char_bslash.png ./gui/slot_clothing_boots.png
./text/char_dollar.png ./gui/selection_box_wide.png
./text/char_l_w.png ./gui/gun.png
./text/char_u_d.png ./gui/button_play.png
./text/char_u_t.png ./tile/cactus4.png
./text/char_space.png ./tile/hemp1.png
./text/char_l_x.png ./tile/campfire_lit.png
./text/char_l_k.png ./tile/dirt.png
./text/char_6.png ./tile/lantern.png
./text/char_unknown.png ./tile/hemp8.png
./text/char_comma.png ./tile/campfire_unlit.png
./text/char_obracket.png ./tile/rock_gold.png
./text/char_u_w.png ./tile/wall.png
./text/char_7.png ./tile/cactus_top.png
./text/char_l_f.png ./tile/cactus2.png
./text/char_vertical.png ./tile/rock.png
./text/char_plus.png ./tile/water.png
./text/char_u_a.png ./tile/hemp4.png
./text/char_star.png ./tile/stone.png
./text/char_9.png ./tile/tree_leaves.png
./text/char_u_k.png ./tile/sapling2.png
./text/char_grave.png ./tile/ladder_up.png
./text/char_u_n.png ./tile/sapling3.png
./text/char_percent.png ./tile/lava_flow.png
./text/char_u_m.png ./tile/ice_wall.png
./text/char_exclamation.png ./tile/rock_iron.png
./text/char_1.png ./tile/grass.png
./text/char_l_q.png ./tile/chest.png
./text/char_l_z.png ./tile/sapling4.png
./text/char_l_h.png ./tile/lava.png
./text/char_u_c.png ./tile/rock_coal.png
./text/char_l_g.png ./tile/tall_grass.png
./text/char_l_s.png ./tile/rock_uranium.png
./text/char_fullstop.png ./tile/rock_tin.png
./text/char_u_j.png ./tile/hemp5.png
./text/char_l_m.png ./tile/sapling1.png
./text/char_l_t.png ./tile/snow.png
./text/char_u_v.png ./tile/sandstone_wall.png
./text/char_colon.png ./tile/rock_sandstone.png
./text/char_l_i.png ./tile/hemp6.png
./text/char_l_y.png ./tile/cactus1.png
./text/char_semicolon.png ./tile/tree_branch_leaves.png
./text/char_u_l.png ./tile/tunnel_down.png
./text/char_apostrophe.png ./tile/tree_branch_leaves_snow.png
./text/char_u_e.png ./tile/tree_leaves_snow.png
./text/char_5.png ./tile/rock_ice.png
./text/char_2.png ./tile/boss_portal.png
./text/char_3.png ./tile/ladder.png
./text/char_l_p.png ./tile/grass_burnt.png
./text/char_and.png ./tile/hemp7.png
./text/char_fslash.png ./tile/grass_infested.png
./text/char_l_u.png ./tile/tree_branch.png
./text/char_u_f.png ./tile/sand.png
./text/char_u_u.png ./tile/tree_base.png
./text/char_at.png ./tile/cactus3.png
./text/char_l_e.png ./tile/sandstone.png
./text/char_l_l.png ./tile/rock_copper.png
./text/char_u_g.png ./tile/hemp3.png
./text/char_u_q.png ./tile/hemp2.png
./text/char_u_b.png ./tile/ice.png
./text/char_l_o.png
./text/char_csbracket.png
./text/char_osbracket.png
./text/char_minus.png
./text/char_l_v.png
./text/char_lthan.png
./text/char_u_s.png
./text/char_equals.png
./text/char_8.png
./text/char_ccbracket.png
./text/char_underscore.png
./text/char_u_x.png
./text/char_0.png
./text/char_l_d.png
./text/char_l_c.png
./text/char_l_j.png
./text/char_u_z.png
./text/char_u_h.png
./text/char_pow.png
./text/char_hashtag.png
./text/char_gthan.png
./text/char_cbracket.png
./text/char_u_i.png
./text/char_question.png
./text/char_u_o.png
./text/char_u_y.png
./text/char_l_r.png
./text/char_l_b.png
./text/char_ocbracket.png
./text/char_l_a.png
./text/char_quotation.png
./text/char_l_n.png
./text/char_u_p.png
./text/char_tilde.png
./text/char_u_r.png
./text/char_4.png
./entity/armored_zombie_back_moving.png
./entity/zombie_front_still.png
./entity/tnt.png
./entity/flare.png ./entity/flare.png
./entity/boss1/boss_walking.png ./entity/grappling_hook.png
./entity/zombie_back_moving.png
./entity/tnt.png
./entity/armored_zombie_back_moving.png
./entity/armored_zombie_front_moving.png
./entity/player/hair_side.png
./entity/player/head_top.png
./entity/player/head_side.png
./entity/player/head_back.png
./entity/player/head_bottom.png
./entity/player/hair_front.png
./entity/player/head_front.png
./entity/player/hair_back.png
./entity/player/hair_top.png
./entity/dummy.png
./entity/armored_zombie_front_still.png
./entity/armored_zombie_back_still.png
./entity/zombie_front_moving.png
./entity/boss1/boss_walking_firing.png
./entity/boss1/boss_firing.png ./entity/boss1/boss_firing.png
./entity/boss1/boss_still.png ./entity/boss1/boss_still.png
./entity/boss1/boss_walking_firing.png ./entity/boss1/boss_walking.png
./entity/armored_zombie_back_still.png
./entity/armored_zombie_front_moving.png
./entity/player/head_back.png
./entity/player/hair_top.png
./entity/player/head_front.png
./entity/player/head_top.png
./entity/player/hair_side.png
./entity/player/head_side.png
./entity/player/hair_back.png
./entity/player/hair_front.png
./entity/player/head_bottom.png
./entity/grappling_hook.png
./entity/zombie_back_still.png ./entity/zombie_back_still.png
./entity/dummy.png ./entity/zombie_front_still.png
./entity/zombie_back_moving.png ./item/acorn.png
./entity/armored_zombie_front_still.png ./item/clay.png
./entity/zombie_front_moving.png ./item/stone_hatchet.png
./particle/smoke_1.png ./item/grappling_hook.png
./particle/water.png ./item/gun_upgrade.png
./particle/rain.png ./item/shield_upgrade.png
./particle/blood.png ./item/rock_gold.png
./particle/snow.png ./item/rock.png
./particle/smoke_3.png ./item/flint_hatchet.png
./particle/smoke_4.png ./item/rock_iron.png
./particle/smoke_2.png ./item/log.png
./particle/smoke_0.png ./item/ash.png
./particle/bullet.png ./item/charcoal.png
./particle/lava.png ./item/torch_unlit.png
./particle/smoke_trail.png ./item/log_snow.png
./particle/smoke_5.png ./item/hemp_seed.png
./item/stone_shovel.png
./item/rock_uranium.png
./item/rock_tin.png
./item/ammo_box.png
./item/plant_fibre.png
./item/health_potion.png
./item/snow_pile.png
./item/coal.png
./item/flint.png
./item/sandstone.png
./item/rock_copper.png
./item/stone_pick.png
./item/torch_lit.png