From 6b208b5463f6b336c54d4d131cdf4a3c45be5499 Mon Sep 17 00:00:00 2001 From: austin Date: Mon, 14 Apr 2025 16:31:43 -0400 Subject: [PATCH] voxel type work --- assets/Data/game/voxelTypes.json | 6 ++-- docs/src/progress/renderertodo.md | 1 + .../game/data/voxel/VoxelData.java | 5 ++- .../game/data/voxel/VoxelType.java | 33 ++++++++++++++++--- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/assets/Data/game/voxelTypes.json b/assets/Data/game/voxelTypes.json index 1267e9aa..7827ce67 100644 --- a/assets/Data/game/voxelTypes.json +++ b/assets/Data/game/voxelTypes.json @@ -34,17 +34,17 @@ }, { "id" : 6, - "name" : "stone", + "name" : "rock_shale", "texture" : "/Textures/Ground/cliff1_256.png" }, { "id" : 7, - "name" : "rock", + "name" : "rock_gneiss", "texture" : "/Textures/Ground/rock2_256.png" }, { "id" : 8, - "name" : "rock", + "name" : "rock_slate", "texture" : "/Textures/Ground/rock3_256.png" } ] diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index c46becf0..6971d2f4 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1467,6 +1467,7 @@ Transparency support for component decorations Cloth sack model Pickaxe model More rock models +Voxel type work diff --git a/src/main/java/electrosphere/game/data/voxel/VoxelData.java b/src/main/java/electrosphere/game/data/voxel/VoxelData.java index d3fe8af2..f0ec70c9 100644 --- a/src/main/java/electrosphere/game/data/voxel/VoxelData.java +++ b/src/main/java/electrosphere/game/data/voxel/VoxelData.java @@ -6,7 +6,10 @@ import java.util.Set; * A list of all voxel types in game */ public class VoxelData { - //The set of all voxel types + + /** + * The set of all voxel types + */ Set types; /** diff --git a/src/main/java/electrosphere/game/data/voxel/VoxelType.java b/src/main/java/electrosphere/game/data/voxel/VoxelType.java index 58520c09..cb77056a 100644 --- a/src/main/java/electrosphere/game/data/voxel/VoxelType.java +++ b/src/main/java/electrosphere/game/data/voxel/VoxelType.java @@ -6,15 +6,32 @@ import java.util.List; * Data about a particular type of voxel */ public class VoxelType { - //the id of this voxel type + + /** + * the id of this voxel type + */ int id; - //the name of the type + + /** + * the name of the type + */ String name; - //any ambient foliage that can be placed on this voxel type + + /** + * any ambient foliage that can be placed on this voxel type + */ List ambientFoliage; - //the texture for the voxel type + + /** + * the texture for the voxel type + */ String texture; + /** + * The corresponding item + */ + String correspondingItem; + /** * Gets the id of the voxel type * @return The id @@ -46,4 +63,12 @@ public class VoxelType { public String getTexture(){ return texture; } + + /** + * Gets the corresponding item + * @return The corresponding item + */ + public String getCorrespondingItem(){ + return correspondingItem; + } }