From 343ff7074311ca71a9dcd34fdf157ff49a0b546c Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Thu, 3 Jan 2019 21:14:47 -0500 Subject: [PATCH] Added id_wheat_0 to id_wheat_7 --- src/inc/block.hpp | 91 ++++++++++++++++++++++++++++++++++++++++++++--- src/inc/face.hpp | 18 +++++++++- src/inc/image.hpp | 16 +++++++++ 3 files changed, 120 insertions(+), 5 deletions(-) diff --git a/src/inc/block.hpp b/src/inc/block.hpp index 8ba3776..4896974 100644 --- a/src/inc/block.hpp +++ b/src/inc/block.hpp @@ -143,6 +143,22 @@ enum block_id id_wet_farmland, + id_wheat_0, + + id_wheat_1, + + id_wheat_2, + + id_wheat_3, + + id_wheat_4, + + id_wheat_5, + + id_wheat_6, + + id_wheat_7, + id_null }; @@ -286,7 +302,23 @@ std::vector block_id_to_string = "dry_farmland", - "wet_farmland" + "wet_farmland", + + "wheat_0", + + "wheat_1", + + "wheat_2", + + "wheat_3", + + "wheat_4", + + "wheat_5", + + "wheat_6", + + "wheat_7" }; // Conversion from block_id to std::string (used for in-game text). @@ -429,7 +461,23 @@ std::vector block_id_to_block_name = "Dry Farmland", - "Wet Farmland" + "Wet Farmland", + + "Wheat", + + "Wheat", + + "Wheat", + + "Wheat", + + "Wheat", + + "Wheat", + + "Wheat", + + "Wheat" }; // Returns true if a block is a cross block. Otherwise, returns false. @@ -455,6 +503,35 @@ inline bool is_cross(block_id id) return false; } +// Returns true if a block is a crop block. Otherwise, returns false. + +inline bool is_crop(block_id id) +{ + if + ( + id == id_wheat_0 || + + id == id_wheat_1 || + + id == id_wheat_2 || + + id == id_wheat_3 || + + id == id_wheat_4 || + + id == id_wheat_5 || + + id == id_wheat_6 || + + id == id_wheat_7 + ) + { + return true; + } + + return false; +} + // Returns true if a block is a slab. Otherwise, returns false. inline bool is_slab(block_id id) @@ -500,6 +577,8 @@ inline bool is_transparent(block_id id) is_cross(id) || + is_crop(id) || + is_slab(id) ) { @@ -521,7 +600,9 @@ inline bool is_not_permeable_mob(block_id id) id == id_null || - is_cross(id) + is_cross(id) || + + is_crop(id) ) { return false; @@ -559,7 +640,9 @@ inline bool is_not_permeable_light(block_id id) id == id_glass || - is_cross(id) + is_cross(id) || + + is_crop(id) ) { return false; diff --git a/src/inc/face.hpp b/src/inc/face.hpp index b26d70f..88e7be3 100644 --- a/src/inc/face.hpp +++ b/src/inc/face.hpp @@ -229,6 +229,22 @@ void load_block_face_info_array() make_face_info_cap(block_name_to_layer.at("farmland_dry"), block_name_to_layer.at("dirt")), - make_face_info_cap(block_name_to_layer.at("farmland_wet"), block_name_to_layer.at("dirt")) + make_face_info_cap(block_name_to_layer.at("farmland_wet"), block_name_to_layer.at("dirt")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_0")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_1")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_2")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_3")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_4")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_5")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_6")), + + make_face_info_all(block_name_to_layer.at("wheat_stage_7")) }; } \ No newline at end of file diff --git a/src/inc/image.hpp b/src/inc/image.hpp index d98bf15..4fd1c23 100644 --- a/src/inc/image.hpp +++ b/src/inc/image.hpp @@ -179,6 +179,22 @@ std::vector all_tex = "water_31", + "wheat_stage_0", + + "wheat_stage_1", + + "wheat_stage_2", + + "wheat_stage_3", + + "wheat_stage_4", + + "wheat_stage_5", + + "wheat_stage_6", + + "wheat_stage_7", + "wool_colored_black", "wool_colored_blue",