diff --git a/src/main/java/cz/jzitnik/Main.java b/src/main/java/cz/jzitnik/Main.java index e15e4d2..039ceaf 100644 --- a/src/main/java/cz/jzitnik/Main.java +++ b/src/main/java/cz/jzitnik/Main.java @@ -4,6 +4,7 @@ import cz.jzitnik.game.Game; import cz.jzitnik.game.MouseHandler; import cz.jzitnik.game.SpriteLoader; import cz.jzitnik.game.sprites.Window; +import cz.jzitnik.game.ui.InventoryClickHandler; import cz.jzitnik.tui.ScreenRenderer; import org.jline.terminal.MouseEvent; import org.jline.terminal.Terminal; @@ -12,7 +13,6 @@ import org.jline.terminal.TerminalBuilder; import java.io.IOException; import java.util.Optional; -import static cz.jzitnik.game.ui.InventoryClickHandler.click; public class Main { public static void main(String[] args) { @@ -48,7 +48,8 @@ public class Main { MouseEvent mouseEvent = terminal.readMouseEvent(); switch (game.getWindow()) { case WORLD -> mouseHandler.handle(mouseEvent); - case INVENTORY -> click(mouseEvent, terminal, screenRenderer, game, Optional.empty()); + case INVENTORY -> InventoryClickHandler.click(mouseEvent, terminal, screenRenderer, game, Optional.empty(), Optional.empty()); + case CRAFTING_TABLE -> game.getGameStates().craftingTable.click(mouseEvent, terminal, screenRenderer); } } } diff --git a/src/main/java/cz/jzitnik/game/Game.java b/src/main/java/cz/jzitnik/game/Game.java index dce2f5b..f942ef6 100644 --- a/src/main/java/cz/jzitnik/game/Game.java +++ b/src/main/java/cz/jzitnik/game/Game.java @@ -23,7 +23,10 @@ public class Game { @Setter private Window window = Window.WORLD; - private Inventory inventory = new Inventory(); + //jsonignore + private final GameStates gameStates = new GameStates(this); + + private final Inventory inventory = new Inventory(); public Game() { Generation.generateWorld(this); @@ -235,8 +238,10 @@ public class Game { return; } - if (!blocks.stream().allMatch(Block::isGhost)) { + if (!blocks.stream().allMatch(block -> block.getBlockId().equals("air"))) { RightClickHandler.handle(x, y, this); + screenRenderer.render(this); + return; } if (!(inventory.getItemInHand().isPresent() && inventory.getItemInHand().get().getType() == ItemType.BLOCK)) { diff --git a/src/main/java/cz/jzitnik/game/GameStates.java b/src/main/java/cz/jzitnik/game/GameStates.java new file mode 100644 index 0000000..c29c065 --- /dev/null +++ b/src/main/java/cz/jzitnik/game/GameStates.java @@ -0,0 +1,11 @@ +package cz.jzitnik.game; + +import cz.jzitnik.game.ui.CraftingTable; + +public class GameStates { + public CraftingTable craftingTable; + + public GameStates(Game game) { + craftingTable = new CraftingTable(game); + } +} diff --git a/src/main/java/cz/jzitnik/game/RightClickHandler.java b/src/main/java/cz/jzitnik/game/RightClickHandler.java index 4ec3cd2..28ce2dd 100644 --- a/src/main/java/cz/jzitnik/game/RightClickHandler.java +++ b/src/main/java/cz/jzitnik/game/RightClickHandler.java @@ -1,7 +1,24 @@ package cz.jzitnik.game; -public class RightClickHandler { - public static void handle(int x, int y, Game game) { +import java.util.HashMap; +public class RightClickHandler { + @FunctionalInterface + public interface Function3 { + void apply(T t, U u); + } + + public static void handle(int x, int y, Game game) { + HashMap> functionMap = new HashMap<>(); + functionMap.put("crafting_table", game.getGameStates().craftingTable::render); + + var blocks = game.getWorld()[y][x]; + for (Block block : blocks) { + if (functionMap.containsKey(block.getBlockId())) { + functionMap.get(block.getBlockId()).apply(x, y); + + return; + } + } } } diff --git a/src/main/java/cz/jzitnik/game/SpriteLoader.java b/src/main/java/cz/jzitnik/game/SpriteLoader.java index 7ef6dd9..2e12dfe 100644 --- a/src/main/java/cz/jzitnik/game/SpriteLoader.java +++ b/src/main/java/cz/jzitnik/game/SpriteLoader.java @@ -17,17 +17,24 @@ public class SpriteLoader { BEDROCK, BREAKING, CRAFTING_TABLE, + COBBLESTONE, OAK_LOG, OAK_LEAF, OAK_PLANKS, + WOODEN_PICKAXE, + STONE_PICKAXE, + WOODEN_AXE, + STONE_AXE, + // Items ITEM_DIRT, ITEM_OAK_LOG, ITEM_OAK_PLANKS, ITEM_STICK, - ITEM_CRAFTING_TABLE + ITEM_CRAFTING_TABLE, + ITEM_COBBLESTONE } public static final HashMap SPRITES_MAP = new HashMap<>(); @@ -44,12 +51,18 @@ public class SpriteLoader { SPRITES_MAP.put(SPRITES.OAK_LEAF, new OakLeaf()); SPRITES_MAP.put(SPRITES.OAK_PLANKS, new SimpleSprite("oak_planks.ans")); SPRITES_MAP.put(SPRITES.CRAFTING_TABLE, new SimpleSprite("crafting_table.ans")); + SPRITES_MAP.put(SPRITES.COBBLESTONE, new SimpleSprite("cobblestone.ans")); + SPRITES_MAP.put(SPRITES.WOODEN_PICKAXE, new SimpleSprite("items/wooden_pickaxe.ans")); + SPRITES_MAP.put(SPRITES.STONE_PICKAXE, new SimpleSprite("items/stone_pickaxe.ans")); + SPRITES_MAP.put(SPRITES.WOODEN_AXE, new SimpleSprite("items/wooden_axe.ans")); + SPRITES_MAP.put(SPRITES.STONE_AXE, new SimpleSprite("items/stone_axe.ans")); SPRITES_MAP.put(SPRITES.ITEM_DIRT, new SimpleSprite("items/dirt.ans")); SPRITES_MAP.put(SPRITES.ITEM_OAK_LOG, new SimpleSprite("items/oak_log.ans")); SPRITES_MAP.put(SPRITES.ITEM_OAK_PLANKS, new SimpleSprite("items/oak_planks.ans")); SPRITES_MAP.put(SPRITES.ITEM_STICK, new SimpleSprite("items/stick.ans")); SPRITES_MAP.put(SPRITES.ITEM_CRAFTING_TABLE, new SimpleSprite("items/crafting_table.ans")); + SPRITES_MAP.put(SPRITES.ITEM_COBBLESTONE, new SimpleSprite("items/cobblestone.ans")); } public static SpriteList load() { diff --git a/src/main/java/cz/jzitnik/game/crafting/CraftingRecipeList.java b/src/main/java/cz/jzitnik/game/crafting/CraftingRecipeList.java index ace2df7..7fa3e25 100644 --- a/src/main/java/cz/jzitnik/game/crafting/CraftingRecipeList.java +++ b/src/main/java/cz/jzitnik/game/crafting/CraftingRecipeList.java @@ -16,17 +16,57 @@ public class CraftingRecipeList { {null, null, null} }, () -> new InventoryItem(4, ItemBlockSupplier.Items.oakPlanks()))); + // Crafting table recipes.add(new CraftingRecipe(new String[][]{ {"oak_planks", "oak_planks", null}, {"oak_planks", "oak_planks", null}, {null, null, null} }, () -> new InventoryItem(1, ItemBlockSupplier.Items.craftingTable()))); + // Stick recipes.add(new CraftingRecipe(new String[][]{ {"oak_planks", null, null}, {"oak_planks", null, null}, {null, null, null} }, () -> new InventoryItem(4, ItemBlockSupplier.Items.stick()))); + + // Wooden pickaxe + recipes.add(new CraftingRecipe(new String[][]{ + {"oak_planks", "oak_planks", "oak_planks"}, + {null, "stick", null}, + {null, "stick", null} + }, () -> new InventoryItem(1, ItemBlockSupplier.Items.woodenPickaxe()))); + + // Wooden axe + recipes.add(new CraftingRecipe(new String[][]{ + {"oak_planks", "oak_planks", null}, + {"oak_planks", "stick", null}, + {null, "stick", null} + }, () -> new InventoryItem(1, ItemBlockSupplier.Items.woodenAxe()))); + recipes.add(new CraftingRecipe(new String[][]{ + {null, "oak_planks", "oak_planks"}, + {null, "stick", "oak_planks"}, + {null, "stick", null} + }, () -> new InventoryItem(1, ItemBlockSupplier.Items.woodenAxe()))); + + // Stone pickaxe + recipes.add(new CraftingRecipe(new String[][]{ + {"cobblestone", "cobblestone", "cobblestone"}, + {null, "stick", null}, + {null, "stick", null} + }, () -> new InventoryItem(1, ItemBlockSupplier.Items.stonePickaxe()))); + + // Stone axe + recipes.add(new CraftingRecipe(new String[][]{ + {"cobblestone", "cobblestone", null}, + {"cobblestone", "stick", null}, + {null, "stick", null} + }, () -> new InventoryItem(1, ItemBlockSupplier.Items.stoneAxe()))); + recipes.add(new CraftingRecipe(new String[][]{ + {null, "cobblestone", "cobblestone"}, + {null, "stick", "cobblestone"}, + {null, "stick", null} + }, () -> new InventoryItem(1, ItemBlockSupplier.Items.stoneAxe()))); } // 2x2 crafting diff --git a/src/main/java/cz/jzitnik/game/items/Item.java b/src/main/java/cz/jzitnik/game/items/Item.java index 267cc64..40bd5c0 100644 --- a/src/main/java/cz/jzitnik/game/items/Item.java +++ b/src/main/java/cz/jzitnik/game/items/Item.java @@ -17,9 +17,19 @@ public class Item { private SpriteLoader.SPRITES sprite; private boolean stackable = true; private int durability; - private int miningDecrease = 0; + private double miningDecrease = 0; private int stackAmount = 64; - private Optional block; + private Optional block = Optional.empty(); + + public Item(String id, String name, ItemType type, SpriteLoader.SPRITES sprite, ToolVariant toolVariant, double miningDecrease, int durability) { + this.id = id; + this.name = name; + this.type = type; + this.sprite = sprite; + this.toolVariant = Optional.of(toolVariant); + this.miningDecrease = miningDecrease; + this.durability = durability; + } public Item(String id, String name, ItemType type, SpriteLoader.SPRITES sprite, Block block) { this.id = id; @@ -34,7 +44,6 @@ public class Item { this.name = name; this.type = type; this.sprite = sprite; - this.block = Optional.empty(); } public void use() { diff --git a/src/main/java/cz/jzitnik/game/items/ItemBlockSupplier.java b/src/main/java/cz/jzitnik/game/items/ItemBlockSupplier.java index 0fa07ef..c7c2e56 100644 --- a/src/main/java/cz/jzitnik/game/items/ItemBlockSupplier.java +++ b/src/main/java/cz/jzitnik/game/items/ItemBlockSupplier.java @@ -13,8 +13,8 @@ public class ItemBlockSupplier { public static Item dirt(Block ref) { return new Item("dirt", "Dirt block", ItemType.BLOCK, SpriteLoader.SPRITES.ITEM_DIRT, ref); } - public static Item stone(Block ref) { - return new Item("stone", "Stone block", ItemType.BLOCK, SpriteLoader.SPRITES.ITEM_DIRT, ref); + public static Item cobblestone(Block ref) { + return new Item("cobblestone", "Cobblestone", ItemType.BLOCK, SpriteLoader.SPRITES.ITEM_COBBLESTONE, ref); } public static Item oakLog(Block ref) { return new Item("oak_log", "Oak log", ItemType.BLOCK, SpriteLoader.SPRITES.ITEM_OAK_LOG, ref); @@ -38,9 +38,14 @@ public class ItemBlockSupplier { block.setDrops(List.of(Items.dirt())); return block; } + public static Block cobblestone() { + var block = new Block("cobblestone", SpriteLoader.SPRITES.COBBLESTONE, 15, ItemType.PICKAXE, Arrays.stream(ToolVariant.values()).toList()); + block.setDrops(List.of(Helper.cobblestone(block))); + return block; + } public static Block stone() { var block = new Block("stone", SpriteLoader.SPRITES.STONE, 15, ItemType.PICKAXE, Arrays.stream(ToolVariant.values()).toList()); - block.setDrops(List.of(Helper.stone(block))); + block.setDrops(List.of(Items.cobblestone())); return block; } public static Block oakLog() { @@ -74,5 +79,20 @@ public class ItemBlockSupplier { public static Item craftingTable() { return Helper.craftingTable(Blocks.craftingTable()); } + public static Item woodenPickaxe() { + return new Item("wooden_pickaxe", "Wooden pickaxe", ItemType.PICKAXE, SpriteLoader.SPRITES.WOODEN_PICKAXE, ToolVariant.WOODEN, 12, 59); + } + public static Item woodenAxe() { + return new Item("wooden_axe", "Wooden axe", ItemType.AXE, SpriteLoader.SPRITES.WOODEN_AXE, ToolVariant.WOODEN, 2, 59); + } + public static Item cobblestone() { + return Helper.cobblestone(Blocks.cobblestone()); + } + public static Item stonePickaxe() { + return new Item("stone_pickaxe", "Stone pickaxe", ItemType.PICKAXE, SpriteLoader.SPRITES.STONE_PICKAXE, ToolVariant.STONE, 12.5, 132); + } + public static Item stoneAxe() { + return new Item("stone_axe", "Stone axe", ItemType.AXE, SpriteLoader.SPRITES.STONE_AXE, ToolVariant.STONE, 3, 132); + } } } diff --git a/src/main/java/cz/jzitnik/game/sprites/Window.java b/src/main/java/cz/jzitnik/game/sprites/Window.java index ce08d72..d138775 100644 --- a/src/main/java/cz/jzitnik/game/sprites/Window.java +++ b/src/main/java/cz/jzitnik/game/sprites/Window.java @@ -2,5 +2,6 @@ package cz.jzitnik.game.sprites; public enum Window { WORLD, - INVENTORY + INVENTORY, + CRAFTING_TABLE } diff --git a/src/main/java/cz/jzitnik/game/ui/CraftingTable.java b/src/main/java/cz/jzitnik/game/ui/CraftingTable.java new file mode 100644 index 0000000..a96076a --- /dev/null +++ b/src/main/java/cz/jzitnik/game/ui/CraftingTable.java @@ -0,0 +1,152 @@ +package cz.jzitnik.game.ui; + +import cz.jzitnik.game.Game; +import cz.jzitnik.game.crafting.CraftingRecipe; +import cz.jzitnik.game.crafting.CraftingRecipeList; +import cz.jzitnik.game.items.InventoryItem; +import cz.jzitnik.game.sprites.Window; +import cz.jzitnik.tui.ScreenRenderer; +import cz.jzitnik.tui.utils.SpriteCombiner; +import cz.jzitnik.tui.SpriteList; +import cz.jzitnik.tui.utils.Numbers; +import org.jline.terminal.MouseEvent; +import org.jline.terminal.Terminal; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +public class CraftingTable { + private Game game; + private static final int ROW_AMOUNT = 3; + private static final int COLUMN_AMOUNT = 3; + private static final int CELL_WIDTH = 50; + private static final int CELL_HEIGHT = 25; + private static final int BORDER_SIZE = 2; + + private final InventoryItem[] items = new InventoryItem[9]; + private int size; + + public void render(int ignored, int ignored2) { + game.setWindow(Window.CRAFTING_TABLE); + } + + public void pickup() { + Optional recipe = CraftingRecipeList.getRecipeSmall(Arrays.stream(items).map(item -> item == null ? null: item.getItem().getId()).toArray(String[]::new)); + + if (recipe.isPresent()) { + InventoryItem item = recipe.get().getItemSupplier().get(); + game.getInventory().addItem(item); + + for (int i = 0; i < items.length; i++) { + InventoryItem it = items[i]; + if (it == null) { + continue; + } + + if (it.getAmount() == 1) { + items[i] = null; + } else { + it.setAmount(it.getAmount() - 1); + } + } + } + } + + public void render(StringBuilder buffer, Terminal terminal, SpriteList spriteList) { + int widthPixels = COLUMN_AMOUNT * (CELL_WIDTH + BORDER_SIZE) + BORDER_SIZE; + var inventory = game.getInventory(); + + int moveLeft = (terminal.getWidth() / 2) - (widthPixels / 2); + + List sprites = game.getInventory().getSprites(items, spriteList, inventory.getSelectedItemInv() - 50); + + Optional recipe = CraftingRecipeList.getRecipeSmall(Arrays.stream(items).map(item -> item == null ? null: item.getItem().getId()).toArray(String[]::new)); + + Optional craftedItem = recipe.map(craftingRecipe -> craftingRecipe.getItemSupplier().get()); + + String[] craftedSprite = craftedItem.map(inventoryItem -> SpriteCombiner.combineTwoSprites( + spriteList.getSprite(inventoryItem.getItem().getSprite()).getSprite(), + Numbers.getNumberSprite(inventoryItem.getAmount()) + ).split("\n")).orElse(null); + + for (int i = 0; i < ROW_AMOUNT; i++) { + for (int j = 0; j < CELL_HEIGHT; j++) { + buffer.append("\033[0m").append(" ".repeat(moveLeft)); + for (int k = 0; k < COLUMN_AMOUNT; k++) { + buffer.append("\033[38;5;231;48;5;231m▓".repeat(BORDER_SIZE)); + if (j == 0 || j == CELL_HEIGHT - 1) { + buffer.append("\033[38;5;231;48;5;231m▓".repeat(CELL_WIDTH)); + } else { + String sprite = sprites.get(i * COLUMN_AMOUNT + k); + if (sprite == null || sprite.isEmpty()) { + buffer.append("\033[0m ".repeat(CELL_WIDTH)); + } else { + String[] spriteLines = sprite.split("\n"); + buffer.append(spriteLines[j + 1]); + } + } + buffer.append("\033[38;5;231;48;5;231m▓".repeat(BORDER_SIZE)); + } + + + if (i == 1) { + buffer.append("\033[0m ".repeat(7)); + buffer.append("\033[38;5;231;48;5;231m▓".repeat(BORDER_SIZE)); + if (j == 0 || j == CELL_HEIGHT - 1) { + buffer.append("\033[38;5;231;48;5;231m▓".repeat(CELL_WIDTH)); + } else { + if (craftedItem.isEmpty()) { + buffer.append("\033[0m ".repeat(CELL_WIDTH)); + } else { + buffer.append(craftedSprite[j + 1]); + } + } + buffer.append("\033[38;5;231;48;5;231m▓".repeat(BORDER_SIZE)); + } + buffer.append("\n"); + } + } + + buffer.append("\n".repeat(20)); + + size = buffer.toString().split("\n").length; + + game.getInventory().renderFull(buffer, terminal, spriteList, false, Optional.of(size)); + } + + public void click(MouseEvent mouseEvent, Terminal terminal, ScreenRenderer screenRenderer) { + int x = mouseEvent.getX(); + int y = mouseEvent.getY(); + int widthPixels = COLUMN_AMOUNT * (CELL_WIDTH + BORDER_SIZE) + BORDER_SIZE; + int heightPixels = ROW_AMOUNT * (CELL_HEIGHT + 1); + int moveLeft = (terminal.getWidth() / 2) - (widthPixels / 2); + + if (x > moveLeft + widthPixels + 7 && x < moveLeft + widthPixels + 7 + CELL_WIDTH + BORDER_SIZE * 2 && y > 26 && y < 52 && mouseEvent.getType() == MouseEvent.Type.Pressed && mouseEvent.getButton() == MouseEvent.Button.Button1) { + pickup(); + screenRenderer.render(game); + + return; + } + + if (x > moveLeft && x <= moveLeft + widthPixels && y > 0 && y <= heightPixels && mouseEvent.getType() == MouseEvent.Type.Pressed) { + if (mouseEvent.getType() != MouseEvent.Type.Pressed) return; + + int blockX = (x - moveLeft) / 52; + int blockY = y / 26; + + InventoryClickHandler.handleItemClick(mouseEvent, game.getInventory(), items, blockY * COLUMN_AMOUNT + blockX, 50, Optional.of(items)); + + screenRenderer.render(game); + + return; + } + + // TODO: Why I need to add 20 here. Like wtf + InventoryClickHandler.click(mouseEvent, terminal, screenRenderer, game, Optional.of(size + 20), Optional.of(items)); + } + + public CraftingTable(Game game) { + this.game = game; + } +} diff --git a/src/main/java/cz/jzitnik/game/ui/Inventory.java b/src/main/java/cz/jzitnik/game/ui/Inventory.java index 94a6957..8893ee1 100644 --- a/src/main/java/cz/jzitnik/game/ui/Inventory.java +++ b/src/main/java/cz/jzitnik/game/ui/Inventory.java @@ -2,9 +2,9 @@ package cz.jzitnik.game.ui; import cz.jzitnik.game.items.InventoryItem; import cz.jzitnik.game.items.Item; -import cz.jzitnik.tui.SpriteCombiner; +import cz.jzitnik.tui.utils.SpriteCombiner; import cz.jzitnik.tui.SpriteList; -import cz.jzitnik.utils.Numbers; +import cz.jzitnik.tui.utils.Numbers; import lombok.Getter; import lombok.Setter; import org.jline.terminal.Terminal; @@ -153,7 +153,7 @@ public class Inventory { List sprites = getSprites(items, spriteList, selectedItemInv); // Top center - buffer.append("\n".repeat(Math.max(0, moveTop))); + buffer.append("\n".repeat(Math.max(0, moveTopCustom.isPresent() ? 0 : moveTop))); buffer.append("\033[0m ".repeat(moveLeft)); buffer.append("\033[38;5;231;48;5;231m▓".repeat(widthPixels)).append("\033[0m\n"); @@ -181,7 +181,7 @@ public class Inventory { buffer.append("\033[38;5;231;48;5;231m▓"); } else { buffer.append("\033[38;5;231;48;5;231m▓".repeat(widthPixels)); - if (i == 0) { + if (i == 0 && includeCrafting) { buffer.append("\033[0m").append(" ".repeat(20)); buffer.append("\033[38;5;231;48;5;231m▓".repeat(106)); } @@ -190,7 +190,7 @@ public class Inventory { if (i + 1 > spacesFromTop && includeCrafting) { int craftingIndex = ((i - spacesFromTop) * 26) + j; - if (craftingIndex >= 0 && craftingIndex < craftingTable.length) { + if (craftingIndex < craftingTable.length) { buffer.append("\033[0m").append(" ".repeat(20)); buffer.append(craftingTable[craftingIndex]); } @@ -238,11 +238,12 @@ public class Inventory { return sprites; } - public InventoryDTO getItem(int index) { - InventoryItem temp; + public InventoryDTO getItem(int index, Optional i) { if (index < 20) { // Normal inventory return new InventoryDTO(items, index); + } else if (index >= 50) { + return new InventoryDTO(i.get(), index - 50); } else if (index >= 29) { // Small crafting table return new InventoryDTO(smallCraftingTable.getItems(), index - 29); @@ -252,9 +253,9 @@ public class Inventory { } } - public InventoryItem getSelectedItem() { + public InventoryItem getSelectedItem(Optional i) { InventoryItem temp; - InventoryDTO data = getItem(selectedItemInv); + InventoryDTO data = getItem(selectedItemInv, i); temp = data.getObj()[data.getIndex()]; data.getObj()[data.getIndex()] = null; @@ -264,11 +265,11 @@ public class Inventory { return temp; } - public InventoryItem getOne() { - InventoryDTO inventoryItem = getItem(selectedItemInv); + public InventoryItem getOne(Optional i) { + InventoryDTO inventoryItem = getItem(selectedItemInv, i); InventoryItem item = inventoryItem.getObj()[inventoryItem.getIndex()]; if (item.getAmount() == 1) { - return getSelectedItem(); + return getSelectedItem(i); } item.setAmount(item.getAmount() - 1); @@ -278,11 +279,11 @@ public class Inventory { return new InventoryItem(1, item.getItem()); } - public InventoryItem getHalf() { - InventoryDTO inventoryItem = getItem(selectedItemInv); + public InventoryItem getHalf(Optional i) { + InventoryDTO inventoryItem = getItem(selectedItemInv, i); InventoryItem item = inventoryItem.getObj()[inventoryItem.getIndex()]; if (item.getAmount() == 1) { - return getSelectedItem(); + return getSelectedItem(i); } int half = item.getAmount() / 2; @@ -298,9 +299,9 @@ public class Inventory { return selectedItemInv != -1; } - public void mergeItems(int indexFrom, int indexTo) { - InventoryDTO fromData = getItem(indexFrom); - InventoryDTO toData = getItem(indexTo); + public void mergeItems(int indexFrom, int indexTo, Optional i) { + InventoryDTO fromData = getItem(indexFrom, i); + InventoryDTO toData = getItem(indexTo, i); InventoryItem fromItem = fromData.getObj()[fromData.getIndex()]; InventoryItem toItem = toData.getObj()[toData.getIndex()]; @@ -326,9 +327,9 @@ public class Inventory { selectedItemInv = -1; } - public void mergeOne(int fromIndex, int toIndex) { - InventoryDTO fromSlot = getItem(fromIndex); - InventoryDTO toSlot = getItem(toIndex); + public void mergeOne(int fromIndex, int toIndex, Optional i) { + InventoryDTO fromSlot = getItem(fromIndex, i); + InventoryDTO toSlot = getItem(toIndex, i); InventoryItem fromItem = fromSlot.getObj()[fromSlot.getIndex()]; InventoryItem toItem = toSlot.getObj()[toSlot.getIndex()]; diff --git a/src/main/java/cz/jzitnik/game/ui/InventoryClickHandler.java b/src/main/java/cz/jzitnik/game/ui/InventoryClickHandler.java index 766a243..399e373 100644 --- a/src/main/java/cz/jzitnik/game/ui/InventoryClickHandler.java +++ b/src/main/java/cz/jzitnik/game/ui/InventoryClickHandler.java @@ -1,6 +1,7 @@ package cz.jzitnik.game.ui; import cz.jzitnik.game.Game; +import cz.jzitnik.game.items.InventoryItem; import cz.jzitnik.tui.ScreenRenderer; import org.jline.terminal.MouseEvent; import org.jline.terminal.Terminal; @@ -10,7 +11,7 @@ import java.util.Optional; import static cz.jzitnik.game.ui.Inventory.*; public class InventoryClickHandler { - public static void click(MouseEvent mouseEvent, Terminal terminal, ScreenRenderer screenRenderer, Game game, Optional moveTopCustom) { + public static void click(MouseEvent mouseEvent, Terminal terminal, ScreenRenderer screenRenderer, Game game, Optional moveTopCustom, Optional i) { if (mouseEvent.getType() != MouseEvent.Type.Pressed) return; var inventory = game.getInventory(); @@ -18,11 +19,11 @@ public class InventoryClickHandler { int y = mouseEvent.getY(); int moveLeft = calculateMoveLeft(terminal); - int moveTop = moveTopCustom.orElse(calculateMoveTop(terminal)); + int moveTop = moveTopCustom.orElseGet(() -> calculateMoveTop(terminal)); - if (handleCraftingTableClick(mouseEvent, x, y, inventory, screenRenderer, game, moveLeft, moveTop)) return; - if (handleHotbarClick(mouseEvent, x, y, inventory, screenRenderer, game, terminal, moveTop)) return; - handleInventoryClick(mouseEvent, x, y, inventory, screenRenderer, game, moveLeft, moveTop); + if (handleCraftingTableClick(mouseEvent, x, y, inventory, screenRenderer, game, moveLeft, moveTop, i)) return; + if (handleHotbarClick(mouseEvent, x, y, inventory, screenRenderer, game, terminal, moveTop, i)) return; + handleInventoryClick(mouseEvent, x, y, inventory, screenRenderer, game, moveLeft, moveTop, i); } private static int calculateMoveLeft(Terminal terminal) { @@ -33,7 +34,7 @@ public class InventoryClickHandler { return (terminal.getHeight() / 2) - ((ROW_AMOUNT * (25 + 1)) / 2); } - private static boolean handleCraftingTableClick(MouseEvent mouseEvent, int x, int y, Inventory inventory, ScreenRenderer screenRenderer, Game game, int moveLeft, int moveTop) { + private static boolean handleCraftingTableClick(MouseEvent mouseEvent, int x, int y, Inventory inventory, ScreenRenderer screenRenderer, Game game, int moveLeft, int moveTop, Optional i) { int startLeftCrafting = moveLeft + (COLUMN_AMOUNT * (50 + 4) + 2) + 20; int startTopCrafting = moveTop + 26; @@ -49,24 +50,24 @@ public class InventoryClickHandler { } int blockIndex = (craftY / 26) * 2 + (craftX / 53); - handleItemClick(mouseEvent, inventory, inventory.getSmallCraftingTable().getItems(), blockIndex, 29); + handleItemClick(mouseEvent, inventory, inventory.getSmallCraftingTable().getItems(), blockIndex, 29, i); screenRenderer.render(game); return true; } - private static boolean handleHotbarClick(MouseEvent mouseEvent, int x, int y, Inventory inventory, ScreenRenderer screenRenderer, Game game, Terminal terminal, int moveTop) { + private static boolean handleHotbarClick(MouseEvent mouseEvent, int x, int y, Inventory inventory, ScreenRenderer screenRenderer, Game game, Terminal terminal, int moveTop, Optional i) { int startLeftHotbar = (terminal.getWidth() / 2) - (INVENTORY_SIZE_PX / 2) + 2; int startTopHotbar = moveTop + (ROW_AMOUNT * (25 + 1)) + 10; if (x < startLeftHotbar || y < startTopHotbar || x > startLeftHotbar + INVENTORY_SIZE_PX || y > startTopHotbar + 26) return false; int index = (x - startLeftHotbar) / 52; - handleItemClick(mouseEvent, inventory, inventory.getHotbar(), index, 20); + handleItemClick(mouseEvent, inventory, inventory.getHotbar(), index, 20, i); screenRenderer.render(game); return true; } - private static void handleInventoryClick(MouseEvent mouseEvent, int x, int y, Inventory inventory, ScreenRenderer screenRenderer, Game game, int moveLeft, int moveTop) { + private static void handleInventoryClick(MouseEvent mouseEvent, int x, int y, Inventory inventory, ScreenRenderer screenRenderer, Game game, int moveLeft, int moveTop, Optional i) { int fx = x - moveLeft; int fy = y - moveTop; @@ -76,11 +77,11 @@ public class InventoryClickHandler { if (fx < 0 || fx > widthPixels || fy < 0 || fy > heightPixels) return; int blockIndex = (fy / 26) * COLUMN_AMOUNT + (fx / 54); - handleItemClick(mouseEvent, inventory, inventory.getItems(), blockIndex, 0); + handleItemClick(mouseEvent, inventory, inventory.getItems(), blockIndex, 0, i); screenRenderer.render(game); } - private static void handleItemClick(MouseEvent mouseEvent, Inventory inventory, Object[] items, int index, int offset) { + public static void handleItemClick(MouseEvent mouseEvent, Inventory inventory, Object[] items, int index, int offset, Optional i) { int actualIndex = index + offset; if (inventory.getSelectedItemInv() == actualIndex) { @@ -90,11 +91,11 @@ public class InventoryClickHandler { switch (mouseEvent.getButton()) { case Button1 -> { if (items[index] == null && inventory.hasSelectedItem()) { - items[index] = inventory.isRightClick() ? inventory.getHalf() : inventory.getSelectedItem(); + items[index] = inventory.isRightClick() ? inventory.getHalf(i) : inventory.getSelectedItem(i); } else if (items[index] != null) { if (inventory.hasSelectedItem()) { // Merge items - inventory.mergeItems(inventory.getSelectedItemInv(), actualIndex); + inventory.mergeItems(inventory.getSelectedItemInv(), actualIndex, i); } else { inventory.setSelectedItemInv(index + offset); } @@ -104,7 +105,7 @@ public class InventoryClickHandler { if (items[index] != null) { if (inventory.hasSelectedItem()) { // Merge just one item into the stack - inventory.mergeOne(inventory.getSelectedItemInv(), actualIndex); + inventory.mergeOne(inventory.getSelectedItemInv(), actualIndex, i); } else { // Pick up one item inventory.setSelectedItemInv(actualIndex); @@ -112,7 +113,7 @@ public class InventoryClickHandler { } } else { // Place one item - items[index] = inventory.getOne(); + items[index] = inventory.getOne(i); } } } diff --git a/src/main/java/cz/jzitnik/game/ui/SmallCraftingTable.java b/src/main/java/cz/jzitnik/game/ui/SmallCraftingTable.java index 047a3f4..99f7a7f 100644 --- a/src/main/java/cz/jzitnik/game/ui/SmallCraftingTable.java +++ b/src/main/java/cz/jzitnik/game/ui/SmallCraftingTable.java @@ -3,9 +3,9 @@ package cz.jzitnik.game.ui; import cz.jzitnik.game.crafting.CraftingRecipe; import cz.jzitnik.game.crafting.CraftingRecipeList; import cz.jzitnik.game.items.InventoryItem; -import cz.jzitnik.tui.SpriteCombiner; +import cz.jzitnik.tui.utils.SpriteCombiner; import cz.jzitnik.tui.SpriteList; -import cz.jzitnik.utils.Numbers; +import cz.jzitnik.tui.utils.Numbers; import lombok.Getter; import java.util.Arrays; diff --git a/src/main/java/cz/jzitnik/tui/ScreenRenderer.java b/src/main/java/cz/jzitnik/tui/ScreenRenderer.java index ac48968..f3e211b 100644 --- a/src/main/java/cz/jzitnik/tui/ScreenRenderer.java +++ b/src/main/java/cz/jzitnik/tui/ScreenRenderer.java @@ -2,6 +2,7 @@ package cz.jzitnik.tui; import cz.jzitnik.game.Block; import cz.jzitnik.game.Game; +import cz.jzitnik.tui.utils.SpriteCombiner; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -43,6 +44,7 @@ public class ScreenRenderer { switch (game.getWindow()) { case INVENTORY -> game.getInventory().renderFull(main, terminal, spriteList, true, Optional.empty()); + case CRAFTING_TABLE -> game.getGameStates().craftingTable.render(main, terminal, spriteList); case WORLD -> { // World diff --git a/src/main/java/cz/jzitnik/utils/Numbers.java b/src/main/java/cz/jzitnik/tui/utils/Numbers.java similarity index 96% rename from src/main/java/cz/jzitnik/utils/Numbers.java rename to src/main/java/cz/jzitnik/tui/utils/Numbers.java index c50e6e5..d6f2222 100644 --- a/src/main/java/cz/jzitnik/utils/Numbers.java +++ b/src/main/java/cz/jzitnik/tui/utils/Numbers.java @@ -1,7 +1,6 @@ -package cz.jzitnik.utils; +package cz.jzitnik.tui.utils; import cz.jzitnik.game.sprites.ui.Number; -import cz.jzitnik.tui.SpriteCombiner; public class Numbers { private static Number.NumberState getNumberState(int digit) { diff --git a/src/main/java/cz/jzitnik/tui/SpriteCombiner.java b/src/main/java/cz/jzitnik/tui/utils/SpriteCombiner.java similarity index 98% rename from src/main/java/cz/jzitnik/tui/SpriteCombiner.java rename to src/main/java/cz/jzitnik/tui/utils/SpriteCombiner.java index 0855b20..de4ab11 100644 --- a/src/main/java/cz/jzitnik/tui/SpriteCombiner.java +++ b/src/main/java/cz/jzitnik/tui/utils/SpriteCombiner.java @@ -1,4 +1,4 @@ -package cz.jzitnik.tui; +package cz.jzitnik.tui.utils; public class SpriteCombiner { public static String combineSprites(String[] sprites) { diff --git a/src/main/resources/textures/cobblestone.ans b/src/main/resources/textures/cobblestone.ans new file mode 100644 index 0000000..849804b --- /dev/null +++ b/src/main/resources/textures/cobblestone.ans @@ -0,0 +1,26 @@ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ + \ No newline at end of file diff --git a/src/main/resources/textures/items/cobblestone.ans b/src/main/resources/textures/items/cobblestone.ans new file mode 100644 index 0000000..e244126 --- /dev/null +++ b/src/main/resources/textures/items/cobblestone.ans @@ -0,0 +1,26 @@ +                                                   +                      ▓▓▓▓▓▓▓                      +                  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓                  +              ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓              +          ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓          +      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓      +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   +      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓      +          ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓          +              ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓              +                  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓                  +                      ▓▓▓▓▓▓▓                      + \ No newline at end of file diff --git a/src/main/resources/textures/items/stone_axe.ans b/src/main/resources/textures/items/stone_axe.ans new file mode 100644 index 0000000..98f087d --- /dev/null +++ b/src/main/resources/textures/items/stone_axe.ans @@ -0,0 +1,25 @@ +  +    +    +         +        +          +            +         +           +           +           +           +          +         +        +       +       +       +      +      +       +       +     +    +  diff --git a/src/main/resources/textures/items/stone_pickaxe.ans b/src/main/resources/textures/items/stone_pickaxe.ans new file mode 100644 index 0000000..e9ddfd5 --- /dev/null +++ b/src/main/resources/textures/items/stone_pickaxe.ans @@ -0,0 +1,26 @@ +                                                   +                                                   +                                                   +                  ▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒               +                ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▓▓▓      +               ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  ░░░░▓      +               ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   ░░░▓      +                  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░   ░      +                  ▒▓▓▒▒░░░░░░░░▒   ▓▓▓▓▓▓   ░      +                           ▒▒▒▒▒   ▓▓▓▓▓▓▓▓▓░░░░   +                           ▒▓   ░░░   ▓▓▓▓▓▓▓▓▓░   +                        ▒░ ░░░░▒   ░░░▓▓▓▓▓▓▓▓▓░   +                      ▒▒▒▒  ░░░▒   ░ ░▓▓▓▓▓▓▓▓▓░   +                     ░   ░░░░   ░░░░░░▓▓▓▓▓▓▓▓▓░   +                  ▒▓▓▓░░░░░░░▒▒▒░    ░▓▓▓▓▓▓▓▓▓░   +                ▒▒▒   ░░░   ▓        ░▓▓▓▓▓▓▓▓▓░   +               ▒   ░░░   ▒░░░        ░▓▓▓▓▓▓▓▓▓░   +            ▒▒▒▒   ░░░   ▒░          ░▓▓▓▓▓▓▓▓▓░   +            ▒   ░░░   ░░               ░░▓▓▓░      +        ▒▒   ░░░   ░░░░                 ░░░░░      +      ▒▒▒▒   ░░░   ░                               +      ▒   ░░░   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ +      ▒      ░░░░                                  +      ░      ░                                     +                                                   + \ No newline at end of file diff --git a/src/main/resources/textures/items/wooden_axe.ans b/src/main/resources/textures/items/wooden_axe.ans new file mode 100644 index 0000000..ba5932a --- /dev/null +++ b/src/main/resources/textures/items/wooden_axe.ans @@ -0,0 +1,26 @@ +                                                   +                                                   +                            ▒                      +                         ░░░░      ░░░             +                            ░░░░░░░                +                         ░░░░░░░░░░                +                         ░░░░░░░░░░                +                      ░░░░░░░░░░░░░   ░░░          +                      ░░░░░░░░░░░░░░░░             +                      ░░░░░░░░░░░░░░░░             +                                ░░░░░░░░░          +                            ░░░░   ░░░░░░          +                            ░░░░   ░░░░░░          +                         ░░░   ▒                   +                   ▓▓▓░░░    ░░░   ░░░░░░          +                      ░░░   ░                      +                   ░░░                             +                   ░░░                             +                ░░░                                +             ░░░                                   +             ░░░                                   +      ░   ░░░                                      +      ░                                            +      ░                                            +                                                   + \ No newline at end of file diff --git a/src/main/resources/textures/items/wooden_pickaxe.ans b/src/main/resources/textures/items/wooden_pickaxe.ans new file mode 100644 index 0000000..997f4af --- /dev/null +++ b/src/main/resources/textures/items/wooden_pickaxe.ans @@ -0,0 +1,26 @@ +                                                   +                                                   +                                                   +                   ░░░░░░░░░░░░░░░░                +                                                   +                   ░░░░░░░░░░░░░░░░      ░░░       +                   ░░░░░░░░░░░░░░░░      ░░░       +                                ░░░░░░░░░          +                               ░   ░░░░░░          +                               ░   ░░░░░░          +                            ▓   ░░░   ░░░░░░       +                            ░░░░         ░░░       +                            ░░░░         ░░░       +                         ░░░   ▒         ░░░       +                   ▓▓▓░░░   ▒░░░         ░░░       +                      ░░░   ░            ░░░       +                   ░░░                   ░░░       +                   ░░░                   ░░░       +                ░░░                                +             ░░░                                   +             ░░░                                   +      ░   ░░░                                      +      ░                                            +      ░                                            +                                                   + \ No newline at end of file