"obsidian": {
"name": "Obsidian",
"type": "block"
+ },
+ "wood_sword": {
+ "name": "Wooden Sword",
+ "type": "tool"
+ },
+ "stone_sword": {
+ "name": "Stone Sword",
+ "type": "tool"
+ },
+ "iron_sword": {
+ "name": "Iron Sword",
+ "type": "tool"
+ },
+ "diamond_sword": {
+ "name": "Diamond Sword",
+ "type": "tool"
+ },
+ "gold_sword": {
+ "name": "Golden Sword",
+ "type": "tool"
+ },
+ "wood_shovel": {
+ "name": "Wooden Shovel",
+ "type": "tool"
+ },
+ "stone_shovel": {
+ "name": "Stone Shovel",
+ "type": "tool"
+ },
+ "iron_shovel": {
+ "name": "Iron Shovel",
+ "type": "tool"
+ },
+ "diamond_shovel": {
+ "name": "Diamond Shovel",
+ "type": "tool"
+ },
+ "gold_shovel": {
+ "name": "Golden Shovel",
+ "type": "tool"
+ },
+ "bucket_empty": {
+ "name": "Empty Bucket",
+ "type": "tool"
+ },
+ "bucket_water": {
+ "name": "Water Bucket",
+ "type": "tool"
+ },
+ "bucket_lava": {
+ "name": "Lava Bucket",
+ "type": "tool"
}
}
}
\ No newline at end of file
boolean fluid = (block.has("fluid") && block.getBoolean("fluid"));
String meta = (block.has("meta") ? block.getString("meta") : "");
String texture = (block.has("texture") ? block.getString("texture") : key);
+ Sprite sprite = key.equals("none") ? null :
+ new Sprite(new Texture(Gdx.files.internal("textures/blocks/" + texture + ".png")));
+ Block newBlock = new Block(
+ left,
+ top,
+ right,
+ bottom,
+ hp,
+ drop,
+ collision,
+ background,
+ transparent,
+ blockRequired,
+ fluid,
+ meta,
+ sprite
+ );
+
blocksIds.put(key, blocks.size);
- blocks.put(key, new Block(left, top, right, bottom, hp, drop, collision,
- background, transparent, blockRequired, fluid, meta,
- key.equals("none") ? null :
- new Sprite(new Texture(Gdx.files.internal("textures/" + texture + ".png")))));
+ blocks.put(key, newBlock);
block = block.next();
}
while (item != null) {
String name = (item.has("name") ? item.getString("name") : key);
String type = (item.has("type") ? item.getString("type") : "item");
String texture = (item.has("texture") ? item.getString("texture") : key);
+ Sprite sprite = type.equals("block") ? null :
+ new Sprite(new Texture(Gdx.files.internal("textures/items/" + texture + ".png")));
itemsIds.put(key, items.size);
- items.put(key, new Item(name, type, type.equals("block") ? null :
- new Sprite(new Texture(Gdx.files.internal("textures/" + texture + ".png")))));
+ items.put(key, new Item(name, type, sprite));
item = item.next();
}
}
drawString("Mobs: " + GP.mobs.size(), 0, 50);
drawString("Drops: " + GP.drops.size(), 0, 60);
drawString("Block: " + GameItems.getBlockKey(GP.world.getForeMap(GP.curX, GP.curY)), 0, 70);
- drawString("Game mode: " + GP.player.gameMode, 0, 80);
+ drawString("Hand: " + GameItems.getItemKey(GP.player.inv[GP.player.invSlot]), 0, 80);
+ drawString("Game mode: " + GP.player.gameMode, 0, 90);
}
spriter.end();