From 2e67b44f7af73b9e2565afc56d9122f558edcb84 Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Fri, 3 Feb 2023 07:49:06 +0100 Subject: [PATCH] fixed massive amount of water errors (only 3 sussy error messages left) and now water can flow --- mods/amogus_blocks/init.lua | 205 ++++++++++++------ .../entities/amogus_entity.lua | 2 +- .../entities/mini_crewmate_entity.lua | 2 +- mods/amogus_generator/init.lua | 58 ++--- 4 files changed, 172 insertions(+), 95 deletions(-) diff --git a/mods/amogus_blocks/init.lua b/mods/amogus_blocks/init.lua index 156216f..8b706f3 100644 --- a/mods/amogus_blocks/init.lua +++ b/mods/amogus_blocks/init.lua @@ -190,72 +190,143 @@ minetest.register_node("amogus_blocks:wood", { groups = {choppy = 3, flammable = 3, wood = 1}, }) -minetest.register_node("amogus_blocks:water", { - description = "Water", + +-- OLD water. not flowing. throwing massive amounts of errors. + +--minetest.register_node("amogus_blocks:water", { +-- description = "Water", +-- drawtype = "liquid", +-- tiles = { +-- { +-- name = "water.png", +-- --animation = { +-- -- type = "vertical_frames", +-- -- aspect_w = 16, +-- -- aspect_h = 16, +-- -- length = 2.0, +-- --}, +-- }, +-- --{ +-- -- name = "water.png", +-- -- animation = { +-- -- type = "vertical_frames", +-- -- aspect_w = 16, +-- -- aspect_h = 16, +-- -- length = 2.0, +-- -- }, +-- --}, +-- }, +-- --special_tiles = { +-- -- -- New-style water source material (mostly unused) +-- -- { +-- -- name = "water.png", +-- -- backface_culling = false, +-- -- animation = { +-- -- type = "vertical_frames", +-- -- aspect_w = 16, +-- -- aspect_h = 16, +-- -- length = 2.0, +-- -- }, +-- -- }, +-- -- -- New-style flowing water material (mostly unused) +-- -- { +-- -- name = "water.png", +-- -- backface_culling = true, +-- -- animation = { +-- -- type = "vertical_frames", +-- -- aspect_w = 16, +-- -- aspect_h = 16, +-- -- length = 0.8, +-- -- }, +-- -- }, +-- --}, +-- alpha = 160, +-- paramtype = "light", +-- walkable = false, +-- pointable = false, +-- diggable = false, +-- --buildable_to = true, +-- drowning = 1, +-- liquidtype = "source", +-- --liquid_alternative_flowing = "amogus_blocks:water_flowing", +-- --liquid_alternative_source = "amogus_blocks:water_source", +-- liquid_viscosity = 1, +-- post_effect_color = {a = 103, r = 30, g = 60, b = 90}, +-- groups = {water = 3, liquid = 3, puts_out_fire = 1}, +--}) + +minetest.register_node("amogus_blocks:water_source", { + description = "Water Source", drawtype = "liquid", + waving = 3, + tiles = { { name = "water.png", - --animation = { - -- type = "vertical_frames", - -- aspect_w = 16, - -- aspect_h = 16, - -- length = 2.0, - --}, + backface_culling = false, + }, + { + name = "water.png", + backface_culling = true, }, - --{ - -- name = "water.png", - -- animation = { - -- type = "vertical_frames", - -- aspect_w = 16, - -- aspect_h = 16, - -- length = 2.0, - -- }, - --}, }, - --special_tiles = { - -- -- New-style water source material (mostly unused) - -- { - -- name = "water.png", - -- backface_culling = false, - -- animation = { - -- type = "vertical_frames", - -- aspect_w = 16, - -- aspect_h = 16, - -- length = 2.0, - -- }, - -- }, - -- -- New-style flowing water material (mostly unused) - -- { - -- name = "water.png", - -- backface_culling = true, - -- animation = { - -- type = "vertical_frames", - -- aspect_w = 16, - -- aspect_h = 16, - -- length = 0.8, - -- }, - -- }, - --}, - alpha = 160, + + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, diggable = false, - --buildable_to = true, + buildable_to = true, + is_ground_content = false, + drop = "", drowning = 1, liquidtype = "source", - --liquid_alternative_flowing = "amogus_blocks:water_flowing", - --liquid_alternative_source = "amogus_blocks:water_source", + liquid_alternative_flowing = "amogus_blocks:water_flowing", + liquid_alternative_source = "amogus_blocks:water_source", liquid_viscosity = 1, post_effect_color = {a = 103, r = 30, g = 60, b = 90}, - groups = {water = 3, liquid = 3, puts_out_fire = 1}, + groups = {water = 3, liquid = 3, cools_lava = 1} +}) + +minetest.register_node("amogus_blocks:water_flowing", { + description = "Flowing Water", + drawtype = "flowingliquid", + waving = 3, + + tiles = {"water.png"}, + special_tiles = { + { + name = "water.png", + backface_culling = false, + }, + { + name = "water.png", + backface_culling = true, + }, + }, + + use_texture_alpha = "blend", + paramtype = "light", + paramtype2 = "flowingliquid", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "flowing", + liquid_alternative_flowing = "amogus_blocks:water_flowing", + liquid_alternative_source = "amogus_blocks:water_source", + liquid_viscosity = 1, + post_effect_color = {a = 103, r = 30, g = 60, b = 90}, + groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, cools_lava = 1} }) minetest.register_node("amogus_blocks:dirt", { description = "Dirt", tiles = {"d.png"}, - groups = {crumbly = 3}, + groups = {crumbly = 3}, drop = { max_items = 2, @@ -414,12 +485,12 @@ minetest.register_node("amogus_blocks:grass_tall", { groups = {snappy=3,flammable=2,flower=1}, --sounds = default.node_sound_leaves_defaults(), selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - }) - minetest.register_node("amogus_blocks:purple_grass_tall", { +}) +minetest.register_node("amogus_blocks:purple_grass_tall", { description = "Grass plant", drawtype = "plantlike", tiles = {"purple_grass_tall.png"}, @@ -431,11 +502,11 @@ minetest.register_node("amogus_blocks:grass_tall", { groups = {snappy=3,flammable=2,flower=1}, --sounds = default.node_sound_leaves_defaults(), selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - }) - minetest.register_node("amogus_blocks:amogflower", { +}) +minetest.register_node("amogus_blocks:amogflower", { description = "amogus flower", drawtype = "plantlike", tiles = {"amog_flower.png"}, @@ -448,11 +519,11 @@ minetest.register_node("amogus_blocks:grass_tall", { groups = {snappy=3,flammable=2,flower=1}, --sounds = default.node_sound_leaves_defaults(), selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - }) - minetest.register_node("amogus_blocks:redflower", { +}) +minetest.register_node("amogus_blocks:redflower", { description = "red flower", drawtype = "plantlike", tiles = {"flower.png"}, @@ -464,11 +535,11 @@ minetest.register_node("amogus_blocks:grass_tall", { groups = {snappy=3,flammable=2,flower=1}, --sounds = default.node_sound_leaves_defaults(), selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - }) - minetest.register_node("amogus_blocks:yellowflower", { +}) +minetest.register_node("amogus_blocks:yellowflower", { description = "yellow flower", drawtype = "plantlike", tiles = {"flower_2.png"}, @@ -480,12 +551,12 @@ minetest.register_node("amogus_blocks:grass_tall", { groups = {snappy=3,flammable=2,flower=1}, --sounds = default.node_sound_leaves_defaults(), selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, }, - }) +}) + - minetest.register_node("amogus_blocks:obsusian", { description = "obSUSian", tiles = {"obsusian.png"}, diff --git a/mods/amogus_entities/entities/amogus_entity.lua b/mods/amogus_entities/entities/amogus_entity.lua index 68d5011..4f47e95 100644 --- a/mods/amogus_entities/entities/amogus_entity.lua +++ b/mods/amogus_entities/entities/amogus_entity.lua @@ -119,7 +119,7 @@ local entity = { pos.z = pos.z + dir_sin local bnode = minetest.get_node(pos) - if bnode.name == "air" or bnode.name == "amogus_blocks:water" then + if bnode.name == "air" or bnode.name == "amogus_blocks:water_source" or bnode.name == "amogus_blocks:water_flowing" then self.block_lastly_in_front = false else if self.block_lastly_in_front == false then diff --git a/mods/amogus_entities/entities/mini_crewmate_entity.lua b/mods/amogus_entities/entities/mini_crewmate_entity.lua index ae3c163..147af39 100644 --- a/mods/amogus_entities/entities/mini_crewmate_entity.lua +++ b/mods/amogus_entities/entities/mini_crewmate_entity.lua @@ -281,7 +281,7 @@ local entity = { pos.z = pos.z + dir_sin local bnode = minetest.get_node(pos) - if bnode.name == "air" or bnode.name == "amogus_blocks:water" then + if bnode.name == "air" or bnode.name == "amogus_blocks:water_source" or bnode.name == "amogus_blocks:water_flowing" then self.block_lastly_in_front = false else if self.block_lastly_in_front == false then diff --git a/mods/amogus_generator/init.lua b/mods/amogus_generator/init.lua index 6acfcba..b2540ae 100644 --- a/mods/amogus_generator/init.lua +++ b/mods/amogus_generator/init.lua @@ -1,7 +1,8 @@ minetest.register_alias("mapgen_stone", "amogus_blocks:stone") minetest.register_alias("mapgen_dirt", "amogus_blocks:dirt") -minetest.register_alias("mapgen_water_source", "amogus_blocks:water") +minetest.register_alias("mapgen_water_source", "amogus_blocks:water_source") + minetest.register_biome({ name = "amogus_beach", node_top = "amogus_blocks:sand", @@ -9,10 +10,12 @@ minetest.register_biome({ node_filler = "amogus_blocks:sand", depth_filler = 3, node_stone = "amogus_blocks:stone", - node_water_top = "amogus_blocks:water", - depth_water_top = 1, - node_water = "amogus_blocks:water", - node_river_water = "amogus_blocks:water", + + --node_water_top = "amogus_blocks:water", + --depth_water_top = 1, + node_water = "amogus_blocks:amogus_blocks:water_source", + --node_river_water = "amogus_blocks:water", + y_max = 6, y_min = -5, heat_point = 50, @@ -26,10 +29,12 @@ minetest.register_biome({ node_filler = "amogus_blocks:dirt", depth_filler = 1, node_stone = "amogus_blocks:stone", - node_water_top = "amogus_blocks:water", - depth_water_top = 1, - node_water = "amogus_blocks:water", - node_river_water = "amogus_blocks:water", + + --node_water_top = "amogus_blocks:water", + --depth_water_top = 1, + node_water = "amogus_blocks:amogus_blocks:water_source", + --node_river_water = "amogus_blocks:water", + y_max = 31000, y_min = 1, heat_point = 100, @@ -43,10 +48,12 @@ minetest.register_biome({ node_filler = "amogus_blocks:dirt", depth_filler = 1, node_stone = "amogus_blocks:stone", - node_water_top = "amogus_blocks:water", - depth_water_top = 1, - node_water = "amogus_blocks:water", - node_river_water = "amogus_blocks:water", + + --node_water_top = "amogus_blocks:water", + --depth_water_top = 1, + node_water = "amogus_blocks:amogus_blocks:water_source", + --node_river_water = "amogus_blocks:water", + y_max = 31000, y_min = 1, heat_point = 50, @@ -514,16 +521,15 @@ minetest.register_decoration({ schematic = "/schematics/STATUE_GIANT.mts", }) -minetest.register_on_generated(function(minp, maxp, seed) - for x = minp.x, maxp.x do - for y = minp.y, maxp.y do - for z = minp.z, maxp.z do - local p = {x=x, y=y, z=z} - if minetest.get_node(p).name == "default:water_source" then - minetest.set_node(p, {name="default:water_source", param2=0}) - end - end - end - end - end) - \ No newline at end of file +--minetest.register_on_generated(function(minp, maxp, seed) +-- for x = minp.x, maxp.x do +-- for y = minp.y, maxp.y do +-- for z = minp.z, maxp.z do +-- local p = {x=x, y=y, z=z} +-- if minetest.get_node(p).name == "default:water_source" then +-- minetest.set_node(p, {name="default:water_source", param2=0}) +-- end +-- end +-- end +-- end +-- end) \ No newline at end of file