From: Elias Fleckenstein Date: Mon, 14 Dec 2020 16:23:44 +0000 (+0100) Subject: Added Seasons X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=db105bfe4c1ea296f88e1004f3f4ba7f7e7d91c8;p=Crafter.git Added Seasons --- diff --git a/README.md b/README.md index 12dd70e..f8110de 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -> Designed for Minetest 5.3.0-DEV +> Designed for Minetest 5.3.0 >Built using textures from Mineclone 2 @@ -35,6 +35,8 @@ max_packets_per_iteration = 10096 ## Alpha 0.07 > RailRoad Tech +- Seasons +- Better 3rd persion visuals - Warning when clientmod is not installed - Bucket sounds - Inventory improvements diff --git a/mods/farming/depends.txt b/mods/farming/depends.txt new file mode 100644 index 0000000..d162441 --- /dev/null +++ b/mods/farming/depends.txt @@ -0,0 +1,2 @@ +season +main diff --git a/mods/farming/registers.lua b/mods/farming/registers.lua index 7146d0f..efc4ec2 100644 --- a/mods/farming/registers.lua +++ b/mods/farming/registers.lua @@ -81,7 +81,7 @@ minetest.register_plant("grass", { climbable = false, paramtype = "light", is_ground_content = false, - tiles = {"tallgrass.png"}, + tiles = {season.pick("tallgrass_spring.png", "tallgrass.png", "tallgrass_autumn.png", "tallgrass_winter.png")}, paramtype2 = "degrotate", buildable_to = true, sunlight_propagates = true, diff --git a/mods/farming/textures/tallgrass_autumn.png b/mods/farming/textures/tallgrass_autumn.png new file mode 100644 index 0000000..77202ee Binary files /dev/null and b/mods/farming/textures/tallgrass_autumn.png differ diff --git a/mods/farming/textures/tallgrass_spring.png b/mods/farming/textures/tallgrass_spring.png new file mode 100644 index 0000000..0afd0af Binary files /dev/null and b/mods/farming/textures/tallgrass_spring.png differ diff --git a/mods/farming/textures/tallgrass_winter.png b/mods/farming/textures/tallgrass_winter.png new file mode 100644 index 0000000..0b79d03 Binary files /dev/null and b/mods/farming/textures/tallgrass_winter.png differ diff --git a/mods/main/depends.txt b/mods/main/depends.txt index f2c5b26..1c59a89 100644 --- a/mods/main/depends.txt +++ b/mods/main/depends.txt @@ -1 +1,2 @@ -hunger \ No newline at end of file +hunger +season diff --git a/mods/main/nodes.lua b/mods/main/nodes.lua index 05af3bc..d44cde8 100644 --- a/mods/main/nodes.lua +++ b/mods/main/nodes.lua @@ -220,7 +220,7 @@ minetest.register_node("main:dirt", { minetest.register_node("main:grass", { description = "Grass", - tiles = {"grass.png"}, + tiles = season.pick({"grass_spring.png", "grass.png"}, {"grass.png"}, {"leaves_ground.png"}, {"snow.png"}), groups = {grass = 1, soil=1,pathable = 1, farm_tillable=1}, sounds = main.dirtSound(), drop="main:dirt", @@ -364,7 +364,7 @@ minetest.register_node("main:leaves", { climbable = true, paramtype = "light", is_ground_content = false, - tiles = {"leaves.png"}, + tiles = {season.pick("leaves_spring.png", "leaves.png", "leaves_dry.png", "branches.png")}, groups = {leaves = 1, leafdecay = 1,flammable=1}, sounds = main.grassSound(), drop = { diff --git a/mods/main/textures/Untitled.png b/mods/main/textures/Untitled.png new file mode 100644 index 0000000..a851d7e Binary files /dev/null and b/mods/main/textures/Untitled.png differ diff --git a/mods/main/textures/branches.png b/mods/main/textures/branches.png new file mode 100644 index 0000000..49c01f3 Binary files /dev/null and b/mods/main/textures/branches.png differ diff --git a/mods/main/textures/grass_spring.png b/mods/main/textures/grass_spring.png new file mode 100644 index 0000000..f82532f Binary files /dev/null and b/mods/main/textures/grass_spring.png differ diff --git a/mods/main/textures/leaves_dry.png b/mods/main/textures/leaves_dry.png new file mode 100644 index 0000000..58d1d34 Binary files /dev/null and b/mods/main/textures/leaves_dry.png differ diff --git a/mods/main/textures/leaves_ground.png b/mods/main/textures/leaves_ground.png new file mode 100644 index 0000000..777f236 Binary files /dev/null and b/mods/main/textures/leaves_ground.png differ diff --git a/mods/main/textures/leaves_spring.png b/mods/main/textures/leaves_spring.png new file mode 100644 index 0000000..42b5858 Binary files /dev/null and b/mods/main/textures/leaves_spring.png differ diff --git a/mods/main/textures/snow.png b/mods/main/textures/snow.png new file mode 100644 index 0000000..81526cb Binary files /dev/null and b/mods/main/textures/snow.png differ diff --git a/mods/player_api/init.lua b/mods/player_api/init.lua index 3632ef0..432d20a 100644 --- a/mods/player_api/init.lua +++ b/mods/player_api/init.lua @@ -422,7 +422,7 @@ local set_item = function(self, item) itemname = stack:is_known() and stack:get_name() or "unknown" def = minetest.registered_nodes[itemname] - tooldef = minetest.registered_tools[itemname] + local tooldef = minetest.registered_tools[itemname] self.object:set_properties({ textures = {itemname}, diff --git a/mods/season/init.lua b/mods/season/init.lua index d39831c..e420e9a 100644 --- a/mods/season/init.lua +++ b/mods/season/init.lua @@ -1,11 +1,26 @@ -local dayofyear = os.date("*t").yday +season = {} -if dayofyear >= 79 and dayofyear < 172 then - season = "spring" -elseif dayofyear < 266 then - season = "summer" -elseif dayofyear < 355 then - season = "autumn" -else - season = "winter" +season.which = minetest.settings:get("season") or "reallife" + +if season.which == "reallife" then + local dayofyear = os.date("*t").yday + if dayofyear >= 79 and dayofyear < 172 then + season.which = "spring" + elseif dayofyear < 266 then + season.which = "summer" + elseif dayofyear < 355 then + season.which = "autumn" + else + season.which = "winter" + end +end + +function season.pick(spring, summer, autumn, winter) + local t = { + spring = spring, + summer = summer, + autumn = autumn, + winter = winter + } + return t[season.which] end diff --git a/mods/weather/init.lua b/mods/weather/init.lua index 24a8ad8..27f8a67 100644 --- a/mods/weather/init.lua +++ b/mods/weather/init.lua @@ -417,7 +417,7 @@ end minetest.register_node("weather:snow", { description = "Snow", - tiles = {"snow_block.png"}, + tiles = {"snow.png"}, groups = {pathable = 1,snow = 1, falling_node=1}, sounds = main.woolSound(), paramtype = "light", @@ -456,7 +456,7 @@ minetest.register_node("weather:snow", { minetest.register_node("weather:snow_block", { description = "Snow", - tiles = {"snow_block.png"}, + tiles = {"snow.png"}, groups = {pathable = 1,snow = 1}, sounds = main.woolSound(), drop = { diff --git a/mods/weather/textures/snow_block.png b/mods/weather/textures/snow_block.png deleted file mode 100644 index 81526cb..0000000 Binary files a/mods/weather/textures/snow_block.png and /dev/null differ diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..74cbfc3 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,2 @@ +# The season to be used ingame (only affects audiovisuals). If set to reallife the season will be set to the real life season when the server starts. Set to summer to disable season effects. +season (Season) enum reallife reallife,spring,summer,autumn,winter diff --git a/todo.txt b/todo.txt index a0050d4..94aaadc 100644 --- a/todo.txt +++ b/todo.txt @@ -1,11 +1,9 @@ +- Music depending on season - Equip armor with rightclick - Shift-click fuel into furnace - Throwing eggs - Rebalancing of ore generation probabilities and tool speeds - More sophisticated particle effects -- Season effects (only affecting audiovisuals like textures and music) - Add two new biomes, each with individual trees, exclusive mobs and structures and a boss fight -- Fix creative inventory to not overstack items - Add Oil -- Add Redstone Breaker - Rework enchanting system