From a7eb7e498e443e00912f1eb1f8f55efc943384b3 Mon Sep 17 00:00:00 2001 From: Anthony Tornetta Date: Mon, 30 Oct 2023 01:05:02 -0400 Subject: [PATCH] Changed texture location --- cosmos_client/assets/blocks/thruster.json | 2 +- cosmos_client/assets/lang/blocks/en_us.lang | 2 ++ cosmos_client/src/ui/hotbar.rs | 9 +++++++-- .../src/events/netty/netty_events.rs | 20 +++++++++---------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cosmos_client/assets/blocks/thruster.json b/cosmos_client/assets/blocks/thruster.json index f6e10b81d..38406667a 100644 --- a/cosmos_client/assets/blocks/thruster.json +++ b/cosmos_client/assets/blocks/thruster.json @@ -1,7 +1,7 @@ { "texture": { "back": "thruster_back", - "front": "ship_hull", + "front": "ship_hull_grey", "left": "thruster_left_right", "right": "thruster_left_right", "top": "thruster_top_bottom", diff --git a/cosmos_client/assets/lang/blocks/en_us.lang b/cosmos_client/assets/lang/blocks/en_us.lang index 1ddffa60b..332b3a64a 100644 --- a/cosmos_client/assets/lang/blocks/en_us.lang +++ b/cosmos_client/assets/lang/blocks/en_us.lang @@ -17,6 +17,8 @@ cosmos:molten_stone=Molten Stone cosmos:cheese=Cheese (Lava) cosmos:ice=Ice cosmos:water=Water +cosmos:sand=Sand +cosmos:cactus=Cactus cosmos:build_block=Build Block cosmos:ship_hull_grey=Grey Ship Hull diff --git a/cosmos_client/src/ui/hotbar.rs b/cosmos_client/src/ui/hotbar.rs index 00337d248..8bdc853de 100644 --- a/cosmos_client/src/ui/hotbar.rs +++ b/cosmos_client/src/ui/hotbar.rs @@ -1,7 +1,11 @@ //! Displays the player's hotbar use bevy::prelude::*; -use cosmos_core::{inventory::Inventory, item::Item}; +use cosmos_core::{ + inventory::Inventory, + item::Item, + registry::{identifiable::Identifiable, Registry}, +}; use crate::{ input::inputs::{CosmosInputs, InputChecker, InputHandler}, @@ -127,6 +131,7 @@ fn listen_for_change_events( item_name_query: Query>, mut commands: Commands, names: Res>, + items: Res>, ) { if let Ok(mut hb) = query_hb.get_single_mut() { if hb.selected_slot != hb.prev_slot { @@ -146,7 +151,7 @@ fn listen_for_change_events( if let Some(is) = inv.itemstack_at(hb.selected_slot()) { name_text.sections[0].value = names .get_name_from_numeric_id(is.item_id()) - .unwrap_or(&format!("[missing name] ID #{}", is.item_id())) + .unwrap_or(&format!("{}", items.from_numeric_id(is.item_id()).unlocalized_name())) .to_owned(); name_text.sections[0].style.color = Color::WHITE; diff --git a/cosmos_server/src/events/netty/netty_events.rs b/cosmos_server/src/events/netty/netty_events.rs index 489fdc6f1..41aa11e0e 100644 --- a/cosmos_server/src/events/netty/netty_events.rs +++ b/cosmos_server/src/events/netty/netty_events.rs @@ -27,25 +27,25 @@ use crate::netty::network_helpers::{ClientTicks, ServerLobby}; fn generate_player_inventory(items: &Registry) -> Inventory { let mut inventory = Inventory::new(9 * 6, Some(0..9)); - inventory.insert_item_at(0, items.from_id("cosmos:ship_hull").expect("Ship hull item to exist"), 999); + // inventory.insert_item_at(0, items.from_id("cosmos:ship_hull").expect("Ship hull item to exist"), 999); - inventory.insert_item_at(1, items.from_id("cosmos:glass").expect("Glass item to exist"), 999); + // inventory.insert_item_at(1, items.from_id("cosmos:glass").expect("Glass item to exist"), 999); - inventory.insert_item_at(2, items.from_id("cosmos:build_block").expect("Build block item to exist"), 999); + // inventory.insert_item_at(2, items.from_id("cosmos:build_block").expect("Build block item to exist"), 999); - inventory.insert_item_at(3, items.from_id("cosmos:thruster").expect("Thruster item to exist"), 999); + // inventory.insert_item_at(3, items.from_id("cosmos:thruster").expect("Thruster item to exist"), 999); - inventory.insert_item_at(4, items.from_id("cosmos:laser_cannon").expect("Laser cannon item to exist"), 999); + // inventory.insert_item_at(4, items.from_id("cosmos:laser_cannon").expect("Laser cannon item to exist"), 999); - inventory.insert_item_at(5, items.from_id("cosmos:reactor").expect("Reactor item to exist"), 999); + // inventory.insert_item_at(5, items.from_id("cosmos:reactor").expect("Reactor item to exist"), 999); - inventory.insert_item_at(6, items.from_id("cosmos:energy_cell").expect("Energy cell item to exist"), 999); + // inventory.insert_item_at(6, items.from_id("cosmos:energy_cell").expect("Energy cell item to exist"), 999); - inventory.insert_item_at(7, items.from_id("cosmos:light").expect("Light item to exist"), 999); + // inventory.insert_item_at(7, items.from_id("cosmos:light").expect("Light item to exist"), 999); - inventory.insert_item_at(8, items.from_id("cosmos:redwood_log").expect("Redwood log item to exist"), 999); + // inventory.insert_item_at(8, items.from_id("cosmos:redwood_log").expect("Redwood log item to exist"), 999); - for item in items.iter().filter(|item| item.unlocalized_name() != "cosmos:air") { + for item in items.iter().rev().filter(|item| item.unlocalized_name() != "cosmos:air") { inventory.insert_itemstack(&ItemStack::with_quantity(item, 999)); }