Compare commits
181 Commits
fix-spawne
...
master
Author | SHA1 | Date |
---|---|---|
FossFanatic | d83c6fe906 | |
FossFanatic | e7c6043f06 | |
FossFanatic | 65b1fd163b | |
FossFanatic | eff0a546e5 | |
FossFanatic | 61ee14b1a6 | |
FossFanatic | 968f6ae963 | |
FossFanatic | 2e2bbf0b17 | |
FossFanatic | 8060b02cbd | |
FossFanatic | 693d40b6c4 | |
FossFanatic | ecfbb1ae07 | |
FossFanatic | 14e630a1e2 | |
FossFanatic | 62afbb4509 | |
FossFanatic | f02764bc08 | |
FossFanatic | aa1a928898 | |
FossFanatic | 45952a6fd6 | |
FossFanatic | 33bbeb1a4d | |
FossFanatic | d3253ecf4f | |
FossFanatic | 0abda8ff20 | |
FossFanatic | 9bb3d8311b | |
FossFanatic | 686bb38546 | |
FossFanatic | c4f6944a03 | |
FossFanatic | c1647a5cce | |
FossFanatic | 624c853cb3 | |
ancientmarinerdev | e8641c3c20 | |
GuyLiner | f39cec2442 | |
GuyLiner | e99a46b52d | |
GuyLiner | cd1c8bd92e | |
GuyLiner | 3830171347 | |
GuyLiner | 48b16a23b6 | |
GuyLiner | 0a9be4b79c | |
GuyLiner | 540319d948 | |
GuyLiner | fbb2923a0b | |
ancientmarinerdev | b2e0b9b08b | |
ancientmarinerdev | 4d61e32021 | |
ancientmarinerdev | 7c602ce82c | |
ancientmarinerdev | ae92c51155 | |
ancientmarinerdev | db7f4699eb | |
ancientmarinerdev | b23fc6d23d | |
FossFanatic | 68e6965dd0 | |
FossFanatic | 7d642c9929 | |
FossFanatic | 406b27852b | |
ancientmarinerdev | d00f183456 | |
emptyshore | b121d0f804 | |
FossFanatic | 8f8385e4a1 | |
FossFanatic | 17fc7a3256 | |
ancientmarinerdev | c08153fa7f | |
ancientmarinerdev | ba708010a2 | |
Michieal | 6601ecf788 | |
Michieal | 660c85dddc | |
Michieal | 2d0b4dd8f7 | |
FossFanatic | 10d9eb2980 | |
FossFanatic | 3d9df5c797 | |
Michieal | 8cc90b6714 | |
ancientmarinerdev | db4ff13aeb | |
FossFanatic | f919f73c24 | |
FossFanatic | 319beb91ce | |
FossFanatic | bea9bbe212 | |
FossFanatic | 8fd40eaf46 | |
FossFanatic | fcaa2c4ce1 | |
FossFanatic | 55478f6953 | |
FossFanatic | 57882ae56a | |
FossFanatic | fee4ccf096 | |
FossFanatic | f653f47f26 | |
FossFanatic | 7b7e213925 | |
ancientmarinerdev | cf829b6481 | |
PrairieWind | f62546a54f | |
ancientmarinerdev | 7b6d946d7b | |
PrairieWind | 1da272a941 | |
PrairieWind | e3f14a3a99 | |
ancientmarinerdev | a9a61a034c | |
ancientmarinerdev | 6f98ba5118 | |
ancientmarinerdev | f6f812257e | |
Michieal | f05e976d18 | |
Michieal | 5533ec7bac | |
Michieal | b66e2a117f | |
Michieal | 09ef5fd96b | |
Michieal | 1e61fc3069 | |
Michieal | ef30646788 | |
Michieal | 70e4aaa3a7 | |
Michieal | 8bfa55fa7a | |
Michieal | 2ba6a60e55 | |
FossFanatic | aeddb7675f | |
FossFanatic | 2ccfd89379 | |
FossFanatic | 3a24903a01 | |
FossFanatic | abdd5e11c0 | |
FossFanatic | e17fab385b | |
FossFanatic | 17cae6896e | |
FossFanatic | 1c84bc6572 | |
FossFanatic | 4d29fab932 | |
FossFanatic | a2087b19a5 | |
PrairieWind | 84119d8f34 | |
PrairieWind | 5da6c25ccf | |
PrairieWind | b79f74c390 | |
PrairieWind | 06f47a0756 | |
PrairieWind | ff79af26e4 | |
ancientmarinerdev | de56c72e15 | |
ancientmarinerdev | e3c8d995b5 | |
ancientmarinerdev | b8b45210e9 | |
ancientmarinerdev | a1f10205f6 | |
ancientmarinerdev | 6f7505b6c6 | |
PrairieWind | e323ab6e88 | |
FossFanatic | c88f0047c1 | |
FossFanatic | 0400d9a2a5 | |
FossFanatic | 3590ff6dfb | |
FossFanatic | d1ceacf7ba | |
FossFanatic | a70a6ef13d | |
FossFanatic | b4e84dadb0 | |
PrairieWind | 194ff53400 | |
ancientmarinerdev | e7e0b082c4 | |
FossFanatic | 18b888da8b | |
ancientmarinerdev | 15a15158b8 | |
ancientmarinerdev | 9445e10834 | |
ancientmarinerdev | 35a75491f4 | |
FossFanatic | 81dbdaab94 | |
ancientmarinerdev | 2fd7f8c69f | |
ancientmarinerdev | 6a34a30941 | |
ancientmarinerdev | d4c2802afb | |
ancientmarinerdev | b2dbf48e92 | |
ancientmarinerdev | bf50a17f2e | |
ancientmarinerdev | b817c079ba | |
ancientmarinerdev | cfa276f722 | |
ancientmarinerdev | 86b1d8bc3e | |
ancientmarinerdev | 9c2f43a242 | |
ancientmarinerdev | 044a91e831 | |
ancientmarinerdev | 106979e64a | |
ancientmarinerdev | 4482068211 | |
ancientmarinerdev | 1dc7cab6be | |
ancientmarinerdev | 634379dfe9 | |
ancientmarinerdev | c2ac33ac61 | |
ancientmarinerdev | b5c0830060 | |
ancientmarinerdev | c43c723e08 | |
ancientmarinerdev | bd3a4ff0df | |
ancientmarinerdev | 0267ad2f31 | |
ancientmarinerdev | a2f9ea81cc | |
ancientmarinerdev | 7c7f4b930c | |
ancientmarinerdev | 60529d3d5d | |
ancientmarinerdev | 6ea4b43249 | |
FossFanatic | 1fb300ef18 | |
FossFanatic | b789845f62 | |
FossFanatic | f368fb3e43 | |
FossFanatic | d63ecac7cb | |
FossFanatic | 7fbc84971e | |
FossFanatic | 953044cc4b | |
FossFanatic | 6744967d02 | |
FossFanatic | fdb2333493 | |
FossFanatic | 1defd03408 | |
FossFanatic | d163faeb42 | |
FossFanatic | 197d3ae00b | |
ancientmarinerdev | 6b8226dae3 | |
Michieal | f6b77aa458 | |
Michieal | 1558c852d8 | |
Michieal | 6c0525f00e | |
ancientmarinerdev | 3c13ce1d6b | |
ancientmarinerdev | c1d5d4280e | |
PrairieWind | 70fb4f8a0d | |
ancientmarinerdev | 620a0af483 | |
ancientmarinerdev | 428b1b2c12 | |
FossFanatic | 4ddab8bdf1 | |
FossFanatic | bfe4b2fd31 | |
FossFanatic | cc8675602a | |
FossFanatic | aff1d5f667 | |
FossFanatic | 169019096e | |
FossFanatic | 049db13b28 | |
SmokeyDope | dfbee5cb93 | |
SmokeyDope | 378af531a9 | |
ancientmarinerdev | 088cda4f1c | |
SmokeyDope | 71671f8b5f | |
SmokeyDope | c4d60e50cc | |
ancientmarinerdev | 9421c7ca6b | |
FossFanatic | d9982e20d2 | |
FossFanatic | 4757e62968 | |
FossFanatic | b95ebb3fca | |
FossFanatic | 07f332f0cd | |
FossFanatic | f4e8088e60 | |
FossFanatic | 198375a18e | |
FossFanatic | c26cddeafc | |
FossFanatic | 714d159072 | |
emptyshore | bdc82b76b5 | |
Michieal | 0e000e6491 | |
Michieal | ec7a97ba3e | |
Michieal | de00b7228e |
1
API.md
|
@ -41,6 +41,7 @@ A lot of things are possible by using one of the APIs in the mods. Note that not
|
|||
* Beds: `ITEMS/mcl_beds`
|
||||
* Buckets: `ITEMS/mcl_buckets`
|
||||
* Dispenser support: `ITEMS/REDSTONE/mcl_dispensers`
|
||||
* Campfires: `ITEMS/mcl_campfires`
|
||||
|
||||
### Mobs
|
||||
* Mobs: `ENTITIES/mcl_mobs`
|
||||
|
|
53
RELEASE.md
|
@ -1,3 +1,5 @@
|
|||
### Standard Release
|
||||
|
||||
#File to document release steps with a view to evolving into a script
|
||||
|
||||
#Update CREDITS.md
|
||||
|
@ -20,3 +22,54 @@ git push origin 0.82.0
|
|||
#Update version in game.conf to -SNAPSHOT
|
||||
|
||||
git commit -m "Post-release set version 0.82.0-SNAPSHOT"
|
||||
|
||||
### Hotfix Release
|
||||
|
||||
##### Prepare release branch
|
||||
|
||||
When hotfixing, you should never release new features. Any new code increases risk of new bugs which has additional testing/release concerns.
|
||||
To mitigate this, you just release the last release, and the relevant bug fix. For this, we do the following:
|
||||
|
||||
* Create release branch from the last release tag, push it:
|
||||
|
||||
git checkout -b release/0.82.1 0.82.0
|
||||
|
||||
git push origin release/0.82.1
|
||||
|
||||
##### Prepare feature branch and fix
|
||||
|
||||
* Create feature branch from that release branch (can review it to check only fix is there, nothing else, and use to also merge into master separately)
|
||||
|
||||
git checkout -b hotfix_bug_1_branch
|
||||
|
||||
* Fix crash/serious bug and commit
|
||||
* Push branch and create pr to the release and also the master branch (Do not rebase, to reduce merge conflict risk. Do not delete after first merge or it needs to be repushed)
|
||||
|
||||
##### Update version and tag the release
|
||||
|
||||
* After all fixes are in release branch, pull it locally (best to avoid a merge conflict as feature branch will need to be merged into master also, which already changed version):
|
||||
|
||||
* Update version in game.conf to hotfix version and commit it. Example: version=0.82.1
|
||||
|
||||
* Tag it, push tag and branch:
|
||||
|
||||
git tag 0.82.1
|
||||
|
||||
git push origin 0.82.1
|
||||
|
||||
git push origin release/0.82.1
|
||||
|
||||
Note: If you have to do more than 1 hotfix release, can do it on the same release branch.
|
||||
|
||||
### Release via ContentDB
|
||||
|
||||
* Go to MineClone2 page (https://content.minetest.net/packages/Wuzzy/mineclone2/)
|
||||
* Click +Release
|
||||
* Enter the release tag number in the title and Git reference box. For example (without quotes): "0.82.1"
|
||||
* In the minimum minetest version, put the oldest supported version (as of 14/02/2023 it is 5.5), leave the Maximum minetest version blank
|
||||
* Click save. Release is now live.
|
||||
|
||||
##### Inform people
|
||||
|
||||
* Add a comment to the forum post with the release number and what is involved, and maintainer will update main post.
|
||||
* Add a comment in Discord announcement
|
BIN
menu/footer.png
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -556,6 +556,11 @@ function mcl_util.deal_damage(target, damage, mcl_reason)
|
|||
end
|
||||
end
|
||||
|
||||
local is_immortal = target:get_armor_groups().immortal or 0
|
||||
if is_immortal>0 then
|
||||
return
|
||||
end
|
||||
|
||||
local hp = target:get_hp()
|
||||
|
||||
if hp > 0 then
|
||||
|
@ -1011,3 +1016,20 @@ function mcl_util.check_position_protection(position, player)
|
|||
|
||||
return false
|
||||
end
|
||||
|
||||
local palette_indexes = {grass_palette_index = 0, foliage_palette_index = 0, water_palette_index = 0}
|
||||
function mcl_util.get_palette_indexes_from_pos(pos)
|
||||
local biome_data = minetest.get_biome_data(pos)
|
||||
local biome = biome_data.biome
|
||||
local biome_name = minetest.get_biome_name(biome)
|
||||
local reg_biome = minetest.registered_biomes[biome_name]
|
||||
if reg_biome and reg_biome._mcl_grass_palette_index and reg_biome._mcl_foliage_palette_index and reg_biome._mcl_water_palette_index then
|
||||
local gpi = reg_biome._mcl_grass_palette_index
|
||||
local fpi = reg_biome._mcl_foliage_palette_index
|
||||
local wpi = reg_biome._mcl_water_palette_index
|
||||
local palette_indexes = {grass_palette_index = gpi, foliage_palette_index = fpi, water_palette_index = wpi}
|
||||
return palette_indexes
|
||||
else
|
||||
return palette_indexes
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
|
||||
-- Template rail function
|
||||
local function register_rail(itemstring, tiles, def_extras, creative)
|
||||
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=minetest.raillike_group("rail"),dig_by_water=1,destroy_by_lava_flow=1, transport=1}
|
||||
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=minetest.raillike_group("rail"),dig_by_water=0,destroy_by_lava_flow=0, transport=1}
|
||||
if creative == false then
|
||||
groups.not_in_creative_inventory = 1
|
||||
end
|
||||
|
|
|
@ -4,6 +4,7 @@ local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
|
|||
-- API for Mobs Redo: MineClone 2 Edition (MRM)
|
||||
|
||||
local PATHFINDING = "gowp"
|
||||
local CRASH_WARN_FREQUENCY = 60
|
||||
|
||||
-- Localize
|
||||
local S = minetest.get_translator("mcl_mobs")
|
||||
|
@ -135,8 +136,8 @@ function mob_class:mob_activate(staticdata, def, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
if not self.base_texture then
|
||||
|
||||
--If textures in definition change, reload textures
|
||||
if not self.base_texture or (def.textures and table.indexof(def.textures, self.base_texture) == -1) then
|
||||
-- compatiblity with old simple mobs textures
|
||||
if type(def.textures[1]) == "string" then
|
||||
def.textures = {def.textures}
|
||||
|
@ -317,7 +318,7 @@ local function update_timers (self, dtime)
|
|||
return true
|
||||
end
|
||||
|
||||
-- attack timer
|
||||
-- attack timer. Not anymore, it seems. Used for also occassionally processing mob step too!
|
||||
self.timer = self.timer + dtime
|
||||
|
||||
if self.state ~= "attack" and self.state ~= PATHFINDING then
|
||||
|
@ -357,8 +358,7 @@ function mob_class:outside_limits()
|
|||
end
|
||||
end
|
||||
|
||||
-- main mob function
|
||||
function mob_class:on_step(dtime)
|
||||
local function on_step_work (self, dtime)
|
||||
local pos = self.object:get_pos()
|
||||
if not pos then return end
|
||||
|
||||
|
@ -392,7 +392,6 @@ function mob_class:on_step(dtime)
|
|||
self:check_water_flow()
|
||||
self:env_danger_movement_checks (dtime)
|
||||
|
||||
|
||||
self:follow_flop() -- Mob following code.
|
||||
|
||||
self:set_animation_speed() -- set animation speed relative to velocity
|
||||
|
@ -408,20 +407,25 @@ function mob_class:on_step(dtime)
|
|||
self:npc_attack()
|
||||
self:check_aggro(dtime)
|
||||
|
||||
if self.do_custom and self.do_custom(self, dtime) == false then return end
|
||||
|
||||
|
||||
-- In certain circumstances, we abandon processing of certain functionality
|
||||
local skip_processing = false
|
||||
if update_timers(self, dtime) then
|
||||
skip_processing = true
|
||||
end
|
||||
|
||||
|
||||
|
||||
if not skip_processing then
|
||||
self:check_breeding()
|
||||
|
||||
self:check_item_pickup()
|
||||
self:set_armor_texture()
|
||||
|
||||
if self.do_custom and self.do_custom(self, dtime) == false then return end
|
||||
|
||||
if update_timers(self, dtime) then return end
|
||||
|
||||
self:check_particlespawners(dtime)
|
||||
|
||||
if self:env_damage (dtime, pos) then return end
|
||||
if self:do_states(dtime) then return end
|
||||
|
||||
if self.opinion_sound_cooloff > 0 then
|
||||
self.opinion_sound_cooloff = self.opinion_sound_cooloff - dtime
|
||||
end
|
||||
|
@ -431,6 +435,9 @@ function mob_class:on_step(dtime)
|
|||
end
|
||||
|
||||
if self:do_states(dtime) then return end
|
||||
end
|
||||
|
||||
|
||||
|
||||
if mobs_debug then self:update_tag() end
|
||||
|
||||
|
@ -439,6 +446,36 @@ function mob_class:on_step(dtime)
|
|||
end
|
||||
end
|
||||
|
||||
local last_crash_warn_time = 0
|
||||
|
||||
local on_step_error_handler = function ()
|
||||
local info = debug.getinfo(1, "SnlufL")
|
||||
|
||||
local current_time = os.time()
|
||||
local time_since_warning = current_time - last_crash_warn_time
|
||||
|
||||
--minetest.log("previous_crash_time: " .. current_time)
|
||||
--minetest.log("last_crash_time: " .. last_crash_warn_time)
|
||||
--minetest.log("time_since_warning: " .. time_since_warning)
|
||||
|
||||
if time_since_warning > CRASH_WARN_FREQUENCY then
|
||||
last_crash_warn_time = current_time
|
||||
minetest.log("A game crashing bug was prevented. Please provide debug.log information to MineClone2 dev team for investigation. (Search for: --- Bug report start)")
|
||||
end
|
||||
minetest.log("action", "--- Bug report start (please provide a few lines before this also for context) ---")
|
||||
minetest.log("action", "Stack trace: ".. tostring(debug.traceback()))
|
||||
minetest.log("action", "Bug info: ".. dump(info))
|
||||
minetest.log("action", "--- Bug report end ---")
|
||||
end
|
||||
|
||||
-- main mob function
|
||||
function mob_class:on_step(dtime)
|
||||
local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime)
|
||||
if status then
|
||||
return retVal
|
||||
end
|
||||
end
|
||||
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
local math, vector, minetest, mcl_mobs = math, vector, minetest, mcl_mobs
|
||||
local mob_class = mcl_mobs.mob_class
|
||||
|
||||
local HORNY_TIME = 30*20
|
||||
local HORNY_AGAIN_TIME = 30*20 -- was 300 or 15*20
|
||||
local CHILD_GROW_TIME = 60*20
|
||||
local HORNY_TIME = 30
|
||||
local HORNY_AGAIN_TIME = 30 -- was 300 or 15*20
|
||||
local CHILD_GROW_TIME = 60
|
||||
|
||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_mobs_villager",false)
|
||||
|
||||
|
|
|
@ -503,6 +503,8 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
|
|||
|
||||
local name = placer:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
local dim = mcl_worlds.pos_to_dimension(placer:get_pos())
|
||||
local mob_light_lvl = {mcl_mobs:mob_light_lvl(itemstack:get_name(),dim)}
|
||||
if under.name == "mcl_mobspawners:spawner" then
|
||||
if minetest.is_protected(pointed_thing.under, name) then
|
||||
minetest.record_protection_violation(pointed_thing.under, name)
|
||||
|
@ -512,7 +514,7 @@ function mcl_mobs.register_egg(mob, desc, background_color, overlay_color, addeg
|
|||
minetest.chat_send_player(name, S("You need the “maphack” privilege to change the mob spawner."))
|
||||
return itemstack
|
||||
end
|
||||
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name())
|
||||
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name(), mob_light_lvl[1], mob_light_lvl[2])
|
||||
if not minetest.is_creative_enabled(name) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
|
|
@ -460,7 +460,7 @@ end
|
|||
|
||||
|
||||
-- find and replace what mob is looking for (grass, wheat etc.)
|
||||
function mob_class:replace(pos)
|
||||
function mob_class:replace_node(pos)
|
||||
|
||||
if not self.replace_rate
|
||||
or not self.replace_what
|
||||
|
|
|
@ -3,6 +3,9 @@ local mob_class = mcl_mobs.mob_class
|
|||
|
||||
local PATHFINDING_FAIL_THRESHOLD = 100 -- no. of ticks to fail before giving up. 20p/s. 5s helps them get through door
|
||||
local PATHFINDING_FAIL_WAIT = 30 -- how long to wait before trying to path again
|
||||
local PATHING_START_DELAY = 4 -- When doing non-prioritised pathing, how long to wait until last mob pathed
|
||||
|
||||
local PATHFINDING_SEARCH_DISTANCE = 50 -- How big the square is that pathfinding will look
|
||||
|
||||
local PATHFINDING = "gowp"
|
||||
|
||||
|
@ -107,16 +110,22 @@ local function generate_enriched_path(wp_in, door_open_pos, door_close_pos, cur_
|
|||
return wp_out
|
||||
end
|
||||
|
||||
function mob_class:ready_to_path()
|
||||
local last_pathing_time = os.time()
|
||||
|
||||
function mob_class:ready_to_path(prioritised)
|
||||
mcl_log("Check ready to path")
|
||||
if self._pf_last_failed and (os.time() - self._pf_last_failed) < PATHFINDING_FAIL_WAIT then
|
||||
mcl_log("Not ready to path as last fail is less than threshold: " .. (os.time() - self._pf_last_failed))
|
||||
return false
|
||||
else
|
||||
local time_since_path_start = os.time() - last_pathing_time
|
||||
mcl_log("time_since_path_start: " .. tostring(time_since_path_start))
|
||||
if prioritised or (time_since_path_start) > PATHING_START_DELAY then
|
||||
mcl_log("We are ready to pathfind, no previous fail or we are past threshold")
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- This function is used to see if we can path. We could use to check a route, rather than making people move.
|
||||
local function calculate_path_through_door (p, cur_door_pos, t)
|
||||
|
@ -144,7 +153,7 @@ local function calculate_path_through_door (p, cur_door_pos, t)
|
|||
if n.name == "air" then
|
||||
mcl_log("We have air space next to door at: " .. minetest.pos_to_string(pos_closest_to_door))
|
||||
|
||||
prospective_wp = minetest.find_path(p,pos_closest_to_door,150,1,4)
|
||||
prospective_wp = minetest.find_path(p, pos_closest_to_door, PATHFINDING_SEARCH_DISTANCE, 1, 4)
|
||||
|
||||
if prospective_wp then
|
||||
mcl_log("Found a path to next to door".. minetest.pos_to_string(pos_closest_to_door))
|
||||
|
@ -154,7 +163,7 @@ local function calculate_path_through_door (p, cur_door_pos, t)
|
|||
|
||||
if t then
|
||||
mcl_log("We have t, lets go from door to target")
|
||||
local wp_otherside_door_to_target = minetest.find_path(other_side_of_door,t,150,1,4)
|
||||
local wp_otherside_door_to_target = minetest.find_path(other_side_of_door, t, PATHFINDING_SEARCH_DISTANCE, 1, 4)
|
||||
|
||||
if wp_otherside_door_to_target and #wp_otherside_door_to_target > 0 then
|
||||
append_paths (prospective_wp, wp_otherside_door_to_target)
|
||||
|
@ -190,9 +199,13 @@ local function calculate_path_through_door (p, cur_door_pos, t)
|
|||
return enriched_path
|
||||
end
|
||||
|
||||
function mob_class:gopath(target,callback_arrived)
|
||||
|
||||
|
||||
function mob_class:gopath(target, callback_arrived, prioritised)
|
||||
if self.state == PATHFINDING then mcl_log("Already pathfinding, don't set another until done.") return end
|
||||
if not self:ready_to_path() then return end
|
||||
if not self:ready_to_path(prioritised) then return end
|
||||
|
||||
last_pathing_time = os.time()
|
||||
|
||||
self.order = nil
|
||||
|
||||
|
@ -200,7 +213,7 @@ function mob_class:gopath(target,callback_arrived)
|
|||
local t = vector.offset(target,0,1,0)
|
||||
|
||||
--Check direct route
|
||||
local wp = minetest.find_path(p,t,150,1,4)
|
||||
local wp = minetest.find_path(p, t, PATHFINDING_SEARCH_DISTANCE, 1, 4)
|
||||
|
||||
if not wp then
|
||||
mcl_log("### No direct path. Path through door closest to target.")
|
||||
|
@ -410,7 +423,7 @@ function mob_class:check_gowp(dtime)
|
|||
mcl_log("No current target")
|
||||
end
|
||||
|
||||
local final_wp = minetest.find_path(p,self._target,150,1,4)
|
||||
local final_wp = minetest.find_path(p, self._target, PATHFINDING_SEARCH_DISTANCE, 1, 4)
|
||||
if final_wp then
|
||||
mcl_log("We can get to target here.")
|
||||
-- self.waypoints = final_wp
|
||||
|
|
|
@ -659,7 +659,6 @@ function mob_class:do_env_damage()
|
|||
-- rain
|
||||
if self.rain_damage > 0 then
|
||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||
|
||||
self.health = self.health - self.rain_damage
|
||||
|
||||
if self:check_for_death("rain", {type = "environment",
|
||||
|
@ -672,13 +671,9 @@ function mob_class:do_env_damage()
|
|||
pos.y = pos.y + 1 -- for particle effect position
|
||||
|
||||
-- water damage
|
||||
if self.water_damage > 0
|
||||
and nodef.groups.water then
|
||||
|
||||
if self.water_damage > 0 and nodef.groups.water then
|
||||
if self.water_damage ~= 0 then
|
||||
|
||||
self.health = self.health - self.water_damage
|
||||
|
||||
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png", nil, nil, 1, nil)
|
||||
|
||||
if self:check_for_death("water", {type = "environment",
|
||||
|
@ -686,27 +681,10 @@ function mob_class:do_env_damage()
|
|||
return true
|
||||
end
|
||||
end
|
||||
-- magma damage
|
||||
elseif self.fire_damage > 0
|
||||
and (nodef2.groups.fire) then
|
||||
|
||||
if self.fire_damage ~= 0 then
|
||||
|
||||
self.health = self.health - self.fire_damage
|
||||
|
||||
if self:check_for_death("fire", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
elseif self.lava_damage > 0 and (nodef.groups.lava) then
|
||||
-- lava damage
|
||||
elseif self.lava_damage > 0
|
||||
and (nodef.groups.lava) then
|
||||
|
||||
if self.lava_damage ~= 0 then
|
||||
|
||||
self.health = self.health - self.lava_damage
|
||||
|
||||
mcl_mobs.effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
|
||||
mcl_burning.set_on_fire(self.object, 10)
|
||||
|
||||
|
@ -715,15 +693,20 @@ function mob_class:do_env_damage()
|
|||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- fire damage
|
||||
elseif self.fire_damage > 0
|
||||
and (nodef.groups.fire) then
|
||||
|
||||
elseif self.fire_damage > 0 and (nodef2.groups.fire) then
|
||||
-- magma damage
|
||||
if self.fire_damage ~= 0 then
|
||||
|
||||
self.health = self.health - self.fire_damage
|
||||
|
||||
if self:check_for_death("fire", {type = "environment",
|
||||
pos = pos, node = self.standing_in}) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
elseif self.fire_damage > 0 and (nodef.groups.fire) then
|
||||
-- fire damage
|
||||
if self.fire_damage ~= 0 then
|
||||
self.health = self.health - self.fire_damage
|
||||
mcl_mobs.effect(pos, 5, "fire_basic_flame.png", nil, nil, 1, nil)
|
||||
mcl_burning.set_on_fire(self.object, 5)
|
||||
|
||||
|
@ -732,12 +715,9 @@ function mob_class:do_env_damage()
|
|||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- damage_per_second node check
|
||||
elseif nodef.damage_per_second ~= 0 and not nodef.groups.lava and not nodef.groups.fire then
|
||||
|
||||
-- damage_per_second node check
|
||||
self.health = self.health - nodef.damage_per_second
|
||||
|
||||
mcl_mobs.effect(pos, 5, "mcl_particles_smoke.png")
|
||||
|
||||
if self:check_for_death("dps", {type = "environment",
|
||||
|
@ -749,6 +729,7 @@ function mob_class:do_env_damage()
|
|||
-- Drowning damage
|
||||
if self.breath_max ~= -1 then
|
||||
local drowning = false
|
||||
|
||||
if self.breathes_in_water then
|
||||
if minetest.get_item_group(self.standing_in, "water") == 0 then
|
||||
drowning = true
|
||||
|
@ -756,10 +737,9 @@ function mob_class:do_env_damage()
|
|||
elseif nodef.drowning > 0 then
|
||||
drowning = true
|
||||
end
|
||||
|
||||
if drowning then
|
||||
|
||||
self.breath = math.max(0, self.breath - 1)
|
||||
|
||||
mcl_mobs.effect(pos, 2, "bubble.png", nil, nil, 1, nil)
|
||||
if self.breath <= 0 then
|
||||
local dmg
|
||||
|
@ -817,18 +797,18 @@ function mob_class:env_damage (dtime, pos)
|
|||
-- environmental damage timer (every 1 second)
|
||||
self.env_damage_timer = self.env_damage_timer + dtime
|
||||
|
||||
if (self.state == "attack" and self.env_damage_timer > 1)
|
||||
or self.state ~= "attack" then
|
||||
self:check_entity_cramming()
|
||||
|
||||
if self.env_damage_timer > 1 then
|
||||
self.env_damage_timer = 0
|
||||
|
||||
self:check_entity_cramming()
|
||||
|
||||
-- check for environmental damage (water, fire, lava etc.)
|
||||
if self:do_env_damage() then
|
||||
return true
|
||||
end
|
||||
|
||||
-- node replace check (cow eats grass etc.)
|
||||
self:replace(pos)
|
||||
self:replace_node(pos) -- (sheep eats grass etc.)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -24,25 +24,60 @@ local vector_floor = vector.floor
|
|||
|
||||
local table_copy = table.copy
|
||||
local table_remove = table.remove
|
||||
|
||||
local pairs = pairs
|
||||
|
||||
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_mobs_spawning", false)
|
||||
local function mcl_log (message)
|
||||
if LOGGING_ON then
|
||||
mcl_util.mcl_log (message, "[Mobs spawn]", true)
|
||||
end
|
||||
end
|
||||
|
||||
local dbg_spawn_attempts = 0
|
||||
local dbg_spawn_succ = 0
|
||||
local dbg_spawn_counts = {}
|
||||
-- range for mob count
|
||||
local aoc_range = 136
|
||||
|
||||
local remove_far = true
|
||||
|
||||
local WAIT_FOR_SPAWN_ATTEMPT = 10
|
||||
local FIND_SPAWN_POS_RETRIES = 16
|
||||
local FIND_SPAWN_POS_RETRIES_SUCCESS_RESPIN = 8
|
||||
|
||||
local MOB_SPAWN_ZONE_INNER = 24
|
||||
local MOB_SPAWN_ZONE_MIDDLE = 32
|
||||
local MOB_SPAWN_ZONE_OUTER = 128
|
||||
|
||||
-- range for mob count
|
||||
local MOB_CAP_INNER_RADIUS = 32
|
||||
local aoc_range = 136
|
||||
|
||||
local MISSING_CAP_DEFAULT = 15
|
||||
local MOBS_CAP_CLOSE = 5
|
||||
|
||||
local SPAWN_MAPGEN_LIMIT = mcl_vars.mapgen_limit - 150
|
||||
|
||||
local mob_cap = {
|
||||
monster = tonumber(minetest.settings:get("mcl_mob_cap_monster")) or 70,
|
||||
animal = tonumber(minetest.settings:get("mcl_mob_cap_animal")) or 10,
|
||||
hostile = tonumber(minetest.settings:get("mcl_mob_cap_monster")) or 70,
|
||||
passive = tonumber(minetest.settings:get("mcl_mob_cap_animal")) or 13,
|
||||
ambient = tonumber(minetest.settings:get("mcl_mob_cap_ambient")) or 15,
|
||||
water = tonumber(minetest.settings:get("mcl_mob_cap_water")) or 5, --currently unused
|
||||
water = tonumber(minetest.settings:get("mcl_mob_cap_water")) or 8,
|
||||
water_ambient = tonumber(minetest.settings:get("mcl_mob_cap_water_ambient")) or 20, --currently unused
|
||||
player = tonumber(minetest.settings:get("mcl_mob_cap_player")) or 75,
|
||||
total = tonumber(minetest.settings:get("mcl_mob_cap_total")) or 500,
|
||||
}
|
||||
|
||||
local peaceful_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_peaceful_percentage_spawned")) or 35
|
||||
local peaceful_group_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_peaceful_group_percentage_spawned")) or 15
|
||||
local hostile_group_percentage_spawned = tonumber(minetest.settings:get("mcl_mob_hostile_group_percentage_spawned")) or 20
|
||||
|
||||
mcl_log("Mob cap hostile: " .. mob_cap.hostile)
|
||||
mcl_log("Mob cap water: " .. mob_cap.water)
|
||||
mcl_log("Mob cap passive: " .. mob_cap.passive)
|
||||
|
||||
mcl_log("Percentage of peacefuls spawned: " .. peaceful_percentage_spawned)
|
||||
mcl_log("Percentage of peaceful spawns are group: " .. peaceful_group_percentage_spawned)
|
||||
mcl_log("Percentage of hostile spawns are group: " .. hostile_group_percentage_spawned)
|
||||
|
||||
--do mobs spawn?
|
||||
local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false
|
||||
local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false
|
||||
|
@ -250,22 +285,58 @@ local function count_mobs_total(mob_type)
|
|||
return num
|
||||
end
|
||||
|
||||
local function count_mobs_all()
|
||||
local mobs_found = {}
|
||||
local function count_mobs_add_entry (mobs_list, mob_cat)
|
||||
if mobs_list[mob_cat] then
|
||||
mobs_list[mob_cat] = mobs_list[mob_cat] + 1
|
||||
else
|
||||
mobs_list[mob_cat] = 1
|
||||
end
|
||||
end
|
||||
|
||||
--categorise_by can be name or type or spawn_class
|
||||
local function count_mobs_all(categorise_by, pos)
|
||||
local mobs_found_wide = {}
|
||||
local mobs_found_close = {}
|
||||
|
||||
local num = 0
|
||||
for _,entity in pairs(minetest.luaentities) do
|
||||
if entity.is_mob then
|
||||
local mob_type = entity.type -- animal / monster / npc
|
||||
local mob_name = entity.name
|
||||
if mobs_found[mob_name] then
|
||||
mobs_found[mob_name] = mobs_found[mob_name] + 1
|
||||
if entity and entity.is_mob then
|
||||
|
||||
local add_entry = false
|
||||
--local mob_type = entity.type -- animal / monster / npc
|
||||
local mob_cat = entity[categorise_by]
|
||||
|
||||
if pos then
|
||||
local mob_pos = entity.object:get_pos()
|
||||
if mob_pos then
|
||||
local distance = vector.distance(pos, mob_pos)
|
||||
--mcl_log("distance: ".. distance)
|
||||
if distance <= MOB_SPAWN_ZONE_MIDDLE then
|
||||
--mcl_log("distance is close")
|
||||
count_mobs_add_entry (mobs_found_close, mob_cat)
|
||||
count_mobs_add_entry (mobs_found_wide, mob_cat)
|
||||
add_entry = true
|
||||
elseif distance <= MOB_SPAWN_ZONE_OUTER then
|
||||
--mcl_log("distance is wide")
|
||||
count_mobs_add_entry (mobs_found_wide, mob_cat)
|
||||
add_entry = true
|
||||
else
|
||||
mobs_found[mob_name] = 1
|
||||
--mcl_log("mob_pos: " .. minetest.pos_to_string(mob_pos))
|
||||
end
|
||||
end
|
||||
else
|
||||
count_mobs_add_entry (mobs_found_wide, mob_cat)
|
||||
add_entry = true
|
||||
end
|
||||
|
||||
|
||||
if add_entry then
|
||||
num = num + 1
|
||||
end
|
||||
end
|
||||
return mobs_found, num
|
||||
end
|
||||
--mcl_log("num: ".. num)
|
||||
return mobs_found_close, mobs_found_wide, num
|
||||
end
|
||||
|
||||
local function count_mobs_total_cap(mob_type)
|
||||
|
@ -280,6 +351,32 @@ local function count_mobs_total_cap(mob_type)
|
|||
return num
|
||||
end
|
||||
|
||||
local function output_mob_stats(mob_counts, total_mobs, chat_display)
|
||||
if (total_mobs) then
|
||||
local total_output = "Total mobs found: " .. total_mobs
|
||||
if chat_display then
|
||||
minetest.log(total_output)
|
||||
else
|
||||
minetest.log("action", total_output)
|
||||
end
|
||||
|
||||
end
|
||||
local detailed = ""
|
||||
if mob_counts then
|
||||
for k, v1 in pairs(mob_counts) do
|
||||
detailed = detailed .. tostring(k) .. ": " .. tostring(v1) .. "; "
|
||||
end
|
||||
end
|
||||
if detailed and detailed ~= "" then
|
||||
if chat_display then
|
||||
minetest.log(detailed)
|
||||
else
|
||||
minetest.log("action", detailed)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- global functions
|
||||
|
||||
function mcl_mobs:spawn_abm_check(pos, node, name)
|
||||
|
@ -316,6 +413,8 @@ WARNING: BIOME INTEGRATION NEEDED -> How to get biome through lua??
|
|||
|
||||
--this is where all of the spawning information is kept
|
||||
local spawn_dictionary = {}
|
||||
--this is where all of the spawning information is kept for mobs that don't naturally spawn
|
||||
local non_spawn_dictionary = {}
|
||||
local summary_chance = 0
|
||||
|
||||
function mcl_mobs:spawn_setup(def)
|
||||
|
@ -381,6 +480,47 @@ function mcl_mobs:spawn_setup(def)
|
|||
summary_chance = summary_chance + chance
|
||||
end
|
||||
|
||||
function mcl_mobs:mob_light_lvl(mob_name, dimension)
|
||||
local spawn_dictionary_consolidated = {}
|
||||
--see if the mob exists in the nonspawn dictionary, if so then return light values
|
||||
if non_spawn_dictionary[mob_name] ~= nil then
|
||||
local mob_dimension = non_spawn_dictionary[mob_name][dimension]
|
||||
if mob_name ~= nil then
|
||||
return mob_dimension.min_light,mob_dimension.max_light
|
||||
else
|
||||
return non_spawn_dictionary[mob_name]["overworld"].min_light, non_spawn_dictionary[mob_name]["overworld"].max_light
|
||||
end
|
||||
|
||||
--if the mob doesn't exist in non_spawn, check spawn_dictonary
|
||||
else
|
||||
for i,v in pairs(spawn_dictionary) do
|
||||
if spawn_dictionary[spawn_dictionary[i].name] == nil then
|
||||
spawn_dictionary_consolidated[spawn_dictionary[i].name] = {}
|
||||
end
|
||||
spawn_dictionary_consolidated[spawn_dictionary[i].name][dimension] = {
|
||||
["min_light"] = spawn_dictionary[i].min_light,
|
||||
["max_light"] = spawn_dictionary[i].max_light
|
||||
}
|
||||
end
|
||||
mob_dimension = spawn_dictionary_consolidated[mob_name][dimension]
|
||||
mob_dimension_default = spawn_dictionary_consolidated[mob_name]["overworld"]
|
||||
if spawn_dictionary_consolidated[mob_name] == mob_name and mob_dimension ~= nil then
|
||||
return mob_dimension.min_light, mob_dimension.max_light
|
||||
else
|
||||
return mob_dimension_default.min_light, mob_dimension_default.max_light
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_mobs:non_spawn_specific(mob_name,dimension,min_light,max_light)
|
||||
table.insert(non_spawn_dictionary, mob_name)
|
||||
non_spawn_dictionary[mob_name] = {
|
||||
[dimension] = {
|
||||
min_light = min_light , max_light = max_light
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_light, max_light, interval, chance, aoc, min_height, max_height, day_toggle, on_spawn)
|
||||
|
||||
-- Do mobs spawn at all?
|
||||
|
@ -422,18 +562,23 @@ function mcl_mobs:spawn_specific(name, dimension, type_of_spawning, biomes, min_
|
|||
summary_chance = summary_chance + chance
|
||||
end
|
||||
|
||||
|
||||
local two_pi = 2 * math.pi
|
||||
local function get_next_mob_spawn_pos(pos)
|
||||
local distance = math_random(25, 32)
|
||||
-- TODO We should consider spawning something a little further away sporadically.
|
||||
-- It would be good for sky farms and variance, rather than all being on the 24 - 32 block away radius
|
||||
local distance = math_random(MOB_SPAWN_ZONE_INNER, MOB_SPAWN_ZONE_MIDDLE)
|
||||
local angle = math_random() * two_pi
|
||||
|
||||
-- TODO Floor xoff and zoff and add 0.5 so it tries to spawn in the middle of the square. Less failed attempts.
|
||||
local xoff = math_round(distance * math_cos(angle))
|
||||
local yoff = math_round(distance * math_sin(angle))
|
||||
return vector.offset(pos, xoff, 0, yoff)
|
||||
local zoff = math_round(distance * math_sin(angle))
|
||||
return vector.offset(pos, xoff, 0, zoff)
|
||||
end
|
||||
|
||||
local function decypher_limits(posy)
|
||||
posy = math_floor(posy)
|
||||
return posy - 32, posy + 32
|
||||
return posy - MOB_SPAWN_ZONE_MIDDLE, posy + MOB_SPAWN_ZONE_MIDDLE
|
||||
end
|
||||
|
||||
--a simple helper function for mob_spawn
|
||||
|
@ -484,7 +629,9 @@ local function has_room(self,pos)
|
|||
return true
|
||||
end
|
||||
|
||||
local function spawn_check(pos,spawn_def,ignore_caps)
|
||||
|
||||
|
||||
local function spawn_check(pos, spawn_def)
|
||||
if not spawn_def then return end
|
||||
dbg_spawn_attempts = dbg_spawn_attempts + 1
|
||||
local dimension = mcl_worlds.pos_to_dimension(pos)
|
||||
|
@ -507,17 +654,8 @@ local function spawn_check(pos,spawn_def,ignore_caps)
|
|||
local is_leaf = get_item_group(gotten_node, "leaves") ~= 0
|
||||
local is_bedrock = gotten_node == "mcl_core:bedrock"
|
||||
local is_grass = minetest.get_item_group(gotten_node,"grass_block") ~= 0
|
||||
local mob_count_wide = 0
|
||||
|
||||
local mob_count = 0
|
||||
if not ignore_caps then
|
||||
mob_count = count_mobs(pos,32,mob_type)
|
||||
mob_count_wide = count_mobs(pos,aoc_range,mob_type)
|
||||
end
|
||||
|
||||
if pos and spawn_def
|
||||
and ( mob_count_wide < (mob_cap[mob_type] or 15) )
|
||||
and ( mob_count < 5 )
|
||||
and pos.y >= spawn_def.min_height
|
||||
and pos.y <= spawn_def.max_height
|
||||
and spawn_def.dimension == dimension
|
||||
|
@ -553,8 +691,7 @@ function mcl_mobs.spawn(pos,id)
|
|||
end
|
||||
|
||||
|
||||
local function spawn_group(p,mob,spawn_on,group_max,group_min)
|
||||
if not group_min then group_min = 1 end
|
||||
local function spawn_group(p,mob,spawn_on,amount_to_spawn)
|
||||
local nn= minetest.find_nodes_in_area_under_air(vector.offset(p,-5,-3,-5),vector.offset(p,5,3,5),spawn_on)
|
||||
local o
|
||||
table.shuffle(nn)
|
||||
|
@ -562,9 +699,10 @@ local function spawn_group(p,mob,spawn_on,group_max,group_min)
|
|||
nn = {}
|
||||
table.insert(nn,p)
|
||||
end
|
||||
for i = 1, math.random(group_min,group_max) do
|
||||
|
||||
for i = 1, amount_to_spawn do
|
||||
local sp = vector.offset(nn[math.random(#nn)],0,1,0)
|
||||
if spawn_check(nn[math.random(#nn)],mob,true) then
|
||||
if spawn_check(nn[math.random(#nn)],mob) then
|
||||
if mob.type_of_spawning == "water" then
|
||||
sp = get_water_spawn(sp)
|
||||
end
|
||||
|
@ -655,25 +793,113 @@ if mobs_spawn then
|
|||
-- Get pos to spawn, x and z are randomised, y is range
|
||||
|
||||
|
||||
local function spawn_a_mob(pos, dimension, y_min, y_max)
|
||||
--create a disconnected clone of the spawn dictionary
|
||||
--prevents memory leak
|
||||
local mob_library_worker_table = table_copy(spawn_dictionary)
|
||||
local function mob_cap_space (pos, mob_type, mob_counts_close, mob_counts_wide)
|
||||
|
||||
-- Some mob examples
|
||||
--type = "monster", spawn_class = "hostile",
|
||||
--type = "animal", spawn_class = "passive",
|
||||
--local cod = { type = "animal", spawn_class = "water",
|
||||
|
||||
local type_cap = mob_cap[mob_type] or MISSING_CAP_DEFAULT
|
||||
local close_zone_cap = MOBS_CAP_CLOSE
|
||||
|
||||
local mob_total_wide = mob_counts_wide[mob_type]
|
||||
if not mob_total_wide then
|
||||
--mcl_log("none of type found. set as 0")
|
||||
mob_total_wide = 0
|
||||
end
|
||||
|
||||
local cap_space_wide = type_cap - mob_total_wide
|
||||
if cap_space_wide < 1 then
|
||||
cap_space_wide = 0
|
||||
end
|
||||
|
||||
local mob_total_close = mob_counts_close[mob_type]
|
||||
if not mob_total_close then
|
||||
--mcl_log("none of type found. set as 0")
|
||||
mob_total_close = 0
|
||||
end
|
||||
|
||||
local cap_space_close = close_zone_cap - mob_total_close
|
||||
if cap_space_close < 1 then
|
||||
cap_space_close = 0
|
||||
end
|
||||
|
||||
--mcl_log("spawn_class: " .. spawn_class)
|
||||
|
||||
if false and mob_type == "water" then
|
||||
mcl_log("mob_type: " .. mob_type .. " and pos: " .. minetest.pos_to_string(pos))
|
||||
mcl_log("wide: " .. mob_total_wide .. "/" .. type_cap)
|
||||
mcl_log("cap_space_wide: " .. cap_space_wide)
|
||||
mcl_log("close: " .. mob_total_close .. "/" .. close_zone_cap)
|
||||
mcl_log("cap_space_close: " .. cap_space_close)
|
||||
end
|
||||
|
||||
return cap_space_wide, cap_space_close
|
||||
end
|
||||
|
||||
local function find_spawning_position(pos, max_times)
|
||||
local spawning_position
|
||||
|
||||
local max_loops = 1
|
||||
if max_times then max_loops = max_times end
|
||||
|
||||
local y_min, y_max = decypher_limits(pos.y)
|
||||
|
||||
mcl_log("mapgen_limit: " .. SPAWN_MAPGEN_LIMIT)
|
||||
local i = 0
|
||||
repeat
|
||||
local goal_pos = get_next_mob_spawn_pos(pos)
|
||||
--grab mob that fits into the spawning location
|
||||
--randomly grab a mob, don't exclude any possibilities
|
||||
|
||||
if math.abs(goal_pos.x) <= SPAWN_MAPGEN_LIMIT and math.abs(pos.y) <= SPAWN_MAPGEN_LIMIT and math.abs(goal_pos.z) <= SPAWN_MAPGEN_LIMIT then
|
||||
local spawning_position_list = find_nodes_in_area_under_air(
|
||||
{x = goal_pos.x, y = y_min, z = goal_pos.z},
|
||||
{x = goal_pos.x, y = y_max, z = goal_pos.z},
|
||||
{"group:solid", "group:water", "group:lava"}
|
||||
)
|
||||
if #spawning_position_list <= 0 then return end
|
||||
local spawning_position = spawning_position_list[math_random(1, #spawning_position_list)]
|
||||
if #spawning_position_list > 0 then
|
||||
mcl_log("Spawning positions available: " .. minetest.pos_to_string(goal_pos))
|
||||
spawning_position = spawning_position_list[math_random(1, #spawning_position_list)]
|
||||
else
|
||||
mcl_log("Spawning position isn't good. Do not spawn: " .. minetest.pos_to_string(goal_pos))
|
||||
end
|
||||
|
||||
else
|
||||
mcl_log("Pos outside mapgen limits: " .. minetest.pos_to_string(goal_pos))
|
||||
end
|
||||
|
||||
|
||||
i = i + 1
|
||||
if i >= max_loops then
|
||||
mcl_log("Cancel finding spawn positions at: " .. max_loops)
|
||||
break
|
||||
end
|
||||
until spawning_position
|
||||
return spawning_position
|
||||
end
|
||||
|
||||
local function spawn_a_mob(pos)
|
||||
--create a disconnected clone of the spawn dictionary, prevents memory leak
|
||||
local mob_library_worker_table = table_copy(spawn_dictionary)
|
||||
|
||||
local spawning_position = find_spawning_position(pos, FIND_SPAWN_POS_RETRIES)
|
||||
if not spawning_position then
|
||||
minetest.log("action", "[Mobs spawn] Cannot find a valid spawn position after retries: " .. FIND_SPAWN_POS_RETRIES)
|
||||
return
|
||||
end
|
||||
|
||||
local mob_counts_close, mob_counts_wide, total_mobs = count_mobs_all("spawn_class", spawning_position)
|
||||
--output_mob_stats(mob_counts_close, total_mobs)
|
||||
--output_mob_stats(mob_counts_wide)
|
||||
|
||||
--grab mob that fits into the spawning location
|
||||
--randomly grab a mob, don't exclude any possibilities
|
||||
perlin_noise = perlin_noise or minetest_get_perlin(noise_params)
|
||||
local noise = perlin_noise:get_3d(spawning_position)
|
||||
local current_summary_chance = summary_chance
|
||||
|
||||
table.shuffle(mob_library_worker_table)
|
||||
|
||||
while #mob_library_worker_table > 0 do
|
||||
local mob_chance_offset = (math_round(noise * current_summary_chance + 12345) % current_summary_chance) + 1
|
||||
local mob_index = 1
|
||||
|
@ -684,13 +910,32 @@ if mobs_spawn then
|
|||
mob_chance = mob_library_worker_table[mob_index].chance
|
||||
step_chance = step_chance + mob_chance
|
||||
end
|
||||
local mob_def = mob_library_worker_table[mob_index]
|
||||
--minetest.log(mob_def.name.." "..step_chance.. " "..mob_chance)
|
||||
|
||||
local mob_def = mob_library_worker_table[mob_index]
|
||||
if mob_def and mob_def.name and minetest.registered_entities[mob_def.name] then
|
||||
local spawn_in_group = minetest.registered_entities[mob_def.name].spawn_in_group or 4
|
||||
local spawn_in_group_min = minetest.registered_entities[mob_def.name].spawn_in_group_min or 1
|
||||
local mob_type = minetest.registered_entities[mob_def.name].type
|
||||
if spawn_check(spawning_position,mob_def) then
|
||||
|
||||
local mob_def_ent = minetest.registered_entities[mob_def.name]
|
||||
--local mob_type = mob_def_ent.type
|
||||
local mob_spawn_class = mob_def_ent.spawn_class
|
||||
|
||||
--mcl_log("mob_spawn_class: " .. mob_spawn_class)
|
||||
|
||||
local cap_space_wide, cap_space_close = mob_cap_space (spawning_position, mob_spawn_class, mob_counts_close, mob_counts_wide)
|
||||
|
||||
|
||||
if cap_space_close > 0 and cap_space_wide > 0 then
|
||||
--mcl_log("Cap space available")
|
||||
|
||||
-- Spawn caps for animals and water creatures fill up rapidly. Need to throttle this somewhat
|
||||
-- for performance and for early game challenge. We don't want to reduce hostiles though.
|
||||
local spawn_hostile = (mob_spawn_class == "hostile")
|
||||
local spawn_passive = (mob_spawn_class ~= "hostile") and math.random(100) < peaceful_percentage_spawned
|
||||
-- or not hostile
|
||||
--mcl_log("Spawn_passive: " .. tostring(spawn_passive))
|
||||
--mcl_log("Spawn_hostile: " .. tostring(spawn_hostile))
|
||||
|
||||
if (spawn_hostile or spawn_passive) and spawn_check(spawning_position,mob_def) then
|
||||
if mob_def.type_of_spawning == "water" then
|
||||
spawning_position = get_water_spawn(spawning_position)
|
||||
if not spawning_position then
|
||||
|
@ -698,25 +943,62 @@ if mobs_spawn then
|
|||
return
|
||||
end
|
||||
end
|
||||
if minetest.registered_entities[mob_def.name].can_spawn and not minetest.registered_entities[mob_def.name].can_spawn(spawning_position) then
|
||||
if mob_def_ent.can_spawn and not mob_def_ent.can_spawn(spawning_position) then
|
||||
minetest.log("warning","[mcl_mobs] mob "..mob_def.name.." refused to spawn at "..minetest.pos_to_string(vector.round(spawning_position)))
|
||||
return
|
||||
end
|
||||
--everything is correct, spawn mob
|
||||
local object
|
||||
if spawn_in_group and ( mob_type ~= "monster" or math.random(5) == 1 ) then
|
||||
if logging then
|
||||
minetest.log("action", "[mcl_mobs] A group of mob " .. mob_def.name .. " spawns on " ..minetest.get_node(vector.offset(spawning_position,0,-1,0)).name .." at " .. minetest.pos_to_string(spawning_position, 1))
|
||||
end
|
||||
object = spawn_group(spawning_position,mob_def,{minetest.get_node(vector.offset(spawning_position,0,-1,0)).name},spawn_in_group,spawn_in_group_min)
|
||||
|
||||
--everything is correct, spawn mob
|
||||
local spawn_in_group = mob_def_ent.spawn_in_group or 4
|
||||
|
||||
local spawn_group_hostile = (mob_spawn_class == "hostile") and (math.random(100) < hostile_group_percentage_spawned)
|
||||
local spawn_group_passive = (mob_spawn_class ~= "hostile") and (math.random(100) < peaceful_group_percentage_spawned)
|
||||
|
||||
mcl_log("spawn_group_hostile: " .. tostring(spawn_group_hostile))
|
||||
mcl_log("spawn_group_passive: " .. tostring(spawn_group_passive))
|
||||
|
||||
local spawned
|
||||
if spawn_in_group and (spawn_group_hostile or spawn_group_passive) then
|
||||
local group_min = mob_def_ent.spawn_in_group_min or 1
|
||||
if not group_min then group_min = 1 end
|
||||
|
||||
local amount_to_spawn = math.random(group_min,spawn_in_group)
|
||||
|
||||
if amount_to_spawn > cap_space_wide then
|
||||
mcl_log("Spawning quantity: " .. amount_to_spawn)
|
||||
mcl_log("Throttle amount to cap space: " .. cap_space_wide)
|
||||
amount_to_spawn = cap_space_wide
|
||||
end
|
||||
|
||||
if logging then
|
||||
minetest.log("action", "[mcl_mobs] A group of " ..amount_to_spawn .. " " .. mob_def.name .. " mob spawns on " ..minetest.get_node(vector.offset(spawning_position,0,-1,0)).name .." at " .. minetest.pos_to_string(spawning_position, 1))
|
||||
end
|
||||
spawned = spawn_group(spawning_position,mob_def,{minetest.get_node(vector.offset(spawning_position,0,-1,0)).name}, amount_to_spawn)
|
||||
else
|
||||
if logging then
|
||||
minetest.log("action", "[mcl_mobs] Mob " .. mob_def.name .. " spawns on " ..minetest.get_node(vector.offset(spawning_position,0,-1,0)).name .." at ".. minetest.pos_to_string(spawning_position, 1))
|
||||
end
|
||||
object = mcl_mobs.spawn(spawning_position, mob_def.name)
|
||||
spawned = mcl_mobs.spawn(spawning_position, mob_def.name)
|
||||
end
|
||||
|
||||
if spawned then
|
||||
--mcl_log("We have spawned")
|
||||
mob_counts_close, mob_counts_wide, total_mobs = count_mobs_all("type", pos)
|
||||
local new_spawning_position = find_spawning_position(pos, FIND_SPAWN_POS_RETRIES_SUCCESS_RESPIN)
|
||||
if new_spawning_position then
|
||||
mcl_log("Setting new spawning position")
|
||||
spawning_position = new_spawning_position
|
||||
else
|
||||
mcl_log("Cannot set new spawning position")
|
||||
end
|
||||
end
|
||||
else
|
||||
mcl_log("Spawn check failed")
|
||||
end
|
||||
else
|
||||
mcl_log("Cap space full")
|
||||
end
|
||||
|
||||
end
|
||||
current_summary_chance = current_summary_chance - mob_chance
|
||||
table_remove(mob_library_worker_table, mob_index)
|
||||
|
@ -728,22 +1010,24 @@ if mobs_spawn then
|
|||
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
|
||||
timer = timer + dtime
|
||||
if timer < 10 then return end
|
||||
if timer < WAIT_FOR_SPAWN_ATTEMPT then return end
|
||||
timer = 0
|
||||
|
||||
local players = get_connected_players()
|
||||
local total_mobs = count_mobs_total_cap()
|
||||
if total_mobs > mob_cap.total or total_mobs > #players * mob_cap.player then
|
||||
minetest.log("action","[mcl_mobs] global mob cap reached. no cycle spawning.")
|
||||
return
|
||||
end --mob cap per player
|
||||
|
||||
for _, player in pairs(players) do
|
||||
local pos = player:get_pos()
|
||||
local dimension = mcl_worlds.pos_to_dimension(pos)
|
||||
-- ignore void and unloaded area
|
||||
if dimension ~= "void" and dimension ~= "default" then
|
||||
local y_min, y_max = decypher_limits(pos.y)
|
||||
spawn_a_mob(pos, dimension, y_min, y_max)
|
||||
spawn_a_mob(pos)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
@ -775,27 +1059,16 @@ function mob_class:check_despawn(pos, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand("mobstats",{
|
||||
privs = { debug = true },
|
||||
func = function(n,param)
|
||||
minetest.chat_send_player(n,dump(dbg_spawn_counts))
|
||||
--minetest.chat_send_player(n,dump(dbg_spawn_counts))
|
||||
local pos = minetest.get_player_by_name(n):get_pos()
|
||||
minetest.chat_send_player(n,"mobs within 32 radius of player:"..count_mobs(pos,32))
|
||||
minetest.chat_send_player(n,"total mobs:"..count_mobs_total())
|
||||
minetest.chat_send_player(n,"spawning attempts since server start:"..dbg_spawn_attempts)
|
||||
minetest.chat_send_player(n,"successful spawns since server start:"..dbg_spawn_succ)
|
||||
|
||||
|
||||
local mob_counts, total_mobs = count_mobs_all()
|
||||
if (total_mobs) then
|
||||
minetest.log("action", "Total mobs found: " .. total_mobs)
|
||||
end
|
||||
if mob_counts then
|
||||
for k, v1 in pairs(mob_counts) do
|
||||
minetest.log("action", "k: " .. tostring(k))
|
||||
minetest.log("action", "v1: " .. tostring(v1))
|
||||
end
|
||||
end
|
||||
minetest.chat_send_player(n,"mobs: within 32 radius of player/total loaded :"..count_mobs(pos,MOB_CAP_INNER_RADIUS) .. "/" .. count_mobs_total())
|
||||
minetest.chat_send_player(n,"spawning attempts since server start:" .. dbg_spawn_succ .. "/" .. dbg_spawn_attempts)
|
||||
|
||||
local mob_counts_close, mob_counts_wide, total_mobs = count_mobs_all("name") -- Can use "type"
|
||||
output_mob_stats(mob_counts_wide, total_mobs, true)
|
||||
end
|
||||
})
|
||||
|
|
|
@ -207,5 +207,6 @@ mcl_mobs.register_arrow("mobs_mc:blaze_fireball", {
|
|||
end
|
||||
})
|
||||
|
||||
-- spawn eggs
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:blaze", "overworld", 0, 11)
|
||||
-- spawn eggs.
|
||||
mcl_mobs.register_egg("mobs_mc:blaze", S("Blaze"), "#f6b201", "#fff87e", 0)
|
||||
|
|
|
@ -40,14 +40,14 @@ local cod = {
|
|||
xp_max = 3,
|
||||
armor = 100,
|
||||
rotate = 180,
|
||||
spawn_in_group_min = 3,
|
||||
spawn_in_group = 8,
|
||||
spawn_in_group_min = 2, -- was 3
|
||||
spawn_in_group = 4, -- was 8 nerfed until we can cap them properly locally. this is a group size, not a per spawn attempt
|
||||
tilt_swim = true,
|
||||
collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_cod.b3d",
|
||||
textures = {
|
||||
{"extra_mobs_cod.png"}
|
||||
{"mobs_mc_cod.png"}
|
||||
},
|
||||
sounds = {
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@ local cow_def = {
|
|||
xp_max = 3,
|
||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.39, 0.45},
|
||||
spawn_in_group = 4,
|
||||
spawn_in_group_min = 3,
|
||||
spawn_in_group_min = 2,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_cow.b3d",
|
||||
textures = { {
|
||||
|
@ -93,8 +93,8 @@ mcl_mobs.register_mob("mobs_mc:cow", cow_def)
|
|||
-- Mooshroom
|
||||
local mooshroom_def = table.copy(cow_def)
|
||||
mooshroom_def.description = S("Mooshroom")
|
||||
mooshroom_def.spawn_in_group_min = 4
|
||||
mooshroom_def.spawn_in_group = 8
|
||||
mooshroom_def.spawn_in_group_min = 2
|
||||
mooshroom_def.spawn_in_group = 4
|
||||
mooshroom_def.textures = { {"mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png"}, {"mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } }
|
||||
mooshroom_def.on_rightclick = function(self, clicker)
|
||||
if self:feed_tame(clicker, 1, true, false) then return end
|
||||
|
|
|
@ -42,8 +42,8 @@ local dolphin = {
|
|||
walk_chance = 100,
|
||||
breath_max = 120,
|
||||
rotate = 180,
|
||||
spawn_in_group_min = 3,
|
||||
spawn_in_group = 5,
|
||||
spawn_in_group_min = 2, -- was 3
|
||||
spawn_in_group = 4, -- was 4. nerfed until water has own cap, and it represents max pack size rather than per spawn attempt
|
||||
tilt_swim = true,
|
||||
collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3},
|
||||
visual = "mesh",
|
||||
|
|
|
@ -174,3 +174,4 @@ mcl_mobs.register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "#252525", "#b31
|
|||
|
||||
|
||||
mcl_wip.register_wip_item("mobs_mc:enderdragon")
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:enderdragon","overworld",0,minetest.LIGHT_MAX+1)
|
||||
|
|
|
@ -39,3 +39,4 @@ mcl_mobs.register_mob("mobs_mc:endermite", {
|
|||
})
|
||||
|
||||
mcl_mobs.register_egg("mobs_mc:endermite", S("Endermite"), "#161616", "#6d6d6d", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:endermite","overworld",0,7)
|
||||
|
|
|
@ -139,6 +139,6 @@ mcl_mobs.register_arrow("mobs_mc:fireball", {
|
|||
|
||||
|
||||
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:ghast","overworld","0","7")
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:ghast", S("Ghast"), "#f9f9f9", "#bcbcbc", 0)
|
||||
|
|
|
@ -25,7 +25,7 @@ local base_psdef = {
|
|||
local psdefs = {}
|
||||
for i=1,4 do
|
||||
local p = table.copy(base_psdef)
|
||||
p.texture = "extra_mobs_glow_squid_glint"..i..".png"
|
||||
p.texture = "mobs_mc_glow_squid_glint"..i..".png"
|
||||
table.insert(psdefs,p)
|
||||
end
|
||||
|
||||
|
@ -47,7 +47,7 @@ mcl_mobs.register_mob("mobs_mc:glow_squid", {
|
|||
visual = "mesh",
|
||||
mesh = "extra_mobs_glow_squid.b3d",
|
||||
textures = {
|
||||
{ "extra_mobs_glow_squid.png" }
|
||||
{ "mobs_mc_glow_squid.png" }
|
||||
},
|
||||
sounds = {
|
||||
damage = { name = "mobs_mc_squid_hurt", gain = 0.3 },
|
||||
|
|
|
@ -131,5 +131,7 @@ minetest.LIGHT_MAX+1,
|
|||
mcl_vars.mg_nether_min,
|
||||
mcl_vars.mg_nether_max)
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:hoglin","overworld",0,7)
|
||||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:hoglin", S("Hoglin"), "#85682e", "#2b2140", 0)
|
||||
|
|
|
@ -125,7 +125,7 @@ local horse = {
|
|||
type = "animal",
|
||||
spawn_class = "passive",
|
||||
spawn_in_group_min = 2,
|
||||
spawn_in_group = 6,
|
||||
spawn_in_group = 4, -- was 6. nerfed until group size is a cap rather than per spawn cycle
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_horse.b3d",
|
||||
visual_size = {x=3.0, y=3.0},
|
||||
|
|
|
@ -206,3 +206,4 @@ function mobs_mc.check_iron_golem_summon(pos)
|
|||
end
|
||||
end
|
||||
end
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:iron_golem","overworld",0,minetest.LIGHT_MAX+1)
|
||||
|
|
|
@ -56,8 +56,8 @@ mcl_mobs.register_mob("mobs_mc:llama", {
|
|||
shoot_interval = 5.5,
|
||||
arrow = "mobs_mc:llamaspit",
|
||||
shoot_offset = 1, --3.5 *would* be a good value visually but it somehow messes with the projectiles trajectory
|
||||
spawn_in_group_min = 4,
|
||||
spawn_in_group = 6,
|
||||
spawn_in_group_min = 2, -- was 4
|
||||
spawn_in_group = 4, -- was 6 nerfed until we can cap them properly locally. this is a group size, not a per spawn attempt
|
||||
|
||||
head_swivel = "head.control",
|
||||
bone_eye_height = 11,
|
||||
|
|
|
@ -283,6 +283,7 @@ piglin_brute.group_attack = { "mobs_mc:piglin", "mobs_mc:piglin_brute" }
|
|||
mcl_mobs.register_mob("mobs_mc:piglin_brute", piglin_brute)
|
||||
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:piglin","overworld",0,7)
|
||||
-- Regular spawning in the Nether
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:piglin",
|
||||
|
@ -299,7 +300,7 @@ minetest.LIGHT_MAX+1,
|
|||
3,
|
||||
mcl_vars.mg_lava_nether_max,
|
||||
mcl_vars.mg_nether_max)
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:sword_piglin","overworld",0,7)
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:sword_piglin",
|
||||
"nether",
|
||||
|
|
|
@ -122,3 +122,4 @@ pillager = {
|
|||
|
||||
mcl_mobs.register_mob("mobs_mc:pillager", pillager)
|
||||
mcl_mobs.register_egg("mobs_mc:pillager", S("Pillager"), "#532f36", "#959b9b", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:pillager","overworld",0,7)
|
||||
|
|
|
@ -25,7 +25,7 @@ local salmon = {
|
|||
visual = "mesh",
|
||||
mesh = "extra_mobs_salmon.b3d",
|
||||
textures = {
|
||||
{"extra_mobs_salmon.png"}
|
||||
{"mobs_mc_salmon.png"}
|
||||
},
|
||||
sounds = {
|
||||
},
|
||||
|
|
|
@ -178,7 +178,7 @@ mcl_mobs.register_arrow("mobs_mc:shulkerbullet", {
|
|||
|
||||
|
||||
mcl_mobs.register_egg("mobs_mc:shulker", S("Shulker"), "#946694", "#4d3852", 0)
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:shulker","overworld",0,minetest.LIGHT_MAX+1)
|
||||
--[[
|
||||
mcl_mobs:spawn_specific(
|
||||
"mobs_mc:shulker",
|
||||
|
|
|
@ -56,3 +56,4 @@ mcl_mobs.register_mob("mobs_mc:silverfish", {
|
|||
})
|
||||
|
||||
mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:silverfish","overworld",0,11)
|
||||
|
|
|
@ -118,3 +118,4 @@ mcl_vars.mg_nether_max)
|
|||
--]]
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "#141414", "#474d4d", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:witherskeleton","overworld",0,7)
|
||||
|
|
|
@ -278,7 +278,6 @@ swamp_light_max,
|
|||
4,
|
||||
swamp_min,
|
||||
swamp_max)
|
||||
|
||||
-- Magma cube
|
||||
local magma_cube_big = {
|
||||
description = S("Magma Cube"),
|
||||
|
@ -431,6 +430,11 @@ nether_max)
|
|||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:magma_cube_big", S("Magma Cube"), "#350000", "#fcfc00")
|
||||
|
||||
-- non_spawn_specific is typically for mobs who don't spawn in the overworld, or mobs that don't spawn
|
||||
-- naturally. However, slimes are a particular case where they spawn under different conditions in the same
|
||||
-- dimension.
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:slime_big","overworld",0,minetest.LIGHT_MAX+1)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:magma_cube_big","overworld",0, minetest.LIGHT_MAX+1)
|
||||
mcl_mobs.register_egg("mobs_mc:slime_big", S("Slime"), "#52a03e", "#7ebf6d")
|
||||
|
||||
-- FIXME: add spawn eggs for small and tiny slimes and magma cubes
|
||||
|
|
|
@ -197,3 +197,4 @@ end
|
|||
|
||||
-- Spawn egg
|
||||
mcl_mobs.register_egg("mobs_mc:snowman", S("Snow Golem"), "#f2f2f2", "#fd8f47", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:snowman","overworld",0,minetest.LIGHT_MAX+1)
|
||||
|
|
|
@ -246,3 +246,4 @@ mcl_mobs:spawn_setup({
|
|||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:strider", S("Strider"), "#000000", "#FF0000", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:strider","nether",0,minetest.LIGHT_MAX+1)
|
||||
|
|
|
@ -67,7 +67,7 @@ local tropical_fish = {
|
|||
xp_min = 1,
|
||||
xp_max = 3,
|
||||
armor = 100,
|
||||
spawn_in_group = 9,
|
||||
spawn_in_group = 4, -- was 9. nerfed until aquatics use own cap rather than animal, and it represents pack size, not per spawn attempt
|
||||
tilt_swim = true,
|
||||
collisionbox = {-0.2, 0.0, -0.2, 0.2, 0.1, 0.2},
|
||||
visual = "mesh",
|
||||
|
|
|
@ -95,3 +95,4 @@ mcl_mobs.register_mob("mobs_mc:vex", {
|
|||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:vex", S("Vex"), "#7a90a4", "#e8edf1", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:vex","overworld",0,7)
|
||||
|
|
|
@ -617,6 +617,13 @@ local function set_textures(self)
|
|||
self.object:set_properties({textures=badge_textures})
|
||||
end
|
||||
|
||||
-- TODO Pass in self and if nitwit, go to bed later.
|
||||
local function is_night()
|
||||
local tod = minetest.get_timeofday()
|
||||
tod = ( tod * 24000 ) % 24000
|
||||
return tod > 17500 or tod < 6500
|
||||
end
|
||||
|
||||
function get_activity(tod)
|
||||
-- night hours = tod > 18541 or tod < 5458
|
||||
if not tod then
|
||||
|
@ -626,8 +633,8 @@ function get_activity(tod)
|
|||
|
||||
local lunch_start = 11000
|
||||
local lunch_end = 13500
|
||||
local work_start = 7000
|
||||
local work_end = 16500
|
||||
local work_start = 7500
|
||||
local work_end = 16000
|
||||
|
||||
local activity = nil
|
||||
if weather_mod and mcl_weather.get_weather() == "thunder" then
|
||||
|
@ -635,7 +642,7 @@ function get_activity(tod)
|
|||
activity = SLEEP
|
||||
elseif (tod > work_start and tod < lunch_start) or (tod > lunch_end and tod < work_end) then
|
||||
activity = WORK
|
||||
elseif mcl_beds.is_night() then
|
||||
elseif is_night() then
|
||||
activity = SLEEP
|
||||
elseif tod > lunch_start and tod < lunch_end then
|
||||
activity = GATHERING
|
||||
|
@ -829,7 +836,7 @@ local function go_home(entity, sleep)
|
|||
else
|
||||
--minetest.log("Need to walk to home")
|
||||
end
|
||||
end)
|
||||
end, true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1166,6 +1173,7 @@ local function do_work (self)
|
|||
self.order = nil
|
||||
return
|
||||
end
|
||||
|
||||
self:gopath(jobsite, function(self, jobsite)
|
||||
if not self then
|
||||
--mcl_log("missing self. not good")
|
||||
|
@ -1309,7 +1317,7 @@ local function do_activity (self)
|
|||
|
||||
local jobsite_valid = false
|
||||
|
||||
if not mcl_beds.is_night() then
|
||||
if not is_night() then
|
||||
if self.order == SLEEP then self.order = nil end
|
||||
|
||||
if not validate_jobsite(self) then
|
||||
|
@ -2191,4 +2199,5 @@ mobs_mc.water_level+1,
|
|||
mcl_vars.mg_overworld_max)
|
||||
--]]
|
||||
-- spawn eggs
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:villager","overworld", 0, minetest.LIGHT_MAX+1)
|
||||
mcl_mobs.register_egg("mobs_mc:villager", S("Villager"), "#563d33", "#bc8b72", 0)
|
||||
|
|
|
@ -90,3 +90,4 @@ mcl_mobs.register_mob("mobs_mc:evoker", {
|
|||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:evoker", S("Evoker"), "#959b9b", "#1e1c1a", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:evoker","overworld",0,7)
|
||||
|
|
|
@ -66,3 +66,4 @@ mcl_mobs.register_mob("mobs_mc:illusioner", {
|
|||
})
|
||||
|
||||
mcl_mobs.register_egg("mobs_mc:illusioner", S("Illusioner"), "#3f5cbb", "#8a8686", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:illusioner","overworld",0,7)
|
||||
|
|
|
@ -78,3 +78,4 @@ mcl_mobs.register_mob("mobs_mc:vindicator", {
|
|||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:vindicator", S("Vindicator"), "#959b9b", "#275e61", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:vindicator","overworld",0,7)
|
||||
|
|
|
@ -106,5 +106,5 @@ mcl_mobs.register_arrow("mobs_mc:potion_arrow", {
|
|||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:witch", S("Witch"), "#340000", "#51a03e", 0, true)
|
||||
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:witch","overworld",0,7)
|
||||
mcl_wip.register_wip_item("mobs_mc:witch")
|
||||
|
|
|
@ -132,3 +132,4 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", {
|
|||
mcl_mobs.register_egg("mobs_mc:wither", S("Wither"), "#4f4f4f", "#4f4f4f", 0, true)
|
||||
|
||||
mcl_wip.register_wip_item("mobs_mc:wither")
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:wither","overworld",0,minetest.LIGHT_MAX+1)
|
||||
|
|
|
@ -153,3 +153,4 @@ mcl_vars.mg_nether_max)
|
|||
|
||||
-- spawn eggs
|
||||
mcl_mobs.register_egg("mobs_mc:pigman", S("Zombie Pigman"), "#ea9393", "#4c7129", 0)
|
||||
mcl_mobs:non_spawn_specific("mobs_mc:pigman","overworld",0,minetest.LIGHT_MAX+1)
|
||||
|
|
|
@ -226,7 +226,7 @@ if mcl_weather.allow_abm then
|
|||
}
|
||||
for a=1, #around do
|
||||
local apos = vector.add(pos, around[a])
|
||||
if mcl_weather.is_outdoor(apos) then
|
||||
if mcl_weather.is_outdoor(apos) and mcl_weather.has_rain(apos) then
|
||||
minetest.remove_node(pos)
|
||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true)
|
||||
return
|
||||
|
@ -244,7 +244,7 @@ if mcl_weather.allow_abm then
|
|||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
-- Rain is equivalent to a water bottle
|
||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) and mcl_weather.has_rain(pos) then
|
||||
if node.name == "mcl_cauldrons:cauldron" then
|
||||
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_1"})
|
||||
elseif node.name == "mcl_cauldrons:cauldron_1" then
|
||||
|
@ -267,7 +267,7 @@ if mcl_weather.allow_abm then
|
|||
interval = 22.0,
|
||||
chance = 3,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) and mcl_weather.has_rain(pos) then
|
||||
if node.name == "mcl_farming:soil" then
|
||||
minetest.set_node(pos, {name="mcl_farming:soil_wet"})
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local mods_loaded = false
|
||||
local NIGHT_VISION_RATIO = 0.45
|
||||
|
||||
local water_color = "#0b4880"
|
||||
local water_color = "#3F76E4"
|
||||
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
|
||||
|
@ -125,7 +125,14 @@ mcl_weather.skycolor = {
|
|||
local pos = player:get_pos()
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
local has_weather = (mcl_worlds.has_weather(pos) and (mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos))
|
||||
if minetest.get_item_group(minetest.get_node(vector.new(pos.x,pos.y+1.5,pos.z)).name, "water") ~= 0 then
|
||||
local checkname = minetest.get_node(vector.new(pos.x,pos.y+1.5,pos.z)).name
|
||||
if minetest.get_item_group(checkname, "water") ~= 0 then
|
||||
local biome_index = minetest.get_biome_data(player:get_pos()).biome
|
||||
local biome_name = minetest.get_biome_name(biome_index)
|
||||
local biome = minetest.registered_biomes[biome_name]
|
||||
if biome then water_color = biome._mcl_waterfogcolor end
|
||||
if not biome then water_color = "#3F76E4" end
|
||||
if checkname == "mclx_core:river_water_source" or checkname == "mclx_core:river_water_flowing" then water_color = "#0084FF" end
|
||||
player:set_sky({ type = "regular",
|
||||
sky_color = {
|
||||
day_sky = water_color,
|
||||
|
|
|
@ -297,7 +297,7 @@ awards.register_achievement("mcl:whatAdeal", {
|
|||
awards.register_achievement("mcl:tacticalFishing", {
|
||||
title = S("Tactical Fishing"),
|
||||
description = S("Catch a fish... without a fishing rod!"),
|
||||
icon = "pufferfish_bucket.png",
|
||||
icon = "mcl_buckets_pufferfish_bucket.png",
|
||||
type = "Advancement",
|
||||
group = "Husbandry",
|
||||
})
|
||||
|
@ -305,7 +305,7 @@ awards.register_achievement("mcl:tacticalFishing", {
|
|||
awards.register_achievement("mcl:cutestPredator", {
|
||||
title = S("The Cutest Predator"),
|
||||
description = S("Catch an Axolotl with a bucket!"),
|
||||
icon = "axolotl_bucket.png",
|
||||
icon = "mcl_buckets_axolotl_bucket.png",
|
||||
type = "Advancement",
|
||||
group = "Husbandry",
|
||||
})
|
||||
|
|
|
@ -225,8 +225,8 @@ local woods = {
|
|||
{ "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Button") },
|
||||
|
||||
{ "mangrove_wood", "mcl_mangrove:mangrove_wood", "mcl_mangrove_planks.png", S("Mangrove Button") },
|
||||
{ "crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Button") },
|
||||
{ "warped_hyphae_wood", "mcl_crimson:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Button") },
|
||||
{ "crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", "mcl_crimson_crimson_hyphae_wood.png", S("Crimson Button") },
|
||||
{ "warped_hyphae_wood", "mcl_crimson:warped_hyphae_wood", "mcl_crimson_warped_hyphae_wood.png", S("Warped Button") },
|
||||
}
|
||||
|
||||
for w=1, #woods do
|
||||
|
|
|
@ -477,6 +477,19 @@ mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_black")
|
|||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_brown")
|
||||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue")
|
||||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_pink")
|
||||
-- Bamboo
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_endcap")
|
||||
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_1")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_2")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_3")
|
||||
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_door")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_trapdoor")
|
||||
mesecon.register_mvps_unsticky("mcl_signs:wall_sign_bamboo")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:scaffolding")
|
||||
|
||||
-- Beds
|
||||
mesecon.register_mvps_unsticky("mcl_beds:bed_black_top")
|
||||
mesecon.register_mvps_unsticky("mcl_beds:bed_black_bottom")
|
||||
|
|
|
@ -223,8 +223,8 @@ local woods = {
|
|||
{ "junglewood", "mcl_core:junglewood", "default_junglewood.png", S("Jungle Pressure Plate") },
|
||||
|
||||
{ "mangrove_wood", "mcl_mangrove:mangrove_wood", "mcl_mangrove_planks.png", S("Mangrove Pressure Plate") },
|
||||
{ "crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", "crimson_hyphae_wood.png", S("Crimson Pressure Plate") },
|
||||
{ "warped_hyphae_wood", "mcl_crimson:warped_hyphae_wood", "warped_hyphae_wood.png", S("Warped Pressure Plate") },
|
||||
{ "crimson_hyphae_wood", "mcl_crimson:crimson_hyphae_wood", "mcl_crimson_crimson_hyphae_wood.png", S("Crimson Pressure Plate") },
|
||||
{ "warped_hyphae_wood", "mcl_crimson:warped_hyphae_wood", "mcl_crimson_warped_hyphae_wood.png", S("Warped Pressure Plate") },
|
||||
}
|
||||
|
||||
for w=1, #woods do
|
||||
|
|
|
@ -51,8 +51,8 @@ minetest.register_node("mcl_armor_stand:armor_stand", {
|
|||
_doc_items_usagehelp = S("Just place an armor item on the armor stand. To take the top piece of armor from the armor stand, select your hand and use the place key on the armor stand."),
|
||||
drawtype = "mesh",
|
||||
mesh = "3d_armor_stand.obj",
|
||||
inventory_image = "3d_armor_stand_item.png",
|
||||
wield_image = "3d_armor_stand_item.png",
|
||||
inventory_image = "mcl_armor_stand_item.png",
|
||||
wield_image = "mcl_armor_stand_item.png",
|
||||
tiles = {"default_wood.png", "mcl_stairs_stone_slab_top.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
|
|
@ -29,7 +29,7 @@ local bamboo_def = {
|
|||
tiles = {"mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo.png"},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
groups = {handy = 1, axey = 1, choppy = 1, flammable = 3},
|
||||
groups = {handy = 1, axey = 1, choppy = 1, dig_by_piston = 1, plant = 1, non_mycelium_plant = 1, flammable = 3},
|
||||
sounds = node_sound,
|
||||
|
||||
drop = {
|
||||
|
@ -293,7 +293,6 @@ local bamboo_block_def = {
|
|||
|
||||
return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(vector.direction(pointed_thing.above, pointed_thing.under)))
|
||||
end,
|
||||
|
||||
}
|
||||
|
||||
minetest.register_node("mcl_bamboo:bamboo_block", bamboo_block_def)
|
||||
|
|
|
@ -279,7 +279,7 @@ minetest.register_node(SCAFFOLDING_NAME, {
|
|||
climbable = true,
|
||||
physical = true,
|
||||
node_placement_prediction = "",
|
||||
groups = {handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, falling_node = 1, stack_falling = 1},
|
||||
groups = { handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, dig_by_piston = 1, falling_node = 1, stack_falling = 1 },
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_hardness = 0,
|
||||
|
|
|
@ -67,6 +67,32 @@ end
|
|||
|
||||
local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap"
|
||||
|
||||
-- For when I learn more about the pistons...
|
||||
function mcl_bamboo.break_orphaned(pos)
|
||||
mcl_bamboo.mcl_log("Break_Orphaned called.")
|
||||
local node_below = minetest.get_node(vector.offset(pos, 0, -1, 0))
|
||||
local node_name = node_below.name
|
||||
|
||||
-- short circuit checks.
|
||||
if mcl_bamboo.is_dirt(node_name) or mcl_bamboo.is_bamboo(node_name) or mcl_bamboo.is_bamboo(minetest.get_node(pos).name) == false then
|
||||
return
|
||||
end
|
||||
|
||||
-- dig the node.
|
||||
minetest.remove_node(pos) -- if that fails, remove the node
|
||||
local istack = ItemStack("mcl_bamboo:bamboo")
|
||||
local sound_params = {
|
||||
pos = pos,
|
||||
gain = 1.0, -- default
|
||||
max_hear_distance = 10, -- default, uses a Euclidean metric
|
||||
}
|
||||
|
||||
minetest.remove_node(pos)
|
||||
minetest.sound_play(mcl_sounds.node_sound_wood_defaults().dug, sound_params, true)
|
||||
minetest.add_item(pos, istack)
|
||||
end
|
||||
--]]
|
||||
|
||||
function mcl_bamboo.grow_bamboo(pos, bonemeal_applied)
|
||||
local node_above = minetest.get_node(vector.offset(pos, 0, 1, 0))
|
||||
mcl_bamboo.mcl_log("Grow bamboo called; bonemeal: " .. tostring(bonemeal_applied))
|
||||
|
|
|
@ -26,6 +26,7 @@ dofile(minetest.get_modpath(modname) .. "/recipes.lua")
|
|||
|
||||
--ABMs
|
||||
minetest.register_abm({
|
||||
label = "Bamboo Grow",
|
||||
nodenames = mcl_bamboo.bamboo_index,
|
||||
interval = 10,
|
||||
chance = 20,
|
||||
|
@ -34,6 +35,38 @@ minetest.register_abm({
|
|||
end,
|
||||
})
|
||||
|
||||
--[[ TODO: Figure out how to make this work:
|
||||
local function dropper_call(node, pushdir, stack, stackid)
|
||||
mcl_bamboo.mcl_log("mvps_dropper call for bamboo:")
|
||||
-- mcl_bamboo.break_orphaned()
|
||||
|
||||
mcl_bamboo.mcl_log(dump(node))
|
||||
|
||||
end
|
||||
|
||||
if minetest.get_modpath("mesecons_mvps") then
|
||||
if mesecon then
|
||||
mcl_bamboo.mcl_log("registering mvps_dropper for bamboo:")
|
||||
for x = 1, #mcl_bamboo.bamboo_index do
|
||||
mesecon.register_mvps_dropper(mcl_bamboo.bamboo_index[x],dropper_call)
|
||||
mcl_bamboo.mcl_log("registering: " .. mcl_bamboo.bamboo_index[x])
|
||||
end
|
||||
end
|
||||
else
|
||||
end
|
||||
--]]
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Break Orphaned Bamboo",
|
||||
nodenames = mcl_bamboo.bamboo_index,
|
||||
interval = 1.5,
|
||||
chance = 1,
|
||||
action = function(pos, _)
|
||||
mcl_bamboo.break_orphaned(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Base Aliases.
|
||||
local SCAFFOLDING_NAME = "mcl_bamboo:scaffolding"
|
||||
minetest.register_alias("bamboo_block", "mcl_bamboo:bamboo_block")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_bamboo
|
||||
depends = mcl_core, mcl_sounds, mcl_tools
|
||||
optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button
|
||||
optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button, mesecons_mvps
|
||||
author = Michieal
|
|
@ -45,8 +45,8 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
output = BAMBOO .. "_mosaic",
|
||||
recipe = {
|
||||
{"mcl_stair:slab_bamboo_plank"},
|
||||
{"mcl_stair:slab_bamboo_plank"},
|
||||
{"mcl_stairs:slab_bamboo_plank"},
|
||||
{"mcl_stairs:slab_bamboo_plank"},
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -274,7 +274,11 @@ function mcl_beds.sleep()
|
|||
end
|
||||
-- Always clear weather
|
||||
mcl_weather.change_weather("none")
|
||||
elseif mcl_beds.is_night() then
|
||||
elseif mcl_beds.is_night() and weather_mod then
|
||||
mcl_beds.skip_night()
|
||||
mcl_beds.kick_players()
|
||||
mcl_weather.change_weather("none")
|
||||
elseif mcl_beds.is_night() and not weather_mod then
|
||||
mcl_beds.skip_night()
|
||||
mcl_beds.kick_players()
|
||||
end
|
||||
|
|
|
@ -56,7 +56,7 @@ for techname, fishname in pairs(fish_names) do
|
|||
_doc_items_longdesc = S("This bucket is filled with water and @1.", S(fishname)),
|
||||
_doc_items_usagehelp = S("Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 with a bucket of water.", S(fishname), S(fishname)),
|
||||
_tt_help = S("Places a water source and a @1.", S(fishname)),
|
||||
inventory_image = techname .. "_bucket.png",
|
||||
inventory_image = "mcl_buckets_" .. techname .. "_bucket.png",
|
||||
stack_max = 1,
|
||||
groups = {bucket = 1, fish_bucket = 1},
|
||||
liquids_pointable = false,
|
||||
|
|
|
@ -61,9 +61,8 @@ local function sound_take(itemname, pos)
|
|||
end
|
||||
|
||||
local function place_liquid(pos, itemstring)
|
||||
local fullness = registered_nodes[itemstring].liquid_range
|
||||
sound_place(itemstring, pos)
|
||||
add_node(pos, {name=itemstring, param2=fullness})
|
||||
set_node(pos, {name=itemstring})
|
||||
end
|
||||
|
||||
local function give_bucket(new_bucket, itemstack, user)
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
MineClone 2 Campfire API
|
||||
========================
|
||||
`mcl_campfires.register_campfire`
|
||||
---------------------------------
|
||||
Used to register campfires.
|
||||
|
||||
**Example Usage**
|
||||
```
|
||||
mcl_campfires.register_campfire("mcl_campfires:campfire", {
|
||||
description = S("Campfire"),
|
||||
inv_texture = "mcl_campfires_campfire_inv.png",
|
||||
fire_texture = "mcl_campfires_campfire_fire.png",
|
||||
lit_logs_texture = "mcl_campfires_campfire_log_lit.png",
|
||||
drops = "mcl_core:charcoal_lump 2",
|
||||
lightlevel = 14,
|
||||
damage = 1,
|
||||
})
|
||||
```
|
||||
**Values**
|
||||
* description - human readable node name.
|
||||
* inv_texture - campfire inventory texture.
|
||||
* fire_texture - texture of the campfire fire.
|
||||
* lit_logs_texture - texture for the logs of the lit campfire. if not changed, specify mcl_campfires_log.png.
|
||||
* drops - what items drop when the campfire is mined.
|
||||
* lightlevel - the level of light the campfire emits.
|
||||
* damage - amount of damage the campfire deals when the player stands on it.
|
|
@ -0,0 +1,117 @@
|
|||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
mcl_campfires = {}
|
||||
|
||||
function mcl_campfires.register_campfire(name, def)
|
||||
-- Define Campfire
|
||||
minetest.register_node(name, {
|
||||
description = def.description,
|
||||
_tt_help = S("Cooks food and keeps bees happy."),
|
||||
_doc_items_longdesc = S("Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap."),
|
||||
inventory_image = def.inv_texture,
|
||||
wield_image = def.inv_texture,
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_campfires_campfire.obj",
|
||||
tiles = {{name="mcl_campfires_log.png"},},
|
||||
use_texture_alpha = "clip",
|
||||
groups = { handy=1, axey=1, material_wood=1, not_in_creative_inventory=1, campfire=1, },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
if player:get_wielded_item():get_name() == "mcl_fire:flint_and_steel" then
|
||||
node.name = name.."_lit"
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end,
|
||||
drop = def.drops,
|
||||
_mcl_silk_touch_drop = {name},
|
||||
mcl_sounds.node_sound_wood_defaults(),
|
||||
selection_box = {
|
||||
type = 'fixed',
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5}, --left, bottom, front, right, top
|
||||
},
|
||||
collision_box = {
|
||||
type = 'fixed',
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5},
|
||||
},
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
--Define Lit Campfire
|
||||
minetest.register_node(name.."_lit", {
|
||||
description = def.description,
|
||||
_tt_help = S("Cooks food and keeps bees happy."),
|
||||
_doc_items_longdesc = S("Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap."),
|
||||
inventory_image = def.inv_texture,
|
||||
wield_image = def.inv_texture,
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_campfires_campfire_lit.obj",
|
||||
tiles = {{
|
||||
name=def.fire_texture,
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=2.0
|
||||
}},
|
||||
{name=def.lit_logs_texture,
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=2.0
|
||||
}}
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
groups = { handy=1, axey=1, material_wood=1, campfire=1, lit_campfire=1 },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
if player:get_wielded_item():get_name():find("shovel") then
|
||||
node.name = name
|
||||
minetest.set_node(pos, node)
|
||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
|
||||
end
|
||||
end,
|
||||
drop = def.drops,
|
||||
_mcl_silk_touch_drop = {name.."_lit"},
|
||||
light_source = def.lightlevel,
|
||||
mcl_sounds.node_sound_wood_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5}, --left, bottom, front, right, top
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5},
|
||||
},
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
damage_per_second = def.damage,
|
||||
})
|
||||
end
|
||||
|
||||
local function burn_in_campfire(obj)
|
||||
local p = obj:get_pos()
|
||||
if p then
|
||||
local n = minetest.find_node_near(p,0.4,{"group:lit_campfire"},true)
|
||||
if n then
|
||||
mcl_burning.set_on_fire(obj, 5)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local etime = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
etime = dtime + etime
|
||||
if etime < 0.5 then return end
|
||||
etime = 0
|
||||
for _,pl in pairs(minetest.get_connected_players()) do
|
||||
burn_in_campfire(pl)
|
||||
end
|
||||
for _,ent in pairs(minetest.luaentities) do
|
||||
if ent.is_mob then
|
||||
burn_in_campfire(ent.object)
|
||||
end
|
||||
end
|
||||
end)
|
|
@ -1,147 +1,9 @@
|
|||
-- ||||||||||||||||||||||||||||||||
|
||||
-- ||||||||||| CAMPFIRES ||||||||||
|
||||
-- ||||||||||||||||||||||||||||||||
|
||||
|
||||
-- TO-DO:
|
||||
-- * Add Smoke Particles
|
||||
-- * Add Spark Particles
|
||||
-- * Add Cooking Meat
|
||||
-- * Add Working Sounds
|
||||
local modname = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local campfires = {
|
||||
{ name = "Campfire", lightlevel = 14, techname = "campfire", damage = 1, drops = "mcl_core:charcoal_lump 2" },
|
||||
{ name = "Soul Campfire", lightlevel = 10, techname = "soul_campfire", damage = 2, drops = "mcl_blackstone:soul_soil" },
|
||||
}
|
||||
|
||||
for _, campfire in pairs(campfires) do
|
||||
-- Define Campfire
|
||||
minetest.register_node("mcl_campfires:" .. campfire.techname, {
|
||||
description = S(campfire.name),
|
||||
_tt_help = S("Cooks food and keeps bees happy."),
|
||||
_doc_items_longdesc = S("Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap."),
|
||||
inventory_image = "mcl_campfires_" .. campfire.techname .. "_inv.png",
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_campfires_campfire.obj",
|
||||
tiles = {{name="mcl_campfires_log.png"},},
|
||||
use_texture_alpha = "clip",
|
||||
groups = { handy=1, axey=1, material_wood=1, not_in_creative_inventory=1, campfire=1, },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
if player:get_wielded_item():get_name() == "mcl_fire:flint_and_steel" then
|
||||
node.name = "mcl_campfires:" .. campfire.techname .. "_lit"
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end,
|
||||
drop = campfire.drops,
|
||||
_mcl_silk_touch_drop = {"mcl_campfires:" .. campfire.techname},
|
||||
mcl_sounds.node_sound_wood_defaults(),
|
||||
selection_box = {
|
||||
type = 'fixed',
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5}, --left, bottom, front, right, top
|
||||
},
|
||||
collision_box = {
|
||||
type = 'fixed',
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5},
|
||||
},
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
--Define Lit Campfire
|
||||
minetest.register_node("mcl_campfires:" .. campfire.techname .. "_lit", {
|
||||
description = S(campfire.name),
|
||||
_tt_help = S("Cooks food and keeps bees happy."),
|
||||
_doc_items_longdesc = S("Campfires have multiple uses, including keeping bees happy, cooking raw meat and fish, and as a trap."),
|
||||
inventory_image = "mcl_campfires_" .. campfire.techname .. "_inv.png",
|
||||
drawtype = "mesh",
|
||||
mesh = "mcl_campfires_campfire_lit.obj",
|
||||
tiles = {{
|
||||
name="mcl_campfires_" .. campfire.techname .. "_fire.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=2.0
|
||||
}},
|
||||
{name="mcl_campfires_" .. campfire.techname .. "_log_lit.png",
|
||||
animation={
|
||||
type="vertical_frames",
|
||||
aspect_w=16,
|
||||
aspect_h=16,
|
||||
length=2.0
|
||||
}}
|
||||
},
|
||||
use_texture_alpha = "clip",
|
||||
groups = { handy=1, axey=1, material_wood=1, campfire=1, lit_campfire=1 },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
if player:get_wielded_item():get_name():find("shovel") then
|
||||
node.name = "mcl_campfires:" .. campfire.techname
|
||||
minetest.set_node(pos, node)
|
||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
|
||||
end
|
||||
end,
|
||||
drop = campfire.drops,
|
||||
_mcl_silk_touch_drop = {"mcl_campfires:" .. campfire.techname .. "_lit"},
|
||||
light_source = campfire.lightlevel,
|
||||
mcl_sounds.node_sound_wood_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5}, --left, bottom, front, right, top
|
||||
},
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {-.5, -.5, -.5, .5, -.05, .5},
|
||||
},
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
damage_per_second = campfire.damage,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_campfires:campfire_lit",
|
||||
recipe = {
|
||||
{ "", "mcl_core:stick", "" },
|
||||
{ "mcl_core:stick", "group:coal", "mcl_core:stick" },
|
||||
{ "group:tree", "group:tree", "group:tree" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_campfires:soul_campfire_lit",
|
||||
recipe = {
|
||||
{ "", "mcl_core:stick", "" },
|
||||
{ "mcl_core:stick", "group:soul_block", "mcl_core:stick" },
|
||||
{ "group:tree", "group:tree", "group:tree" },
|
||||
}
|
||||
})
|
||||
|
||||
local function burn_in_campfire(obj)
|
||||
local p = obj:get_pos()
|
||||
if p then
|
||||
local n = minetest.find_node_near(p,0.4,{"group:lit_campfire"},true)
|
||||
if n then
|
||||
mcl_burning.set_on_fire(obj, 5)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local etime = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
etime = dtime + etime
|
||||
if etime < 0.5 then return end
|
||||
etime = 0
|
||||
for _,pl in pairs(minetest.get_connected_players()) do
|
||||
burn_in_campfire(pl)
|
||||
end
|
||||
for _,ent in pairs(minetest.luaentities) do
|
||||
if ent.is_mob then
|
||||
burn_in_campfire(ent.object)
|
||||
end
|
||||
end
|
||||
end)
|
||||
dofile(modname.."/api.lua") -- Load API File
|
||||
dofile(modname.."/register.lua") -- Load Campfire Registration File
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
-- Register Plain Campfire
|
||||
mcl_campfires.register_campfire("mcl_campfires:campfire", {
|
||||
description = S("Campfire"),
|
||||
inv_texture = "mcl_campfires_campfire_inv.png",
|
||||
fire_texture = "mcl_campfires_campfire_fire.png",
|
||||
lit_logs_texture = "mcl_campfires_campfire_log_lit.png",
|
||||
drops = "mcl_core:charcoal_lump 2",
|
||||
lightlevel = 14,
|
||||
damage = 1,
|
||||
})
|
||||
|
||||
-- Register Soul Campfire
|
||||
mcl_campfires.register_campfire("mcl_campfires:soul_campfire", {
|
||||
description = S("Soul Campfire"),
|
||||
inv_texture = "mcl_campfires_soul_campfire_inv.png",
|
||||
fire_texture = "mcl_campfires_soul_campfire_fire.png",
|
||||
lit_logs_texture = "mcl_campfires_soul_campfire_log_lit.png",
|
||||
drops = "mcl_blackstone:soul_soil",
|
||||
lightlevel = 10,
|
||||
damage = 2,
|
||||
})
|
||||
|
||||
-- Register Campfire Crafting
|
||||
minetest.register_craft({
|
||||
output = "mcl_campfires:campfire_lit",
|
||||
recipe = {
|
||||
{ "", "mcl_core:stick", "" },
|
||||
{ "mcl_core:stick", "group:coal", "mcl_core:stick" },
|
||||
{ "group:tree", "group:tree", "group:tree" },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_campfires:soul_campfire_lit",
|
||||
recipe = {
|
||||
{ "", "mcl_core:stick", "" },
|
||||
{ "mcl_core:stick", "group:soul_block", "mcl_core:stick" },
|
||||
{ "group:tree", "group:tree", "group:tree" },
|
||||
}
|
||||
})
|
|
@ -1,14 +1,14 @@
|
|||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
-- Cartography Table Code. Used to create and copy maps. Needs a GUI still.
|
||||
-- Cartography Table Code. Used to create and copy maps. TODO: Needs a GUI still.
|
||||
|
||||
minetest.register_node("mcl_cartography_table:cartography_table", {
|
||||
description = S("Cartography Table"),
|
||||
_tt_help = S("Used to create or copy maps"),
|
||||
_doc_items_longdesc = S("Is used to create or copy maps for use.."),
|
||||
tiles = {
|
||||
"cartography_table_top.png", "cartography_table_side3.png",
|
||||
"cartography_table_side3.png", "cartography_table_side2.png",
|
||||
"cartography_table_side3.png", "cartography_table_side1.png"
|
||||
"mcl_cartography_table_top.png", "mcl_cartography_table_side3.png",
|
||||
"mcl_cartography_table_side3.png", "mcl_cartography_table_side2.png",
|
||||
"mcl_cartography_table_side3.png", "mcl_cartography_table_side1.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = { axey = 2, handy = 1, deco_block = 1, material_wood = 1, flammable = 1 },
|
||||
|
|
|
@ -67,12 +67,12 @@ local function register_filled_cauldron(water_level, description, liquid)
|
|||
local water_tex
|
||||
if liquid == "river_water" then
|
||||
id = id .. "r"
|
||||
water_tex = "default_river_water_source_animated.png^[verticalframe:16:0"
|
||||
water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#0084FF"
|
||||
elseif liquid == "lava" then
|
||||
id = id .. "_lava"
|
||||
water_tex = "default_lava_source_animated.png^[verticalframe:16:0"
|
||||
else
|
||||
water_tex = "default_water_source_animated.png^[verticalframe:16:0"
|
||||
water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#3F76E4"
|
||||
end
|
||||
minetest.register_node(id, {
|
||||
description = description,
|
||||
|
|
|
@ -405,6 +405,7 @@ function mcl_core.generate_tree(pos, tree_type, options)
|
|||
elseif tree_type == BIRCH_TREE_ID then
|
||||
mcl_core.generate_birch_tree(pos)
|
||||
end
|
||||
mcl_core.update_sapling_foliage_colors(pos)
|
||||
end
|
||||
|
||||
-- Classic oak in v6 style
|
||||
|
@ -801,23 +802,19 @@ end
|
|||
|
||||
local grass_spread_randomizer = PseudoRandom(minetest.get_mapgen_setting("seed"))
|
||||
|
||||
function mcl_core.get_grass_palette_index(pos)
|
||||
local biome_data = minetest.get_biome_data(pos)
|
||||
local index = 0
|
||||
if biome_data then
|
||||
local biome = biome_data.biome
|
||||
local biome_name = minetest.get_biome_name(biome)
|
||||
local reg_biome = minetest.registered_biomes[biome_name]
|
||||
if reg_biome then
|
||||
index = reg_biome._mcl_grass_palette_index
|
||||
end
|
||||
end
|
||||
return index
|
||||
end
|
||||
|
||||
-- Return appropriate grass block node for pos
|
||||
function mcl_core.get_grass_block_type(pos)
|
||||
return {name = "mcl_core:dirt_with_grass", param2 = mcl_core.get_grass_palette_index(pos)}
|
||||
return {name = minetest.get_node(pos).name, param2 = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index}
|
||||
end
|
||||
|
||||
-- Return appropriate foliage block node for pos
|
||||
function mcl_core.get_foliage_block_type(pos)
|
||||
return {name = minetest.get_node(pos).name, param2 = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index}
|
||||
end
|
||||
|
||||
-- Return appropriate water block node for pos
|
||||
function mcl_core.get_water_block_type(pos)
|
||||
return {name = minetest.get_node(pos).name, param2 = mcl_util.get_palette_indexes_from_pos(pos).water_palette_index}
|
||||
end
|
||||
|
||||
------------------------------
|
||||
|
@ -927,30 +924,19 @@ minetest.register_lbm({
|
|||
label = "Replace legacy dry grass",
|
||||
name = "mcl_core:replace_legacy_dry_grass_0_65_0",
|
||||
nodenames = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"},
|
||||
run_at_every_load = true,
|
||||
action = function(pos, node)
|
||||
local biome_data = minetest.get_biome_data(pos)
|
||||
if biome_data then
|
||||
local biome = biome_data.biome
|
||||
local biome_name = minetest.get_biome_name(biome)
|
||||
local reg_biome = minetest.registered_biomes[biome_name]
|
||||
if reg_biome then
|
||||
if node.name == "mcl_core:dirt_with_dry_grass_snow" then
|
||||
node.name = "mcl_core:dirt_with_grass_snow"
|
||||
else
|
||||
node.name = "mcl_core:dirt_with_grass"
|
||||
end
|
||||
node.param2 = reg_biome._mcl_grass_palette_index
|
||||
-- Fall back to savanna palette index
|
||||
-- use savanna palette index to simulate dry grass.
|
||||
if not node.param2 then
|
||||
node.param2 = SAVANNA_INDEX
|
||||
end
|
||||
minetest.set_node(pos, node)
|
||||
return
|
||||
end
|
||||
end
|
||||
node.param2 = SAVANNA_INDEX
|
||||
minetest.set_node(pos, node)
|
||||
return
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -1084,6 +1070,16 @@ local grow_acacia = sapling_grow_action(ACACIA_TREE_ID, 2, true, false)
|
|||
local grow_spruce = sapling_grow_action(SPRUCE_TREE_ID, 1, true, true, "mcl_core:sprucesapling")
|
||||
local grow_birch = sapling_grow_action(BIRCH_TREE_ID, 1, true, false)
|
||||
|
||||
function mcl_core.update_sapling_foliage_colors(pos)
|
||||
local pos1, pos2 = vector.offset(pos, -8, 0, -8), vector.offset(pos, 8, 30, 8)
|
||||
local fnode
|
||||
local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"})
|
||||
for _, fpos in pairs(foliage) do
|
||||
fnode = minetest.get_node(fpos)
|
||||
minetest.set_node(fpos, fnode)
|
||||
end
|
||||
end
|
||||
|
||||
-- Attempts to grow the sapling at the specified position
|
||||
-- pos: Position
|
||||
-- node: Node table of the node at this position, from minetest.get_node
|
||||
|
|
|
@ -127,7 +127,7 @@ minetest.register_node("mcl_core:reeds", {
|
|||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.param2 == 0 then
|
||||
node.param2 = mcl_core.get_grass_palette_index(pos)
|
||||
node.param2 = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
|
||||
if node.param2 ~= 0 then
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
|
|
|
@ -92,11 +92,13 @@ minetest.register_node("mcl_core:vine", {
|
|||
_doc_items_longdesc = S("Vines are climbable blocks which can be placed on the sides of solid full-cube blocks. Vines slowly grow and spread."),
|
||||
drawtype = "signlike",
|
||||
tiles = {"mcl_core_vine.png"},
|
||||
color = "#48B518",
|
||||
inventory_image = "mcl_core_vine.png",
|
||||
wield_image = "mcl_core_vine.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "wallmounted",
|
||||
paramtype2 = "colorwallmounted",
|
||||
palette = "[combine:16x2:0,0=mcl_core_palette_foliage.png",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
buildable_to = true,
|
||||
|
@ -107,7 +109,7 @@ minetest.register_node("mcl_core:vine", {
|
|||
groups = {
|
||||
handy = 1, axey = 1, shearsy = 1, swordy = 1, deco_block = 1,
|
||||
dig_by_piston = 1, destroy_by_lava_flow = 1, compostability = 50,
|
||||
flammable = 2, fire_encouragement = 15, fire_flammability = 100
|
||||
flammable = 2, fire_encouragement = 15, fire_flammability = 100, foliage_palette_wallmounted = 1
|
||||
},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
drop = "",
|
||||
|
@ -155,6 +157,20 @@ minetest.register_node("mcl_core:vine", {
|
|||
return itemstack
|
||||
end,
|
||||
|
||||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index
|
||||
if node.name == "mcl_core:vine" then
|
||||
local biome_param2 = foliage_palette_index
|
||||
local rotation_param2 = node.param2
|
||||
local final_param2 = (biome_param2 * 8) + rotation_param2
|
||||
if node.param2 ~= final_param2 and rotation_param2 < 6 then
|
||||
node.param2 = final_param2
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
-- If dug, also dig a “dependant” vine below it.
|
||||
-- A vine is dependant if it hangs from this node and has no supporting block.
|
||||
on_dig = function(pos, node, digger)
|
||||
|
|
|
@ -25,14 +25,15 @@ minetest.register_node("mcl_core:water_flowing", {
|
|||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}
|
||||
},
|
||||
{
|
||||
image="default_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}
|
||||
},
|
||||
},
|
||||
color = "#3F76E4",
|
||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||
|
@ -50,7 +51,7 @@ minetest.register_node("mcl_core:water_flowing", {
|
|||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 7,
|
||||
waving = 3,
|
||||
post_effect_color = {a=60, r=0x03, g=0x3C, b=0x5C},
|
||||
post_effect_color = {a=60, r=24.7, g=46.3, b=89.4},
|
||||
groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1},
|
||||
_mcl_blast_resistance = 100,
|
||||
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
|
||||
|
@ -70,20 +71,23 @@ S("• When water is directly below lava, the water turns into stone."),
|
|||
drawtype = "liquid",
|
||||
waving = 3,
|
||||
tiles = {
|
||||
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
|
||||
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
|
||||
},
|
||||
special_tiles = {
|
||||
-- New-style water source material (mostly unused)
|
||||
{
|
||||
name="default_water_source_animated.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0},
|
||||
backface_culling = false,
|
||||
}
|
||||
},
|
||||
color = "#3F76E4",
|
||||
sounds = mcl_sounds.node_sound_water_defaults(),
|
||||
is_ground_content = false,
|
||||
use_texture_alpha = USE_TEXTURE_ALPHA,
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "mcl_core_palette_water.png",
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
|
@ -95,12 +99,21 @@ S("• When water is directly below lava, the water turns into stone."),
|
|||
liquid_alternative_source = "mcl_core:water_source",
|
||||
liquid_viscosity = WATER_VISC,
|
||||
liquid_range = 7,
|
||||
post_effect_color = {a=60, r=0x03, g=0x3C, b=0x5C},
|
||||
post_effect_color = {a=60, r=24.7, g=46.3, b=89.4},
|
||||
stack_max = 64,
|
||||
groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1},
|
||||
groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1, water_palette=1},
|
||||
_mcl_blast_resistance = 100,
|
||||
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
|
||||
_mcl_hardness = -1,
|
||||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.param2 == 0 then
|
||||
local new_node = mcl_core.get_water_block_type(pos)
|
||||
if new_node.param2 ~= 0 then
|
||||
minetest.swap_node(pos, new_node)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:lava_flowing", {
|
||||
|
@ -245,3 +258,22 @@ if minetest.settings:get("mcl_node_particles") == "full" then
|
|||
end,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_on_liquid_transformed(function(pos_list, node_list)
|
||||
for _, fwpos in pairs(pos_list) do
|
||||
local fwnode = minetest.get_node(fwpos)
|
||||
if minetest.get_item_group(fwnode, "palette_index") ~= 1 then
|
||||
local pos1, pos2 = vector.offset(fwpos, -1, -1, -1), vector.offset(fwpos, 1, 1, 1)
|
||||
local water = minetest.find_nodes_in_area(pos1, pos2, {"group:water_palette"})
|
||||
for _, wpos in pairs(water) do
|
||||
local wnode = minetest.get_node(wpos)
|
||||
local water_palette_index = mcl_util.get_palette_indexes_from_pos(wpos).water_palette_index
|
||||
if wnode.param2 ~= water_palette_index then
|
||||
wnode.param2 = water_palette_index
|
||||
minetest.set_node(wpos, wnode)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
|
|
@ -15,11 +15,10 @@ end
|
|||
--
|
||||
-- Whenever a trunk node is removed, all `group:leaves` nodes in a sphere
|
||||
-- with radius 6 are checked. Every such node that does not have a trunk
|
||||
-- node within a distance of 6 blocks is converted into a orphan leaf node.
|
||||
-- node within a distance of 6 blocks and wasn't placed by a player is
|
||||
-- converted into a orphan leaf node.
|
||||
-- An ABM will gradually decay these nodes.
|
||||
--
|
||||
-- If param2 of the node is set to a nonzero value, the node will always
|
||||
-- be preserved. This is set automatically when leaves are placed manually.
|
||||
--
|
||||
-- @param pos the position of the removed trunk node.
|
||||
-- @param oldnode the node table of the removed trunk node.
|
||||
|
@ -29,17 +28,15 @@ function mcl_core.update_leaves(pos, oldnode)
|
|||
local leaves = minetest.find_nodes_in_area(pos1, pos2, "group:leaves")
|
||||
for _, lpos in pairs(leaves) do
|
||||
lnode = minetest.get_node(lpos)
|
||||
-- skip already decaying leaf nodes
|
||||
if minetest.get_item_group(lnode.name, "orphan_leaves") ~= 1 then
|
||||
lmeta = minetest.get_meta(lpos)
|
||||
-- skip already decaying leaf nodes and player leaves
|
||||
if minetest.get_item_group(lnode.name, "orphan_leaves") ~= 1 and lmeta:get_int("player_leaves") ~= 1 then
|
||||
if not minetest.find_node_near(lpos, 6, "group:tree") then
|
||||
-- manually placed leaf nodes have param2
|
||||
-- set and will never decay automatically
|
||||
if lnode.param2 == 0 then
|
||||
local orphan_name = lnode.name .. "_orphan"
|
||||
local def = minetest.registered_nodes[orphan_name]
|
||||
if def then
|
||||
--minetest.log("Registered: ".. orphan_name)
|
||||
minetest.swap_node(lpos, {name = orphan_name})
|
||||
minetest.set_node(lpos, {name = orphan_name})
|
||||
else
|
||||
--minetest.log("Not registered: ".. orphan_name)
|
||||
end
|
||||
|
@ -47,6 +44,10 @@ function mcl_core.update_leaves(pos, oldnode)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_core.make_player_leaves(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("player_leaves", 1)
|
||||
end
|
||||
|
||||
-- Register tree trunk (wood) and bark
|
||||
|
@ -149,7 +150,7 @@ local function register_wooden_planks(subname, description, tiles)
|
|||
})
|
||||
end
|
||||
|
||||
local function register_leaves(subname, description, longdesc, tiles, sapling, drop_apples, sapling_chances)
|
||||
local function register_leaves(subname, description, longdesc, tiles, color, paramtype2, sapling, drop_apples, sapling_chances, foliage_palette)
|
||||
local apple_chances = {200, 180, 160, 120, 40}
|
||||
local stick_chances = {50, 45, 30, 35, 10}
|
||||
|
||||
|
@ -186,14 +187,16 @@ local function register_leaves(subname, description, longdesc, tiles, sapling, d
|
|||
_doc_items_hidden = false,
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 2,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
tiles = tiles,
|
||||
color = color,
|
||||
paramtype = "light",
|
||||
paramtype2 = paramtype2,
|
||||
palette = "mcl_core_palette_foliage.png",
|
||||
stack_max = 64,
|
||||
groups = {
|
||||
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
|
||||
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
|
||||
leaves = 1, deco_block = 1, compostability = 30
|
||||
leaves = 1, deco_block = 1, compostability = 30, foliage_palette = foliage_palette
|
||||
},
|
||||
drop = get_drops(0),
|
||||
_mcl_shears_drop = true,
|
||||
|
@ -202,13 +205,24 @@ local function register_leaves(subname, description, longdesc, tiles, sapling, d
|
|||
_mcl_hardness = 0.2,
|
||||
_mcl_silk_touch_drop = true,
|
||||
_mcl_fortune_drop = { get_drops(1), get_drops(2), get_drops(3), get_drops(4) },
|
||||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.param2 == 0 then
|
||||
local new_node = mcl_core.get_foliage_block_type(pos)
|
||||
if new_node.param2 ~= 0 then
|
||||
minetest.swap_node(pos, new_node)
|
||||
end
|
||||
end
|
||||
end,
|
||||
after_place_node = function(pos)
|
||||
mcl_core.make_player_leaves(pos) -- Leaves placed by the player should always be player leaves.
|
||||
end,
|
||||
}
|
||||
|
||||
minetest.register_node("mcl_core:" .. subname, l_def)
|
||||
|
||||
local o_def = table.copy(l_def)
|
||||
o_def._doc_items_create_entry = false
|
||||
o_def.place_param2 = nil
|
||||
o_def.groups.not_in_creative_inventory = 1
|
||||
o_def.groups.orphan_leaves = 1
|
||||
o_def._mcl_shears_drop = {"mcl_core:" .. subname}
|
||||
|
@ -310,12 +324,12 @@ register_sapling("birchsapling", S("Birch Sapling"),
|
|||
"mcl_core_sapling_birch.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16})
|
||||
|
||||
|
||||
register_leaves("leaves", S("Oak Leaves"), S("Oak leaves are grown from oak trees."), {"default_leaves.png"}, "mcl_core:sapling", true, {20, 16, 12, 10})
|
||||
register_leaves("darkleaves", S("Dark Oak Leaves"), S("Dark oak leaves are grown from dark oak trees."), {"mcl_core_leaves_big_oak.png"}, "mcl_core:darksapling", true, {20, 16, 12, 10})
|
||||
register_leaves("jungleleaves", S("Jungle Leaves"), S("Jungle leaves are grown from jungle trees."), {"default_jungleleaves.png"}, "mcl_core:junglesapling", false, {40, 26, 32, 24, 10})
|
||||
register_leaves("acacialeaves", S("Acacia Leaves"), S("Acacia leaves are grown from acacia trees."), {"default_acacia_leaves.png"}, "mcl_core:acaciasapling", false, {20, 16, 12, 10})
|
||||
register_leaves("spruceleaves", S("Spruce Leaves"), S("Spruce leaves are grown from spruce trees."), {"mcl_core_leaves_spruce.png"}, "mcl_core:sprucesapling", false, {20, 16, 12, 10})
|
||||
register_leaves("birchleaves", S("Birch Leaves"), S("Birch leaves are grown from birch trees."), {"mcl_core_leaves_birch.png"}, "mcl_core:birchsapling", false, {20, 16, 12, 10})
|
||||
register_leaves("leaves", S("Oak Leaves"), S("Oak leaves are grown from oak trees."), {"default_leaves.png"}, "#48B518", "color", "mcl_core:sapling", true, {20, 16, 12, 10}, 1)
|
||||
register_leaves("darkleaves", S("Dark Oak Leaves"), S("Dark oak leaves are grown from dark oak trees."), {"mcl_core_leaves_big_oak.png"}, "#48B518", "color", "mcl_core:darksapling", true, {20, 16, 12, 10}, 1)
|
||||
register_leaves("jungleleaves", S("Jungle Leaves"), S("Jungle leaves are grown from jungle trees."), {"default_jungleleaves.png"}, "#48B518", "color", "mcl_core:junglesapling", false, {40, 26, 32, 24, 10}, 1)
|
||||
register_leaves("acacialeaves", S("Acacia Leaves"), S("Acacia leaves are grown from acacia trees."), {"default_acacia_leaves.png"}, "#48B518", "color", "mcl_core:acaciasapling", false, {20, 16, 12, 10}, 1)
|
||||
register_leaves("spruceleaves", S("Spruce Leaves"), S("Spruce leaves are grown from spruce trees."), {"mcl_core_leaves_spruce.png"}, "#619961", "none", "mcl_core:sprucesapling", false, {20, 16, 12, 10}, 0)
|
||||
register_leaves("birchleaves", S("Birch Leaves"), S("Birch leaves are grown from birch trees."), {"mcl_core_leaves_birch.png"}, "#80A755", "none", "mcl_core:birchsapling", false, {20, 16, 12, 10}, 0)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -66,11 +66,13 @@ local function spread_nether_plants(pos,node)
|
|||
end
|
||||
|
||||
minetest.register_node("mcl_crimson:warped_fungus", {
|
||||
description = S("Warped Fungus Mushroom"),
|
||||
description = S("Warped Fungus"),
|
||||
_tt_help = S("Warped fungus is a mushroom found in the nether's warped forest."),
|
||||
_doc_items_longdesc = S("Warped fungus is a mushroom found in the nether's warped forest."),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "farming_warped_fungus.png" },
|
||||
inventory_image = "farming_warped_fungus.png",
|
||||
wield_image = "farming_warped_fungus.png",
|
||||
tiles = { "mcl_crimson_warped_fungus.png" },
|
||||
inventory_image = "mcl_crimson_warped_fungus.png",
|
||||
wield_image = "mcl_crimson_warped_fungus.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
|
@ -95,15 +97,15 @@ minetest.register_node("mcl_crimson:warped_fungus", {
|
|||
|
||||
mcl_flowerpots.register_potted_flower("mcl_crimson:warped_fungus", {
|
||||
name = "warped fungus",
|
||||
desc = S("Warped Fungus Mushroom"),
|
||||
image = "farming_warped_fungus.png",
|
||||
desc = S("Warped Fungus"),
|
||||
image = "mcl_crimson_warped_fungus.png",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_crimson:twisting_vines", {
|
||||
description = S("Twisting Vines"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "twisting_vines_plant.png" },
|
||||
inventory_image = "twisting_vines.png",
|
||||
tiles = { "mcl_crimson_twisting_vines_plant.png" },
|
||||
inventory_image = "mcl_crimson_twisting_vines.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
|
@ -252,8 +254,8 @@ minetest.register_node("mcl_crimson:weeping_vines", {
|
|||
minetest.register_node("mcl_crimson:nether_sprouts", {
|
||||
description = S("Nether Sprouts"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "nether_sprouts.png" },
|
||||
inventory_image = "nether_sprouts.png",
|
||||
tiles = { "mcl_crimson_nether_sprouts.png" },
|
||||
inventory_image = "mcl_crimson_nether_sprouts.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
|
@ -274,8 +276,8 @@ minetest.register_node("mcl_crimson:nether_sprouts", {
|
|||
minetest.register_node("mcl_crimson:warped_roots", {
|
||||
description = S("Warped Roots"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "warped_roots.png" },
|
||||
inventory_image = "warped_roots.png",
|
||||
tiles = { "mcl_crimson_warped_roots.png" },
|
||||
inventory_image = "mcl_crimson_warped_roots.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
|
@ -294,13 +296,13 @@ minetest.register_node("mcl_crimson:warped_roots", {
|
|||
mcl_flowerpots.register_potted_flower("mcl_crimson:warped_roots", {
|
||||
name = "warped roots",
|
||||
desc = S("Warped Roots"),
|
||||
image = "warped_roots.png",
|
||||
image = "mcl_crimson_warped_roots.png",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("mcl_crimson:warped_wart_block", {
|
||||
description = S("Warped Wart Block"),
|
||||
tiles = {"warped_wart_block.png"},
|
||||
tiles = {"mcl_crimson_warped_stem_stripped_side.png"},
|
||||
groups = {handy = 1, hoey = 7, swordy = 1, deco_block = 1, compostability = 85},
|
||||
_mcl_hardness = 1,
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults({
|
||||
|
@ -311,7 +313,7 @@ minetest.register_node("mcl_crimson:warped_wart_block", {
|
|||
|
||||
minetest.register_node("mcl_crimson:shroomlight", {
|
||||
description = S("Shroomlight"),
|
||||
tiles = {"shroomlight.png"},
|
||||
tiles = {"mcl_crimson_shroomlight.png"},
|
||||
groups = {handy = 1, hoey = 7, swordy = 1, deco_block = 1, compostability = 65},
|
||||
light_source = minetest.LIGHT_MAX,
|
||||
_mcl_hardness = 1,
|
||||
|
@ -326,10 +328,10 @@ minetest.register_node("mcl_crimson:warped_hyphae", {
|
|||
_doc_items_longdesc = S("The stem of a warped hyphae"),
|
||||
_doc_items_hidden = false,
|
||||
tiles = {
|
||||
"warped_hyphae.png",
|
||||
"warped_hyphae.png",
|
||||
"mcl_crimson_warped_hyphae.png",
|
||||
"mcl_crimson_warped_hyphae.png",
|
||||
{
|
||||
image="warped_hyphae_side.png",
|
||||
image="mcl_crimson_warped_hyphae_side.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}
|
||||
},
|
||||
},
|
||||
|
@ -345,12 +347,12 @@ minetest.register_node("mcl_crimson:warped_hyphae", {
|
|||
minetest.register_node("mcl_crimson:warped_nylium", {
|
||||
description = S("Warped Nylium"),
|
||||
tiles = {
|
||||
"warped_nylium.png",
|
||||
"mcl_crimson_warped_nylium.png",
|
||||
"mcl_nether_netherrack.png",
|
||||
"mcl_nether_netherrack.png^warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_warped_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_warped_nylium_side.png",
|
||||
},
|
||||
is_ground_content = true,
|
||||
drop = "mcl_nether:netherrack",
|
||||
|
@ -368,7 +370,7 @@ minetest.register_node("mcl_crimson:warped_hyphae_bark", {
|
|||
_doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."),
|
||||
tiles = {
|
||||
{
|
||||
image="warped_hyphae_side.png",
|
||||
image="mcl_crimson_warped_hyphae_side.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}
|
||||
},
|
||||
},
|
||||
|
@ -394,7 +396,7 @@ minetest.register_node("mcl_crimson:stripped_warped_hyphae", {
|
|||
description = S("Stripped Warped Hyphae"),
|
||||
_doc_items_longdesc = S("The stripped hyphae of a warped fungus"),
|
||||
_doc_items_hidden = false,
|
||||
tiles = {"warped_stem_stripped_top.png", "warped_stem_stripped_top.png", "warped_stem_stripped_side.png"},
|
||||
tiles = {"mcl_crimson_warped_stem_stripped_top.png", "mcl_crimson_warped_stem_stripped_top.png", "mcl_crimson_warped_stem_stripped_side.png"},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1},
|
||||
|
@ -406,7 +408,7 @@ minetest.register_node("mcl_crimson:stripped_warped_hyphae", {
|
|||
minetest.register_node("mcl_crimson:stripped_warped_hyphae_bark", {
|
||||
description = S("Stripped Warped Hyphae Bark"),
|
||||
_doc_items_longdesc = S("The stripped hyphae bark of a warped fungus"),
|
||||
tiles = {"warped_stem_stripped_side.png"},
|
||||
tiles = {"mcl_crimson_warped_stem_stripped_side.png"},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1},
|
||||
|
@ -426,7 +428,7 @@ minetest.register_craft({
|
|||
|
||||
minetest.register_node("mcl_crimson:warped_hyphae_wood", {
|
||||
description = S("Warped Hyphae Wood"),
|
||||
tiles = {"warped_hyphae_wood.png"},
|
||||
tiles = {"mcl_crimson_warped_hyphae_wood.png"},
|
||||
groups = {handy = 5,axey = 1, flammable = 3, wood=1,building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_hardness = 2,
|
||||
|
@ -450,11 +452,13 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_node("mcl_crimson:crimson_fungus", {
|
||||
description = S("Crimson Fungus Mushroom"),
|
||||
description = S("Crimson Fungus"),
|
||||
_tt_help = S("Crimson fungus is a mushroom found in the nether's crimson forest."),
|
||||
_doc_items_longdesc = S("Crimson fungus is a mushroom found in the nether's crimson forest."),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "farming_crimson_fungus.png" },
|
||||
inventory_image = "farming_crimson_fungus.png",
|
||||
wield_image = "farming_crimson_fungus.png",
|
||||
tiles = { "mcl_crimson_crimson_fungus.png" },
|
||||
inventory_image = "mcl_crimson_crimson_fungus.png",
|
||||
wield_image = "mcl_crimson_crimson_fungus.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
|
@ -483,15 +487,15 @@ minetest.register_node("mcl_crimson:crimson_fungus", {
|
|||
|
||||
mcl_flowerpots.register_potted_flower("mcl_crimson:crimson_fungus", {
|
||||
name = "crimson fungus",
|
||||
desc = S("Crimson Fungus Mushroom"),
|
||||
image = "farming_crimson_fungus.png",
|
||||
desc = S("Crimson Fungus"),
|
||||
image = "mcl_crimson_crimson_fungus.png",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_crimson:crimson_roots", {
|
||||
description = S("Crimson Roots"),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "crimson_roots.png" },
|
||||
inventory_image = "crimson_roots.png",
|
||||
tiles = { "mcl_crimson_crimson_roots.png" },
|
||||
inventory_image = "mcl_crimson_crimson_roots.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
|
@ -510,7 +514,7 @@ minetest.register_node("mcl_crimson:crimson_roots", {
|
|||
mcl_flowerpots.register_potted_flower("mcl_crimson:crimson_roots", {
|
||||
name = "crimson roots",
|
||||
desc = S("Crimson Roots"),
|
||||
image = "crimson_roots.png",
|
||||
image = "mcl_crimson_crimson_roots.png",
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_crimson:crimson_hyphae", {
|
||||
|
@ -518,10 +522,10 @@ minetest.register_node("mcl_crimson:crimson_hyphae", {
|
|||
_doc_items_longdesc = S("The stem of a crimson hyphae"),
|
||||
_doc_items_hidden = false,
|
||||
tiles = {
|
||||
"crimson_hyphae.png",
|
||||
"crimson_hyphae.png",
|
||||
"mcl_crimson_crimson_hyphae.png",
|
||||
"mcl_crimson_crimson_hyphae.png",
|
||||
{
|
||||
image="crimson_hyphae_side.png",
|
||||
image="mcl_crimson_crimson_hyphae_side.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}
|
||||
},
|
||||
},
|
||||
|
@ -541,7 +545,7 @@ minetest.register_node("mcl_crimson:crimson_hyphae_bark", {
|
|||
_doc_items_longdesc = S("This is a decorative block surrounded by the bark of an hyphae."),
|
||||
tiles = {
|
||||
{
|
||||
image="crimson_hyphae_side.png",
|
||||
image="mcl_crimson_crimson_hyphae_side.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}
|
||||
},
|
||||
},
|
||||
|
@ -567,7 +571,7 @@ minetest.register_node("mcl_crimson:stripped_crimson_hyphae", {
|
|||
description = S("Stripped Crimson Hyphae"),
|
||||
_doc_items_longdesc = S("The stripped stem of a crimson hyphae"),
|
||||
_doc_items_hidden = false,
|
||||
tiles = {"crimson_stem_stripped_top.png", "crimson_stem_stripped_top.png", "crimson_stem_stripped_side.png"},
|
||||
tiles = {"mcl_crimson_crimson_stem_stripped_top.png", "mcl_crimson_crimson_stem_stripped_top.png", "mcl_crimson_crimson_stem_stripped_side.png"},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy = 1, axey = 1, tree = 1, building_block = 1, material_wood = 1},
|
||||
|
@ -579,7 +583,7 @@ minetest.register_node("mcl_crimson:stripped_crimson_hyphae", {
|
|||
minetest.register_node("mcl_crimson:stripped_crimson_hyphae_bark", {
|
||||
description = S("Stripped Crimson Hyphae Bark"),
|
||||
_doc_items_longdesc = S("The stripped wood of a crimson hyphae"),
|
||||
tiles = {"crimson_stem_stripped_side.png"},
|
||||
tiles = {"mcl_crimson_crimson_stem_stripped_side.png"},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
groups = {handy = 1, axey = 1, bark = 1, building_block = 1, material_wood = 1},
|
||||
|
@ -599,7 +603,7 @@ minetest.register_craft({
|
|||
|
||||
minetest.register_node("mcl_crimson:crimson_hyphae_wood", {
|
||||
description = S("Crimson Hyphae Wood"),
|
||||
tiles = {"crimson_hyphae_wood.png"},
|
||||
tiles = {"mcl_crimson_crimson_hyphae_wood.png"},
|
||||
groups = {handy = 5, axey = 1, wood = 1, building_block = 1, material_wood = 1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_hardness = 2,
|
||||
|
@ -608,12 +612,12 @@ minetest.register_node("mcl_crimson:crimson_hyphae_wood", {
|
|||
minetest.register_node("mcl_crimson:crimson_nylium", {
|
||||
description = S("Crimson Nylium"),
|
||||
tiles = {
|
||||
"crimson_nylium.png",
|
||||
"mcl_crimson_crimson_nylium.png",
|
||||
"mcl_nether_netherrack.png",
|
||||
"mcl_nether_netherrack.png^crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_crimson_nylium_side.png",
|
||||
"mcl_nether_netherrack.png^mcl_crimson_crimson_nylium_side.png",
|
||||
},
|
||||
groups = {pickaxey = 1, building_block = 1, material_stone = 1},
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
|
@ -672,7 +676,7 @@ mcl_doors:register_trapdoor("mcl_crimson:crimson_trapdoor", {
|
|||
_doc_items_longdesc = S("Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder."),
|
||||
_doc_items_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."),
|
||||
tile_front = "mcl_crimson_crimson_trapdoor.png",
|
||||
tile_side = "crimson_hyphae_wood.png",
|
||||
tile_side = "mcl_crimson_crimson_hyphae_wood.png",
|
||||
wield_image = "mcl_crimson_crimson_trapdoor.png",
|
||||
groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1, flammable=-1},
|
||||
_mcl_hardness = 3,
|
||||
|
@ -710,7 +714,7 @@ mcl_doors:register_trapdoor("mcl_crimson:warped_trapdoor", {
|
|||
_doc_items_longdesc = S("Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder."),
|
||||
_doc_items_usagehelp = S("To open or close the trapdoor, rightclick it or send a redstone signal to it."),
|
||||
tile_front = "mcl_crimson_warped_trapdoor.png",
|
||||
tile_side = "warped_hyphae_wood.png",
|
||||
tile_side = "mcl_crimson_warped_hyphae_wood.png",
|
||||
wield_image = "mcl_crimson_warped_trapdoor.png",
|
||||
groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1, flammable=-1},
|
||||
_mcl_hardness = 3,
|
||||
|
|
|
@ -456,6 +456,12 @@ minetest.register_craft({
|
|||
recipe = {{"mcl_core:lapis"}},
|
||||
})
|
||||
|
||||
--[[ Uncomment when crafting blue dye back into lapis is removed.
|
||||
minetest.register_craft({
|
||||
output = "mcl_dye:blue",
|
||||
recipe = {{"mcl_flowers:cornflower"}},
|
||||
})]]
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_dye:lightblue",
|
||||
recipe = {{"mcl_flowers:blue_orchid"}},
|
||||
|
@ -526,6 +532,12 @@ minetest.register_craft({
|
|||
recipe = {{"mcl_flowers:rose_bush"}},
|
||||
})
|
||||
|
||||
--[[Uncomment when crafting white dye back into bonemeal is removed
|
||||
minetest.register_craft({
|
||||
output = "mcl_dye:white",
|
||||
recipe = {{"mcl_flowers:lily_of_the_valley"}},
|
||||
})]]
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mcl_dye:dark_green",
|
||||
|
@ -533,6 +545,13 @@ minetest.register_craft({
|
|||
cooktime = 10,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mcl_dye:green",
|
||||
recipe = "group:sea_pickle",
|
||||
cooktime = 10,
|
||||
})
|
||||
|
||||
-- Dye mixing recipes.
|
||||
--
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -448,18 +448,28 @@ function mcl_fire.set_fire(pointed_thing, player, allow_on_fire)
|
|||
else
|
||||
pname = player:get_player_name()
|
||||
end
|
||||
local n = get_node(pointed_thing.above)
|
||||
local nu = get_node(pointed_thing.under)
|
||||
if allow_on_fire == false and get_item_group(nu.name, "fire") ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.is_protected(pointed_thing.above, pname) then
|
||||
minetest.record_protection_violation(pointed_thing.above, pname)
|
||||
return
|
||||
end
|
||||
if n.name == "air" then
|
||||
add_node(pointed_thing.above, {name="mcl_fire:fire"})
|
||||
|
||||
local n_pointed = minetest.get_node(pointed_thing.under)
|
||||
if allow_on_fire == false and get_item_group(n_pointed.name, "fire") ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
local n_fire_pos = minetest.get_node(pointed_thing.above)
|
||||
if n_fire_pos.name ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
local n_below = minetest.get_node(vector.offset(pointed_thing.above, 0, -1, 0))
|
||||
if minetest.get_item_group(n_below.name, "water") ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
add_node(pointed_thing.above, {name="mcl_fire:fire"})
|
||||
end
|
||||
|
||||
minetest.register_lbm({
|
||||
|
|
|
@ -427,6 +427,7 @@ minetest.register_node("mcl_flowers:waterlily", {
|
|||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"flowers_waterlily.png", "flowers_waterlily.png^[transformFY"},
|
||||
color = "#208030",
|
||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
|
||||
inventory_image = "flowers_waterlily.png",
|
||||
wield_image = "flowers_waterlily.png",
|
||||
|
|
|
@ -11,6 +11,9 @@ White Tulip=
|
|||
Allium=
|
||||
Azure Bluet=
|
||||
Blue Orchid=
|
||||
Wither Rose=
|
||||
Lily of the Valley=
|
||||
Cornflower=
|
||||
Tall Grass=
|
||||
Tall grass is a small plant which often occurs on the surface of grasslands. It can be harvested for wheat seeds. By using bone meal, tall grass can be turned into double tallgrass which is two blocks high.=
|
||||
Fern=
|
||||
|
|
|
@ -66,3 +66,15 @@ mcl_flowers.register_simple_flower("wither_rose", {
|
|||
selection_box = { -3/16, -0.5, -3/16, 3/16, 6/16, 3/16 },
|
||||
potted = true,
|
||||
})
|
||||
mcl_flowers.register_simple_flower("lily_of_the_valley", {
|
||||
desc = S("Lily of the Valley"),
|
||||
image = "mcl_flowers_lily_of_the_valley.png",
|
||||
selection_box = { -5/16, -0.5, -5/16, 4/16, 5/16, 5/16 },
|
||||
potted = true,
|
||||
})
|
||||
mcl_flowers.register_simple_flower("cornflower", {
|
||||
desc = S("Cornflower"),
|
||||
image = "mcl_flowers_cornflower.png",
|
||||
selection_box = { -4/16, -0.5, -4/16, 4/16, 3/16, 4/16 },
|
||||
potted = true,
|
||||
})
|
||||
|
|
|
@ -124,7 +124,7 @@ local function update_map_texture (self, staticdata)
|
|||
self.object:set_properties({ textures = { texture } })
|
||||
end)
|
||||
if result ~= nil and result == false then
|
||||
mintest.log("error", "[mcl_itemframes] Error setting up Map Item.")
|
||||
minetest.log("error", "[mcl_itemframes] Error setting up Map Item.")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -92,13 +92,15 @@ local l_def = {
|
|||
_doc_items_hidden = false,
|
||||
drawtype = "allfaces_optional",
|
||||
waving = 2,
|
||||
place_param2 = 1, -- Prevent leafdecay for placed nodes
|
||||
tiles = {"mcl_mangrove_leaves.png"},
|
||||
color = "#48B518",
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "mcl_core_palette_foliage.png",
|
||||
groups = {
|
||||
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
|
||||
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
|
||||
leaves = 1, deco_block = 1, compostability = 30
|
||||
leaves = 1, deco_block = 1, compostability = 30, foliage_palette = 1
|
||||
},
|
||||
drop = get_drops(0),
|
||||
_mcl_shears_drop = true,
|
||||
|
@ -107,13 +109,24 @@ local l_def = {
|
|||
_mcl_hardness = 0.2,
|
||||
_mcl_silk_touch_drop = true,
|
||||
_mcl_fortune_drop = { get_drops(1), get_drops(2), get_drops(3), get_drops(4) },
|
||||
on_construct = function(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.param2 == 0 or node.param2 == 1 then -- Check if param2 is 1 as well, since the schematics accidentally have the param2 of mangrove leaves be 1.
|
||||
local new_node = mcl_core.get_foliage_block_type(pos)
|
||||
if new_node.param2 ~= 0 then
|
||||
minetest.swap_node(pos, new_node)
|
||||
end
|
||||
end
|
||||
end,
|
||||
after_place_node = function(pos)
|
||||
mcl_core.make_player_leaves(pos) -- Leaves placed by the player should always be player leaves.
|
||||
end,
|
||||
}
|
||||
|
||||
minetest.register_node("mcl_mangrove:mangroveleaves", l_def)
|
||||
|
||||
local o_def = table.copy(l_def)
|
||||
o_def._doc_items_create_entry = false
|
||||
o_def.place_param2 = nil
|
||||
o_def.groups.not_in_creative_inventory = 1
|
||||
o_def.groups.orphan_leaves = 1
|
||||
o_def._mcl_shears_drop = {"mcl_mangrove:mangroveleaves"}
|
||||
|
@ -298,7 +311,7 @@ mcl_flowerpots.register_potted_flower("mcl_mangrove:propagule", {
|
|||
image = "mcl_mangrove_propagule.png",
|
||||
})
|
||||
|
||||
local water_tex = "default_water_source_animated.png^[verticalframe:16:0"
|
||||
local water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#3F76E4"
|
||||
|
||||
local wlroots = {
|
||||
description = S("water logged mangrove roots"),
|
||||
|
@ -350,7 +363,7 @@ local rwlroots = table.copy(wlroots)
|
|||
-- FIXME luacheck complains that this is a repeated definition of water_tex.
|
||||
-- Maybe the tiles definition below should be replaced with the animated tile
|
||||
-- definition as per above?
|
||||
water_tex = "default_river_water_source_animated.png^[verticalframe:16:0"
|
||||
water_tex = "default_water_source_animated.png^[verticalframe:16:0^[multiply:#0084FF"
|
||||
rwlroots.tiles = {
|
||||
"("..water_tex..")^mcl_mangrove_roots_top.png",
|
||||
"("..water_tex..")^mcl_mangrove_roots_side.png",
|
||||
|
@ -549,6 +562,7 @@ minetest.register_abm({
|
|||
local nn = minetest.find_nodes_in_area(vector.offset(pos,0,-1,0),vector.offset(pos,0,h,0),{"group:water","air"})
|
||||
if #nn >= h then
|
||||
minetest.place_schematic(pos, path, "random", function()
|
||||
mcl_core.update_sapling_foliage_colors(pos)
|
||||
local nnv = minetest.find_nodes_in_area(vector.offset(pos,-5,-1,-5),vector.offset(pos,5,h/2,5),{"mcl_core:vine"})
|
||||
minetest.bulk_set_node(nnv,{"air"})
|
||||
end, true, "place_center_x, place_center_z")
|
||||
|
@ -558,6 +572,7 @@ minetest.register_abm({
|
|||
if r > 3 then h = 18 end
|
||||
if mcl_core.check_growth_width(pos,w,h) then
|
||||
minetest.place_schematic(pos, path, "random", nil, true, "place_center_x, place_center_z")
|
||||
mcl_core.update_sapling_foliage_colors(pos)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -24,7 +24,7 @@ minetest.mkdir(map_textures_path)
|
|||
|
||||
local function load_json_file(name)
|
||||
local file = assert(io.open(modpath .. "/" .. name .. ".json", "r"))
|
||||
local data = minetest.parse_json(file:read())
|
||||
local data = minetest.parse_json(file:read("*all"))
|
||||
file:close()
|
||||
return data
|
||||
end
|
||||
|
|
|
@ -413,7 +413,7 @@ minetest.register_craftitem("mcl_mobitems:glow_ink_sac", {
|
|||
description = S("Glow Ink Sac"),
|
||||
_doc_items_longdesc = S("Use it to craft the Glow Item Frame."),
|
||||
_doc_items_usagehelp = S("Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame."),
|
||||
inventory_image = "extra_mobs_glow_ink_sac.png",
|
||||
inventory_image = "mcl_mobitems_glow_ink_sac.png",
|
||||
groups = { craftitem = 1 },
|
||||
})
|
||||
|
||||
|
|
|
@ -317,7 +317,9 @@ minetest.register_node("mcl_mobspawners:spawner", {
|
|||
if obj then
|
||||
obj:remove()
|
||||
end
|
||||
if not minetest.is_creative_enabled(name) then
|
||||
mcl_experience.throw_xp(pos, math.random(15, 43))
|
||||
end
|
||||
end,
|
||||
|
||||
on_punch = function(pos)
|
||||
|
|
|
@ -25,9 +25,7 @@ local mt_get_node = minetest.get_node
|
|||
local mt_get_node_level = minetest.get_node_level
|
||||
local mt_get_node_max_level = minetest.get_node_max_level
|
||||
local mt_get_node_or_nil = minetest.get_node_or_nil
|
||||
local mt_get_node_timer = minetest.get_node_timer
|
||||
local mt_get_meta = minetest.get_meta
|
||||
local mt_hash_node_position = minetest.hash_node_position
|
||||
local mt_set_node = minetest.set_node
|
||||
local mt_swap_node = minetest.swap_node
|
||||
local mt_pos_to_string = minetest.pos_to_string
|
||||
|
@ -52,18 +50,11 @@ local table = table
|
|||
local kelp = {}
|
||||
mcl_ocean.kelp = kelp
|
||||
|
||||
-- Kelp minimum and maximum age. Once reached the maximum, kelp no longer grows.
|
||||
-- Once reach the maximum, kelp no longer grows.
|
||||
kelp.MIN_AGE = 0
|
||||
kelp.MAX_AGE = 25
|
||||
|
||||
-- Tick interval (in seconds) for updating kelp.
|
||||
kelp.TICK = 0.2
|
||||
|
||||
-- Tick interval (in seconds) to store kelp meta.
|
||||
kelp.META_TICK = 2
|
||||
|
||||
-- Max age queue length
|
||||
kelp.MAX_AGE_QUEUE = 20
|
||||
kelp.TICK = 0.2 -- Tick interval (in seconds) for updating kelp.
|
||||
|
||||
-- The average amount of growth for kelp in a day is 2.16 (https://youtu.be/5Bp4lAjAk3I)
|
||||
-- Normally, a day lasts 20 minutes, meaning kelp.next_grow() is executed
|
||||
|
@ -81,19 +72,6 @@ kelp.ROLL_GROWTH_DENOMINATOR = 100 * 1200
|
|||
-- Sounds used to dig and place kelp.
|
||||
kelp.leaf_sounds = mcl_sounds.node_sound_leaves_defaults()
|
||||
|
||||
-- Pool storing nodetimers
|
||||
kelp.timers_pool = {}
|
||||
|
||||
-- Pool storing age, indexed by pos_hash.
|
||||
kelp.age_pool = {}
|
||||
|
||||
-- Queue(List) of hashed positions to save their ages.
|
||||
-- Invalid ones may still persist in this queue.
|
||||
kelp.age_queue = {}
|
||||
-- Stores only valid positions of each hashed postiions.
|
||||
kelp.age_queue_pos = {}
|
||||
|
||||
|
||||
-- is age in the growable range?
|
||||
function kelp.is_age_growable(age)
|
||||
return age >= 0 and age < kelp.MAX_AGE
|
||||
|
@ -177,7 +155,8 @@ end
|
|||
-- Roll whether to grow kelp or not.
|
||||
function kelp.roll_growth(numerator, denominator)
|
||||
-- Optional params: numerator, denominator
|
||||
return math.random(denominator or kelp.ROLL_GROWTH_DENOMINATOR) <= (numerator or kelp.ROLL_GROWTH_NUMERATOR)
|
||||
--return math.random(denominator or kelp.ROLL_GROWTH_DENOMINATOR) <= (numerator or kelp.ROLL_GROWTH_NUMERATOR)
|
||||
return true -- probability done by ABM
|
||||
end
|
||||
|
||||
|
||||
|
@ -230,87 +209,50 @@ function kelp.next_param2(param2)
|
|||
return math.min(param2+16 - param2 % 16, 255);
|
||||
end
|
||||
|
||||
|
||||
-- Stores age from kelp.age_queue* into their respective meta
|
||||
function kelp.store_meta()
|
||||
local count = 0
|
||||
for _ in pairs(kelp.age_queue_pos) do
|
||||
count = count + 1
|
||||
end
|
||||
-- chatlog(string.format("Storing age metadata: %d in queue", #kelp.age_queue))
|
||||
-- chatlog(string.format("Storing age metadata: %d valid in queue", count))
|
||||
for i=1,#kelp.age_queue do
|
||||
local pos_hash = kelp.age_queue[i]
|
||||
local pos = kelp.age_queue_pos[pos_hash]
|
||||
-- queued hashes may no longer point to a valid pos, e.g. kelp is destroyed.
|
||||
local function store_age (pos, age)
|
||||
if pos then
|
||||
mt_get_meta(pos):set_int("mcl_ocean:kelp_age", kelp.age_pool[pos_hash])
|
||||
--minetest.log("age: ".. tostring(age) .. ", pos: ".. mt_pos_to_string(pos))
|
||||
mt_get_meta(pos):set_int("mcl_ocean:kelp_age", age)
|
||||
end
|
||||
end
|
||||
kelp.age_queue = {}
|
||||
kelp.age_queue_pos = {}
|
||||
|
||||
local function retrieve_age (pos, include_nil)
|
||||
local meta = mt_get_meta(pos)
|
||||
|
||||
if include_nil then
|
||||
local age_set = meta:contains("mcl_ocean:kelp_age")
|
||||
if not age_set then
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
-- Store and queue a kelp's age to be saved into meta later.
|
||||
function kelp.store_age(age, pos, pos_hash)
|
||||
-- Watched params: pos
|
||||
-- Optional params: pos_hash
|
||||
local pos_hash = pos_hash or mt_hash_node_position(pos)
|
||||
|
||||
kelp.age_pool[pos_hash] = age
|
||||
if not kelp.age_queue_pos[pos_hash] then
|
||||
table.insert(kelp.age_queue, pos_hash)
|
||||
kelp.age_queue_pos[pos_hash] = pos
|
||||
return true, pos_hash
|
||||
end
|
||||
|
||||
return false, pos_hash
|
||||
return meta:get_int("mcl_ocean:kelp_age")
|
||||
end
|
||||
|
||||
|
||||
-- Initialise a kelp's age.
|
||||
function kelp.init_age(pos, age, pos_hash, meta)
|
||||
function kelp.init_age(pos, age, from_lbm)
|
||||
-- Watched params: pos
|
||||
-- Optional params: age, pos_hash, meta
|
||||
local pos_hash = pos_hash or mt_hash_node_position(pos)
|
||||
local meta = meta or mt_get_meta(pos)
|
||||
-- Optional params: age, from_lbm
|
||||
|
||||
local new_age
|
||||
|
||||
local stored_age = retrieve_age(pos, from_lbm)
|
||||
|
||||
local age = age
|
||||
if age then
|
||||
kelp.store_age(age, pos, pos_hash)
|
||||
elseif not meta:contains("mcl_ocean:kelp_age") then
|
||||
age = kelp.roll_init_age()
|
||||
kelp.store_age(age, pos, pos_hash)
|
||||
--minetest.log("age: " .. tostring(age))
|
||||
store_age(pos, age)
|
||||
new_age = age
|
||||
elseif not stored_age then
|
||||
new_age = kelp.roll_init_age()
|
||||
--minetest.log("no kelp age set so init with: " .. tostring(new_age))
|
||||
store_age(pos, new_age)
|
||||
else
|
||||
age = meta:get_int("mcl_ocean:kelp_age")
|
||||
if not kelp.age_pool[pos_hash] then
|
||||
kelp.age_pool[pos_hash] = age
|
||||
end
|
||||
--minetest.log("stored_age: " .. tostring(stored_age))
|
||||
new_age = stored_age
|
||||
end
|
||||
|
||||
return age, pos_hash, meta
|
||||
return new_age
|
||||
end
|
||||
|
||||
|
||||
-- Initialise kelp nodetimer.
|
||||
function kelp.init_timer(pos, pos_hash)
|
||||
-- Optional params: pos_hash
|
||||
local pos_hash = pos_hash or mt_hash_node_position(pos)
|
||||
|
||||
local timer = kelp.timers_pool[pos_hash]
|
||||
if not timer then
|
||||
timer = mt_get_node_timer(pos)
|
||||
kelp.timers_pool[pos_hash] = timer
|
||||
end
|
||||
if not timer:is_started() then
|
||||
timer:start(kelp.TICK)
|
||||
end
|
||||
|
||||
return pos_hash
|
||||
end
|
||||
|
||||
|
||||
-- Apply next kelp height. The surface is swapped. so on_construct is skipped.
|
||||
function kelp.next_height(pos, node, pos_tip, node_tip, submerged, downward_flowing)
|
||||
-- Modified params: node
|
||||
|
@ -342,12 +284,11 @@ end
|
|||
|
||||
|
||||
-- Grow next kelp.
|
||||
function kelp.next_grow(age, pos, node, pos_hash, pos_tip, node_tip, submerged, downward_flowing)
|
||||
function kelp.next_grow(age, pos, node, pos_tip, node_tip, submerged, downward_flowing)
|
||||
-- Watched params: pos
|
||||
-- Modified params: node
|
||||
-- Optional params: node, pos_hash, pos_tip, node_tip, submerged, downward_flowing
|
||||
-- Optional params: node, pos_tip, node_tip, submerged, downward_flowing
|
||||
local node = node or mt_get_node(pos)
|
||||
local pos_hash = pos_hash or mt_hash_node_position(pos)
|
||||
local pos_tip = pos_tip
|
||||
local node_tip = node_tip or (pos_tip and mt_get_node(pos_tip))
|
||||
if not pos_tip then
|
||||
|
@ -361,8 +302,8 @@ function kelp.next_grow(age, pos, node, pos_hash, pos_tip, node_tip, submerged,
|
|||
end
|
||||
|
||||
kelp.next_height(pos, node, pos_tip, node_tip, submerged, downward_flowing)
|
||||
|
||||
return kelp.store_age(age, pos, pos_hash), node, pos_hash, pos_tip, node_tip, submerged, downward_flowing
|
||||
store_age(pos, age)
|
||||
return true, node, pos_tip, node_tip, submerged, downward_flowing
|
||||
end
|
||||
|
||||
|
||||
|
@ -420,75 +361,68 @@ function kelp.surface_on_dig(pos, node, digger)
|
|||
kelp.detach_dig(pos, pos, true, node)
|
||||
end
|
||||
|
||||
|
||||
function kelp.surface_after_dig_node(pos, node)
|
||||
return mt_set_node(pos, {name=minetest.registered_nodes[node.name].node_dig_prediction})
|
||||
end
|
||||
|
||||
|
||||
function kelp.surface_on_timer(pos)
|
||||
local function detach_unsubmerged(pos)
|
||||
local node = mt_get_node(pos)
|
||||
local pos_hash
|
||||
|
||||
-- Update detahed kelps
|
||||
local dig_pos,_, height = kelp.find_unsubmerged(pos, node)
|
||||
if dig_pos then
|
||||
pos_hash = mt_hash_node_position(pos)
|
||||
mt_sound_play(mt_registered_nodes[node.name].sounds.dug, { gain = 0.5, pos = dig_pos }, true)
|
||||
kelp.detach_dig(dig_pos, pos, true, node, height)
|
||||
kelp.store_age(kelp.roll_init_age(), pos, pos_hash)
|
||||
local new_age = kelp.roll_init_age()
|
||||
store_age(pos, new_age)
|
||||
end
|
||||
end
|
||||
|
||||
-- Grow kelp on chance
|
||||
local function grow_kelp (pos)
|
||||
local node = mt_get_node(pos)
|
||||
|
||||
if kelp.roll_growth() then
|
||||
pos_hash = pos_hash or mt_hash_node_position(pos)
|
||||
local age = kelp.age_pool[pos_hash]
|
||||
if kelp.is_age_growable(age) then
|
||||
kelp.next_grow(age+1, pos, node, pos_hash)
|
||||
end
|
||||
local age = retrieve_age(pos)
|
||||
|
||||
if not age then
|
||||
--minetest.log("init a new age as not set: " .. mt_pos_to_string(pos))
|
||||
kelp.init_age(pos, nil)
|
||||
end
|
||||
|
||||
return true
|
||||
if kelp.is_age_growable(age) then
|
||||
--minetest.log("age growable: ".. tostring(age) .. ", pos: ".. mt_pos_to_string(pos))
|
||||
kelp.next_grow(age+1, pos, node)
|
||||
else
|
||||
--minetest.log("age not: ".. tostring(age) .. ", pos: ".. mt_pos_to_string(pos))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function kelp.surface_on_construct(pos)
|
||||
local pos_hash = mt_hash_node_position(pos)
|
||||
kelp.init_age(pos, nil, pos_hash)
|
||||
kelp.init_timer(pos, pos_hash)
|
||||
--minetest.log("on construct kelp called")
|
||||
kelp.init_age(pos, nil)
|
||||
end
|
||||
|
||||
|
||||
function kelp.surface_on_destruct(pos)
|
||||
local node = mt_get_node(pos)
|
||||
local pos_hash = mt_hash_node_position(pos)
|
||||
|
||||
-- on_falling callback. Activated by pistons for falling nodes too.
|
||||
-- I'm not sure this works. I think piston digs water and the unsubmerged nature drops kelp.
|
||||
if kelp.is_falling(pos, node) then
|
||||
kelp.detach_drop(pos, kelp.get_height(node.param2))
|
||||
end
|
||||
|
||||
-- Removes position from queue
|
||||
kelp.age_queue_pos[pos_hash] = nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
function kelp.surface_on_mvps_move(pos, node, oldpos, nodemeta)
|
||||
-- Pistons moving falling nodes will have already activated on_falling callback.
|
||||
--minetest.log("kelp.surface_on_mvps_move: " .. mt_pos_to_string(pos))
|
||||
kelp.detach_dig(pos, pos, mt_get_item_group(node.name, "falling_node") ~= 1, node)
|
||||
end
|
||||
|
||||
|
||||
-- NOTE: Old ABM implementation.
|
||||
-- local function surface_unsubmerged_abm(pos, node)
|
||||
-- local dig_pos = find_unsubmerged(pos, node)
|
||||
-- if dig_pos then
|
||||
-- detach_dig(dig_pos, pos, node, true)
|
||||
-- end
|
||||
-- return true
|
||||
-- end
|
||||
|
||||
|
||||
function kelp.kelp_on_place(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" or not placer then
|
||||
return itemstack
|
||||
|
@ -576,48 +510,29 @@ function kelp.kelp_on_place(itemstack, placer, pointed_thing)
|
|||
end
|
||||
|
||||
-- Initialize age and timer when it's planted on a new surface.
|
||||
local pos_hash = mt_hash_node_position(pos_under)
|
||||
local init_age = kelp.roll_init_age()
|
||||
|
||||
if new_surface then
|
||||
kelp.init_age(pos_under, nil, pos_hash)
|
||||
kelp.init_timer(pos_under, pos_hash)
|
||||
kelp.init_age(pos_under, init_age)
|
||||
else
|
||||
kelp.store_age(kelp.roll_init_age(), pos_under, pos_hash)
|
||||
store_age(pos_under, init_age)
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
function kelp.lbm_register_nodetimer(pos, node)
|
||||
local pos_hash = mt_hash_node_position(pos)
|
||||
kelp.init_age(pos, nil, pos_hash)
|
||||
kelp.init_timer(pos, pos_hash)
|
||||
function kelp.lbm_register(pos)
|
||||
kelp.init_age(pos, nil, true)
|
||||
end
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Kelp initialise",
|
||||
name = "mcl_ocean:kelp_init",
|
||||
nodenames = { "group:kelp" },
|
||||
run_at_every_load = true, -- so old kelps are also initialised
|
||||
action = kelp.lbm_register,
|
||||
})
|
||||
|
||||
local gstep_time = 0
|
||||
function kelp.globalstep(dtime)
|
||||
if #kelp.age_queue > kelp.MAX_AGE_QUEUE then
|
||||
kelp.store_meta()
|
||||
end
|
||||
|
||||
gstep_time = gstep_time + dtime
|
||||
if gstep_time < kelp.META_TICK then
|
||||
return
|
||||
end
|
||||
gstep_time = 0
|
||||
|
||||
if #kelp.age_queue > 0 then
|
||||
kelp.store_meta()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function kelp.on_shutdown()
|
||||
if #kelp.age_queue > 0 then
|
||||
kelp.store_meta()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Kelp registration API
|
||||
|
@ -664,7 +579,6 @@ kelp.surface_deftemplate = {
|
|||
on_destruct = kelp.surface_on_destruct,
|
||||
on_dig = kelp.surface_on_dig,
|
||||
after_dig_node = kelp.surface_after_dig_node,
|
||||
on_timer = kelp.surface_on_timer,
|
||||
mesecon = { on_mvps_move = kelp.surface_on_mvps_move, },
|
||||
drop = "", -- drops are handled in on_dig
|
||||
--_mcl_falling_node_alternative = is_falling and nodename or nil,
|
||||
|
@ -811,35 +725,28 @@ minetest.register_craft({
|
|||
burntime = 200,
|
||||
})
|
||||
|
||||
-- Global registration ------------------------------------------------------------------------
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Kelp initialise",
|
||||
name = "mcl_ocean:kelp_init",
|
||||
minetest.register_abm({
|
||||
label = "Kelp drops",
|
||||
nodenames = { "group:kelp" },
|
||||
run_at_every_load = true, -- so old kelps are also initialised
|
||||
action = kelp.lbm_register_nodetimer,
|
||||
interval = 1.0,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = detach_unsubmerged, --surface_unsubmerged_abm,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_globalstep(kelp.globalstep)
|
||||
minetest.register_on_shutdown(kelp.on_shutdown)
|
||||
|
||||
-- NOTE: Old ABM implementation.
|
||||
-- minetest.register_abm({
|
||||
-- label = "Kelp drops",
|
||||
-- nodenames = { "group:kelp" },
|
||||
-- interval = 1.0,
|
||||
-- chance = 1,
|
||||
-- catch_up = false,
|
||||
-- action = surface_unsubmerged_abm,
|
||||
-- })
|
||||
--
|
||||
-- minetest.register_abm({
|
||||
-- label = "Kelp growth",
|
||||
-- nodenames = { "group:kelp" },
|
||||
-- interval = 45,
|
||||
-- chance = 12,
|
||||
-- catch_up = false,
|
||||
-- action = grow_abm,
|
||||
-- })
|
||||
-- 50% growth over a minute https://minecraft.fandom.com/wiki/Tutorials/Kelp_farming
|
||||
-- 14% chance every random tick
|
||||
-- On average, blocks are updated every 68.27 seconds (1365.33 game ticks)
|
||||
-- 1 in 7 every 68
|
||||
-- 1 in 28 every 17
|
||||
-- 1 in 21 every 22
|
||||
-- https://minecraft.fandom.com/wiki/Tick#Random_tick
|
||||
minetest.register_abm({
|
||||
label = "Kelp growth",
|
||||
nodenames = { "group:kelp" },
|
||||
interval = 17, --17
|
||||
chance = 28,
|
||||
catch_up = false,
|
||||
action = grow_kelp,
|
||||
})
|
||||
|
|
|
@ -98,22 +98,22 @@ mcl_signs.register_sign_craft("mcl_core", "mcl_core:wood", "")
|
|||
|
||||
-- birchwood Sign "#d5cb8d" / "#ffdba7"
|
||||
mcl_signs.register_sign_custom("mcl_core", "_birchwood",
|
||||
"mcl_signs_sign_greyscale.png","#ffdba7", "default_sign_greyscale.png",
|
||||
"default_sign_greyscale.png", "Birch Sign"
|
||||
"mcl_signs_sign_greyscale.png","#ffdba7", "mcl_signs_default_sign_greyscale.png",
|
||||
"mcl_signs_default_sign_greyscale.png", "Birch Sign"
|
||||
)
|
||||
mcl_signs.register_sign_craft("mcl_core", "mcl_core:birchwood", "_birchwood")
|
||||
|
||||
-- sprucewood Sign
|
||||
mcl_signs.register_sign_custom("mcl_core", "_sprucewood",
|
||||
"mcl_signs_sign_dark.png","#ffffff", "default_sign_dark.png",
|
||||
"default_sign_dark.png", "Spruce Sign"
|
||||
"mcl_signs_sign_dark.png","#ffffff", "mcl_signs_default_sign_dark.png",
|
||||
"mcl_signs_default_sign_dark.png", "Spruce Sign"
|
||||
)
|
||||
mcl_signs.register_sign_craft("mcl_core", "mcl_core:sprucewood", "_sprucewood")
|
||||
|
||||
-- darkwood Sign "#291f1a" / "#856443"
|
||||
mcl_signs.register_sign_custom("mcl_core", "_darkwood",
|
||||
"mcl_signs_sign_greyscale.png","#856443", "default_sign_greyscale.png",
|
||||
"default_sign_greyscale.png", "Dark Oak Sign"
|
||||
"mcl_signs_sign_greyscale.png","#856443", "mcl_signs_default_sign_greyscale.png",
|
||||
"mcl_signs_default_sign_greyscale.png", "Dark Oak Sign"
|
||||
)
|
||||
mcl_signs.register_sign_craft("mcl_core", "mcl_core:darkwood", "_darkwood")
|
||||
|
||||
|
@ -136,13 +136,13 @@ if minetest.get_modpath("mcl_crimson") then
|
|||
|
||||
-- warped_hyphae_wood Sign
|
||||
mcl_signs.register_sign_custom("mcl_crimson","_warped_hyphae_wood", "mcl_signs_sign_greyscale.png",
|
||||
"#9f7dcf", "default_sign_greyscale.png", "default_sign_greyscale.png",
|
||||
"#9f7dcf", "mcl_signs_default_sign_greyscale.png", "mcl_signs_default_sign_greyscale.png",
|
||||
"Warped Hyphae Sign")
|
||||
mcl_signs.register_sign_craft("mcl_crimson", "mcl_crimson:warped_hyphae_wood", "_warped_hyphae_wood")
|
||||
|
||||
-- crimson_hyphae_wood Sign
|
||||
mcl_signs.register_sign_custom("mcl_crimson", "_crimson_hyphae_wood","mcl_signs_sign_greyscale.png",
|
||||
"#c35f51","default_sign_greyscale.png", "default_sign_greyscale.png",
|
||||
"#c35f51","mcl_signs_default_sign_greyscale.png", "mcl_signs_default_sign_greyscale.png",
|
||||
"Crimson Hyphae Sign")
|
||||
mcl_signs.register_sign_craft("mcl_crimson", "mcl_crimson:crimson_hyphae_wood", "_crimson_hyphae_wood")
|
||||
|
||||
|
|
|
@ -147,10 +147,10 @@ mcl_signs.wall_standard = {
|
|||
_tt_help = S("Can be written"),
|
||||
_doc_items_longdesc = S("Signs can be written and come in two variants: Wall sign and sign on a sign post. Signs can be placed on the top and the sides of other blocks, but not below them."),
|
||||
_doc_items_usagehelp = S("After placing the sign, you can write something on it. You have 4 lines of text with up to 15 characters for each line; anything beyond these limits is lost. Not all characters are supported. The text can not be changed once it has been written; you have to break and place the sign again. Can be colored and made to glow."),
|
||||
inventory_image = "default_sign.png",
|
||||
inventory_image = "mcl_signs_default_sign.png",
|
||||
walkable = false,
|
||||
is_ground_content = false,
|
||||
wield_image = "default_sign.png",
|
||||
wield_image = "mcl_signs_default_sign.png",
|
||||
node_placement_prediction = "",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
|
@ -552,9 +552,9 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
|
|||
new_sign = table.copy(mcl_signs.wall_standard)
|
||||
new_sign.description = S(ttsign)
|
||||
|
||||
new_sign.wield_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign.wield_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign.tiles = { "(mcl_signs_sign.png^[multiply:" .. color .. ")" }
|
||||
new_sign.inventory_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign.inventory_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
|
||||
-- currently have to do this, because of how the base node placement works.
|
||||
new_sign.on_place = function(itemstack, placer, pointed_thing)
|
||||
|
@ -676,9 +676,9 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
|
|||
local new_sign_standing = {}
|
||||
new_sign_standing = table.copy(mcl_signs.standing_standard)
|
||||
new_sign_standing.drop = "mcl_signs:wall_sign" .. _name
|
||||
new_sign_standing.wield_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.wield_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.tiles = { "(mcl_signs_sign.png^[multiply:" .. color .. ")" }
|
||||
new_sign_standing.inventory_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.inventory_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
|
||||
new_sign_standing.on_rotate = function(pos, node, user, mode)
|
||||
if mode == screwdriver.ROTATE_FACE then
|
||||
|
@ -763,7 +763,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
|
|||
end
|
||||
|
||||
--- The same as register_sign, except caller defines the textures. Note, there is a greyscale version of the sign,
|
||||
--- called "default_sign_greyscale.png" and "mcl_signs_sign_greyscale.png" for optional use in the textures directory.
|
||||
--- called "mcl_signs_default_sign_greyscale.png" and "mcl_signs_sign_greyscale.png" for optional use in the textures directory.
|
||||
---
|
||||
--- modname: optional (pass "" or "false" to ignore), for use with other mods to
|
||||
--- allow the creation of a sign from the mod's wood (if installed).
|
||||
|
@ -1015,9 +1015,9 @@ function mcl_signs.reregister_sign (modname, color, _name, ttsign)
|
|||
new_sign = table.copy(mcl_signs.wall_standard)
|
||||
new_sign.description = S(ttsign)
|
||||
|
||||
new_sign.wield_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign.wield_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign.tiles = { "(mcl_signs_sign.png^[multiply:" .. color .. ")" }
|
||||
new_sign.inventory_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign.inventory_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
|
||||
-- currently have to do this, because of how the base node placement works.
|
||||
new_sign.on_place = function(itemstack, placer, pointed_thing)
|
||||
|
@ -1134,9 +1134,9 @@ function mcl_signs.reregister_sign (modname, color, _name, ttsign)
|
|||
local new_sign_standing = {}
|
||||
new_sign_standing = table.copy(mcl_signs.standing_standard)
|
||||
new_sign_standing.drop = "mcl_signs:wall_sign" .. _name
|
||||
new_sign_standing.wield_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.wield_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.tiles = { "(mcl_signs_sign.png^[multiply:" .. color .. ")" }
|
||||
new_sign_standing.inventory_image = "(default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.inventory_image = "(mcl_signs_default_sign.png^[multiply:" .. color .. ")"
|
||||
new_sign_standing.on_rotate = function(pos, node, user, mode)
|
||||
if mode == screwdriver.ROTATE_FACE then
|
||||
node.name = "mcl_signs:standing_sign22_5" .. _name
|
||||
|
@ -1219,7 +1219,7 @@ function mcl_signs.reregister_sign (modname, color, _name, ttsign)
|
|||
end
|
||||
|
||||
--- The same as reregister_sign, except caller defines the textures. Note, there is a greyscale version of the sign,
|
||||
--- called "default_sign_greyscale.png" and "mcl_signs_sign_greyscale.png" for optional use in the textures directory.
|
||||
--- called "mcl_signs_default_sign_greyscale.png" and "mcl_signs_sign_greyscale.png" for optional use in the textures directory.
|
||||
---
|
||||
--- modname: optional (pass "" or "false" to ignore), for use with other mods to
|
||||
--- allow the creation of a sign from the mod's wood (if installed).
|
||||
|
|
|
@ -6,10 +6,10 @@ local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player rece
|
|||
|
||||
local flower_effect = {
|
||||
[ "mcl_flowers:allium" ] = "fire_resistance",
|
||||
[ "mcl_flowers:tulip_white" ] = "poison",
|
||||
[ "mcl_flowers:lily_of_the_valley" ] = "poison",
|
||||
[ "mcl_flowers:blue_orchid" ] = "hunger",
|
||||
[ "mcl_flowers:dandelion" ] = "hunger",
|
||||
[ "mcl_flowers:peony" ] = "jump",
|
||||
[ "mcl_flowers:cornflower" ] = "jump",
|
||||
[ "mcl_flowers:oxeye_daisy" ] = "regeneration",
|
||||
[ "mcl_flowers:poppy" ] = "night_vision"
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mcl_sus_stew:stew",
|
||||
recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:tulip_white"},
|
||||
recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:lily_of_the_valley"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -126,7 +126,7 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mcl_sus_stew:stew",
|
||||
recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:peony"},
|
||||
recipe = {"mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:bowl", "mcl_flowers:cornflower"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -6,6 +6,9 @@ local source = table.copy(minetest.registered_nodes["mcl_core:water_source"])
|
|||
source.description = S("River Water Source")
|
||||
source.liquid_range = 2
|
||||
source.waving = 3
|
||||
source.color = "#0084FF"
|
||||
source.paramtype2 = nil
|
||||
source.palette = nil
|
||||
source.liquid_alternative_flowing = "mclx_core:river_water_flowing"
|
||||
source.liquid_alternative_source = "mclx_core:river_water_source"
|
||||
source.liquid_renewable = false
|
||||
|
@ -13,40 +16,17 @@ source._doc_items_longdesc = S("River water has the same properties as water, bu
|
|||
source._doc_items_entry_name = S("River Water")
|
||||
-- Auto-expose entry only in valleys mapgen
|
||||
source._doc_items_hidden = minetest.get_mapgen_setting("mg_name") ~= "valleys"
|
||||
source.post_effect_color = {a=192, r=0x2c, g=0x88, b=0x8c}
|
||||
source.tiles = {
|
||||
{name="default_river_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0}}
|
||||
}
|
||||
source.special_tiles = {
|
||||
-- New-style water source material (mostly unused)
|
||||
{
|
||||
name="default_river_water_source_animated.png",
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=5.0},
|
||||
backface_culling = false,
|
||||
}
|
||||
}
|
||||
source.post_effect_color = {a=60, r=0, g=132, b=255}
|
||||
|
||||
local flowing = table.copy(minetest.registered_nodes["mcl_core:water_flowing"])
|
||||
flowing.description = S("Flowing River Water")
|
||||
flowing.liquid_range = 2
|
||||
flowing.waving = 3
|
||||
flowing.color = "#0084FF"
|
||||
flowing.liquid_alternative_flowing = "mclx_core:river_water_flowing"
|
||||
flowing.liquid_alternative_source = "mclx_core:river_water_source"
|
||||
flowing.liquid_renewable = false
|
||||
flowing.tiles = {"default_river_water_flowing_animated.png^[verticalframe:64:0"}
|
||||
flowing.post_effect_color = {a=192, r=0x2c, g=0x88, b=0x8c}
|
||||
flowing.special_tiles = {
|
||||
{
|
||||
image="default_river_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
{
|
||||
image="default_river_water_flowing_animated.png",
|
||||
backface_culling=false,
|
||||
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
|
||||
},
|
||||
}
|
||||
flowing.post_effect_color = {a=60, r=0, g=132, b=255}
|
||||
|
||||
minetest.register_node("mclx_core:river_water_source", source)
|
||||
minetest.register_node("mclx_core:river_water_flowing", flowing)
|
||||
|
|
|
@ -7,6 +7,12 @@ local nether_skycolor = "#6EB1FF" -- The Nether biomes seemingly don't use the s
|
|||
local end_skycolor = "#000000"
|
||||
local end_fogcolor = "#A080A0" -- The End biomes seemingly don't use the fog colour, despite having this value according to the wiki. The sky colour is used for both sky and fog.
|
||||
|
||||
local default_waterfogcolor = "#3F76E4"
|
||||
local lukewarm_waterfogcolor = "#45ADF2"
|
||||
local warm_waterfogcolor = "#43D5EE"
|
||||
local cold_waterfogcolor = "#3D57D6"
|
||||
local frozen_waterfogcolor = "#3938C9"
|
||||
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
local mg_seed = minetest.get_mapgen_setting("seed")
|
||||
|
||||
|
@ -51,6 +57,9 @@ local function register_classic_superflat_biome()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -161,6 +170,9 @@ local function register_biomes()
|
|||
heat_point = -5,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 2,
|
||||
_mcl_foliage_palette_index = 2,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -179,6 +191,9 @@ local function register_biomes()
|
|||
heat_point = -5,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 2,
|
||||
_mcl_foliage_palette_index = 2,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -199,6 +214,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 3,
|
||||
_mcl_foliage_palette_index = 2,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#839EFF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -221,6 +239,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 3,
|
||||
_mcl_foliage_palette_index = 16,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -241,6 +262,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 3,
|
||||
_mcl_foliage_palette_index = 16,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -259,6 +283,9 @@ local function register_biomes()
|
|||
vertical_blend = 1,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 3,
|
||||
_mcl_foliage_palette_index = 2,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -278,6 +305,9 @@ local function register_biomes()
|
|||
heat_point = 10,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 4,
|
||||
_mcl_foliage_palette_index = 9,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7CA3FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -295,6 +325,9 @@ local function register_biomes()
|
|||
heat_point = 10,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 4,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -314,6 +347,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 5,
|
||||
_mcl_foliage_palette_index = 10,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA3FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -331,6 +367,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 5,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -351,6 +390,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 6,
|
||||
_mcl_foliage_palette_index = 11,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA2FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -369,6 +411,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 6,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = beach_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -387,6 +432,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 6,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -407,6 +455,9 @@ local function register_biomes()
|
|||
heat_point = 25,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 7,
|
||||
_mcl_foliage_palette_index = 11,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA2FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -424,6 +475,9 @@ local function register_biomes()
|
|||
heat_point = 25,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 7,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -446,6 +500,9 @@ local function register_biomes()
|
|||
vertical_blend = 6,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 8,
|
||||
_mcl_foliage_palette_index = 11,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA2FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -466,6 +523,9 @@ local function register_biomes()
|
|||
heat_point = 25,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 8,
|
||||
_mcl_foliage_palette_index = 11,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA2FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -483,6 +543,9 @@ local function register_biomes()
|
|||
heat_point = 25,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 8,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -500,6 +563,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 9,
|
||||
_mcl_foliage_palette_index = 11,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA2FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -517,6 +583,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 9,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -540,6 +609,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 10,
|
||||
_mcl_foliage_palette_index = 2,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -557,6 +629,9 @@ local function register_biomes()
|
|||
heat_point = 8,
|
||||
_mcl_biome_type = "snowy",
|
||||
_mcl_grass_palette_index = 10,
|
||||
_mcl_foliage_palette_index = 2,
|
||||
_mcl_water_palette_index = 5,
|
||||
_mcl_waterfogcolor = frozen_waterfogcolor,
|
||||
_mcl_skycolor = "#7FA1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -576,6 +651,9 @@ local function register_biomes()
|
|||
heat_point = 58,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -593,6 +671,9 @@ local function register_biomes()
|
|||
heat_point = 58,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = beach_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -610,6 +691,9 @@ local function register_biomes()
|
|||
heat_point = 58,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -629,6 +713,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 11,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -646,6 +733,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 11,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -665,6 +755,9 @@ local function register_biomes()
|
|||
heat_point = 22,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 12,
|
||||
_mcl_foliage_palette_index = 10,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = "#7DA3FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -682,6 +775,9 @@ local function register_biomes()
|
|||
heat_point = 22,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 12,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = beach_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -699,6 +795,9 @@ local function register_biomes()
|
|||
heat_point = 22,
|
||||
_mcl_biome_type = "cold",
|
||||
_mcl_grass_palette_index = 12,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 4,
|
||||
_mcl_waterfogcolor = cold_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -718,6 +817,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 13,
|
||||
_mcl_foliage_palette_index = 7,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#79A6FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -735,6 +837,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 13,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = beach_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -752,6 +857,9 @@ local function register_biomes()
|
|||
heat_point = 45,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 13,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -771,6 +879,9 @@ local function register_biomes()
|
|||
heat_point = 32,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 14,
|
||||
_mcl_foliage_palette_index = 7,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#79A6FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -788,6 +899,9 @@ local function register_biomes()
|
|||
heat_point = 32,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 14,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = beach_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -805,6 +919,9 @@ local function register_biomes()
|
|||
heat_point = 32,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 14,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -824,6 +941,9 @@ local function register_biomes()
|
|||
heat_point = 31,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 15,
|
||||
_mcl_foliage_palette_index = 8,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#7AA5FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -841,6 +961,9 @@ local function register_biomes()
|
|||
heat_point = 31,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 15,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -860,6 +983,9 @@ local function register_biomes()
|
|||
heat_point = 27,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 16,
|
||||
_mcl_foliage_palette_index = 8,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#7AA5FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -877,6 +1003,9 @@ local function register_biomes()
|
|||
heat_point = 27,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 16,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -897,6 +1026,9 @@ local function register_biomes()
|
|||
heat_point = 94,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -914,6 +1046,9 @@ local function register_biomes()
|
|||
heat_point = 94,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -933,6 +1068,9 @@ local function register_biomes()
|
|||
heat_point = 27,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 18,
|
||||
_mcl_foliage_palette_index = 7,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#79A6FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -950,6 +1088,9 @@ local function register_biomes()
|
|||
heat_point = 27,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 18,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -970,6 +1111,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 19,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -989,6 +1133,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 19,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1007,6 +1154,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 19,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1026,6 +1176,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 20,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1044,6 +1197,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 20,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1062,6 +1218,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 20,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1083,6 +1242,9 @@ local function register_biomes()
|
|||
vertical_blend = 0, -- we want a sharp transition
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 21,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1104,6 +1266,9 @@ local function register_biomes()
|
|||
heat_point = 60,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 21,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1122,6 +1287,9 @@ local function register_biomes()
|
|||
heat_point = 60,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 21,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1140,6 +1308,9 @@ local function register_biomes()
|
|||
heat_point = 60,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 21,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1163,6 +1334,9 @@ local function register_biomes()
|
|||
vertical_blend = 5,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 22,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1182,6 +1356,9 @@ local function register_biomes()
|
|||
heat_point = 60,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 22,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1202,6 +1379,9 @@ local function register_biomes()
|
|||
vertical_blend = 4,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 22,
|
||||
_mcl_foliage_palette_index = 4,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1220,6 +1400,9 @@ local function register_biomes()
|
|||
heat_point = 60,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 22,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 3,
|
||||
_mcl_waterfogcolor = warm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1240,6 +1423,9 @@ local function register_biomes()
|
|||
heat_point = 79,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 1,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1257,6 +1443,9 @@ local function register_biomes()
|
|||
heat_point = 79,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 1,
|
||||
_mcl_foliage_palette_index = 1,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = beach_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1274,6 +1463,9 @@ local function register_biomes()
|
|||
heat_point = 79,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 1,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1295,6 +1487,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 23,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#6EB1FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1312,6 +1507,9 @@ local function register_biomes()
|
|||
heat_point = 100,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 23,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1331,6 +1529,9 @@ local function register_biomes()
|
|||
heat_point = 81,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 24,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1348,6 +1549,9 @@ local function register_biomes()
|
|||
heat_point = 81,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 24,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1366,6 +1570,9 @@ local function register_biomes()
|
|||
heat_point = 81,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 24,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1386,6 +1593,9 @@ local function register_biomes()
|
|||
heat_point = 81,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 25,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1403,6 +1613,9 @@ local function register_biomes()
|
|||
heat_point = 81,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 25,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1421,6 +1634,9 @@ local function register_biomes()
|
|||
heat_point = 81,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 25,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1440,6 +1656,9 @@ local function register_biomes()
|
|||
heat_point = 76,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 26,
|
||||
_mcl_foliage_palette_index = 13,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1457,6 +1676,9 @@ local function register_biomes()
|
|||
heat_point = 76,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 26,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1479,6 +1701,9 @@ local function register_biomes()
|
|||
heat_point = 79,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 13,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1496,6 +1721,9 @@ local function register_biomes()
|
|||
heat_point = 79,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1516,6 +1744,9 @@ local function register_biomes()
|
|||
heat_point = 94,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 6,
|
||||
_mcl_water_palette_index = 7,
|
||||
_mcl_waterfogcolor = "#3A7A6A",
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1533,6 +1764,9 @@ local function register_biomes()
|
|||
heat_point = 94,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 6,
|
||||
_mcl_water_palette_index = 7,
|
||||
_mcl_waterfogcolor = "#3A7A6A",
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1551,6 +1785,9 @@ local function register_biomes()
|
|||
heat_point = 94,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 7,
|
||||
_mcl_waterfogcolor = "#3A7A6A",
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1570,6 +1807,9 @@ local function register_biomes()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 28,
|
||||
_mcl_foliage_palette_index = 5,
|
||||
_mcl_water_palette_index = 1,
|
||||
_mcl_waterfogcolor = "#617B64",
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1587,6 +1827,9 @@ local function register_biomes()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 28,
|
||||
_mcl_foliage_palette_index = 5,
|
||||
_mcl_water_palette_index = 1,
|
||||
_mcl_waterfogcolor = "#617B64",
|
||||
_mcl_skycolor = "#78A7FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1605,6 +1848,9 @@ local function register_biomes()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 28,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 1,
|
||||
_mcl_waterfogcolor = "#617B64",
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1627,6 +1873,9 @@ local function register_biomes()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 29,
|
||||
_mcl_foliage_palette_index = 17,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1645,6 +1894,9 @@ local function register_biomes()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 29,
|
||||
_mcl_foliage_palette_index = 17,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1662,6 +1914,9 @@ local function register_biomes()
|
|||
heat_point = 50,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 29,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1682,6 +1937,9 @@ local function register_biomes()
|
|||
heat_point = 95,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 24,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1699,6 +1957,9 @@ local function register_biomes()
|
|||
heat_point = 95,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 24,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1717,6 +1978,9 @@ local function register_biomes()
|
|||
heat_point = 90,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 24,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1737,6 +2001,9 @@ local function register_biomes()
|
|||
heat_point = 95,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 25,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1754,6 +2021,9 @@ local function register_biomes()
|
|||
heat_point = 90,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 25,
|
||||
_mcl_foliage_palette_index = 12,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1772,6 +2042,9 @@ local function register_biomes()
|
|||
heat_point = 95,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 25,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1791,6 +2064,9 @@ local function register_biomes()
|
|||
heat_point = 90,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 26,
|
||||
_mcl_foliage_palette_index = 13,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1808,6 +2084,9 @@ local function register_biomes()
|
|||
heat_point = 88,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 26,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1830,6 +2109,9 @@ local function register_biomes()
|
|||
heat_point = 95,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 13,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = "#77A8FF",
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1847,6 +2129,9 @@ local function register_biomes()
|
|||
heat_point = 90,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 27,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 2,
|
||||
_mcl_waterfogcolor = lukewarm_waterfogcolor,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1871,6 +2156,8 @@ local function register_biomes()
|
|||
vertical_blend = 5,
|
||||
_mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type,
|
||||
_mcl_grass_palette_index = minetest.registered_biomes[biome]._mcl_grass_palette_index,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = minetest.registered_biomes[biome]._mcl_water_palette_index,
|
||||
_mcl_skycolor = ocean_skycolor,
|
||||
_mcl_fogcolor = overworld_fogcolor
|
||||
})
|
||||
|
@ -1885,6 +2172,8 @@ local function register_biomes()
|
|||
y_max = DEEP_OCEAN_MIN - 1,
|
||||
_mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type,
|
||||
_mcl_grass_palette_index = minetest.registered_biomes[biome]._mcl_grass_palette_index,
|
||||
_mcl_foliage_palette_index = minetest.registered_biomes[biome]._mcl_foliage_palette_index,
|
||||
_mcl_water_palette_index = minetest.registered_biomes[biome]._mcl_water_palette_index,
|
||||
_mcl_skycolor = minetest.registered_biomes[biome]._mcl_skycolor,
|
||||
_mcl_fogcolor = minetest.registered_biomes[biome]._mcl_fogcolor,
|
||||
})
|
||||
|
@ -1940,6 +2229,9 @@ local function register_dimension_biomes()
|
|||
humidity_point = 0,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = nether_skycolor,
|
||||
_mcl_fogcolor = "#330808"
|
||||
})
|
||||
|
@ -1971,6 +2263,9 @@ local function register_dimension_biomes()
|
|||
humidity_point = 33,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = nether_skycolor,
|
||||
_mcl_fogcolor = "#1B4745"
|
||||
})
|
||||
|
@ -2022,6 +2317,9 @@ local function register_dimension_biomes()
|
|||
humidity_point = 47,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = nether_skycolor,
|
||||
_mcl_fogcolor = "#330303"
|
||||
})
|
||||
|
@ -2051,6 +2349,9 @@ local function register_dimension_biomes()
|
|||
humidity_point = 70,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = nether_skycolor,
|
||||
_mcl_fogcolor = "#1A051A"
|
||||
})
|
||||
|
@ -2080,6 +2381,9 @@ local function register_dimension_biomes()
|
|||
humidity_point = 80,
|
||||
_mcl_biome_type = "hot",
|
||||
_mcl_grass_palette_index = 17,
|
||||
_mcl_foliage_palette_index = 3,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = nether_skycolor,
|
||||
_mcl_fogcolor = "#685F70"
|
||||
})
|
||||
|
@ -2134,6 +2438,9 @@ local function register_dimension_biomes()
|
|||
vertical_blend = 16,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -2151,6 +2458,9 @@ local function register_dimension_biomes()
|
|||
vertical_blend = 16,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -2168,6 +2478,9 @@ local function register_dimension_biomes()
|
|||
vertical_blend = 16,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -2185,6 +2498,9 @@ local function register_dimension_biomes()
|
|||
vertical_blend = 16,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -2202,6 +2518,9 @@ local function register_dimension_biomes()
|
|||
vertical_blend = 16,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -2222,6 +2541,9 @@ local function register_dimension_biomes()
|
|||
min_pos = {x = -1250, y = mcl_vars.mg_end_min, z = -1250},
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -2240,6 +2562,9 @@ local function register_dimension_biomes()
|
|||
vertical_blend = 16,
|
||||
_mcl_biome_type = "medium",
|
||||
_mcl_grass_palette_index = 0,
|
||||
_mcl_foliage_palette_index = 0,
|
||||
_mcl_water_palette_index = 0,
|
||||
_mcl_waterfogcolor = default_waterfogcolor,
|
||||
_mcl_skycolor = end_skycolor,
|
||||
_mcl_fogcolor = end_fogcolor
|
||||
})
|
||||
|
@ -5288,6 +5613,8 @@ local function register_decorations()
|
|||
register_flower("allium", nil, 0) -- flower Forest only
|
||||
register_flower("blue_orchid", {"Swampland"}, 64500, false)
|
||||
|
||||
register_flower("lily_of_the_valley", nil, 325)
|
||||
register_flower("cornflower", flower_biomes2, 486)
|
||||
end
|
||||
|
||||
-- Decorations in non-Overworld dimensions
|
||||
|
|
|
@ -57,6 +57,7 @@ dofile(modpath.."/api.lua")
|
|||
dofile(modpath.."/ores.lua")
|
||||
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
local sea_level = tonumber(minetest.get_mapgen_setting("water_level"))
|
||||
local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true"
|
||||
|
||||
-- Content IDs
|
||||
|
@ -268,7 +269,7 @@ local function set_layers(data, area, content_id, check, min, max, minp, maxp, l
|
|||
return lvm_used
|
||||
end
|
||||
|
||||
local function set_palette(minp,maxp,data2,area,biomemap,nodes)
|
||||
local function set_grass_palette(minp,maxp,data2,area,biomemap,nodes)
|
||||
-- Flat area at y=0 to read biome 3 times faster than 5.3.0.get_biome_data(pos).biome: 43us vs 125us per iteration:
|
||||
if not biomemap then return end
|
||||
local aream = VoxelArea:new({MinEdge={x=minp.x, y=0, z=minp.z}, MaxEdge={x=maxp.x, y=0, z=maxp.z}})
|
||||
|
@ -344,13 +345,15 @@ local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, bl
|
|||
return lvm_used, lvm_used, deco, ores
|
||||
end
|
||||
|
||||
local function block_fixes(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
|
||||
local affected_grass_blocks = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"}
|
||||
|
||||
local function block_fixes_grass(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
|
||||
local biomemap = minetest.get_mapgen_object("biomemap")
|
||||
local lvm_used = false
|
||||
local pr = PseudoRandom(blockseed)
|
||||
if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then
|
||||
-- Set param2 (=color) of nodes which use the grass colour palette.
|
||||
lvm_used = set_palette(minp,maxp,data2,area,biomemap,{"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"})
|
||||
lvm_used = set_grass_palette(minp,maxp,data2,area,biomemap,affected_grass_blocks)
|
||||
end
|
||||
return lvm_used
|
||||
end
|
||||
|
@ -382,7 +385,7 @@ mcl_mapgen_core.register_generator("end_fixes", end_basic, function(minp,maxp)
|
|||
end, 9999, true)
|
||||
|
||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
||||
mcl_mapgen_core.register_generator("block_fixes", block_fixes, nil, 9999, true)
|
||||
mcl_mapgen_core.register_generator("block_fixes_grass", block_fixes_grass, nil, 9999, true)
|
||||
end
|
||||
|
||||
if mg_name == "v6" then
|
||||
|
@ -419,20 +422,92 @@ mcl_mapgen_core.register_generator("structures",nil, function(minp, maxp, blocks
|
|||
end, 100, true)
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Fix grass palette indexes",
|
||||
label = "Fix grass palette indexes", -- This LBM fixes any incorrect grass palette indexes.
|
||||
name = "mcl_mapgen_core:fix_grass_palette_indexes",
|
||||
nodenames = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"},
|
||||
run_at_every_load = true,
|
||||
nodenames = affected_grass_blocks,
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
||||
local biome_data = minetest.get_biome_data(pos)
|
||||
local biome = biome_data.biome
|
||||
local biome_name = minetest.get_biome_name(biome)
|
||||
local reg_biome = minetest.registered_biomes[biome_name]
|
||||
if node.param2 ~= reg_biome._mcl_grass_palette_index then
|
||||
node.param2 = reg_biome._mcl_grass_palette_index
|
||||
local grass_palette_index = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
|
||||
if node.param2 ~= grass_palette_index then
|
||||
node.param2 = grass_palette_index
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Fix foliage palette indexes", -- Set correct palette indexes of foliage in old mapblocks.
|
||||
name = "mcl_mapgen_core:fix_foliage_palette_indexes",
|
||||
nodenames = {"group:foliage_palette", "group:foliage_palette_wallmounted"},
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index
|
||||
local noplconvert = {"mcl_mangrove:mangroveleaves", "mcl_core:vine"} -- These do not convert into player leaves.
|
||||
if node.param2 == 1 and node.name ~= noplconvert then -- Convert old player leaves into the new versions.
|
||||
node.param2 = foliage_palette_index
|
||||
minetest.remove_node(pos) -- Required, since otherwise this conversion won't work.
|
||||
minetest.place_node(vector.offset(pos, 0, 1, 0), node) -- Offset required, since otherwise the leaves sink one node for some reason.
|
||||
elseif node.param2 ~= foliage_palette_index and node.name ~= "mcl_core:vine" then
|
||||
node.param2 = foliage_palette_index
|
||||
minetest.set_node(pos, node)
|
||||
elseif node.name == "mcl_core:vine" then
|
||||
local biome_param2 = foliage_palette_index
|
||||
local rotation_param2 = node.param2
|
||||
local final_param2 = (biome_param2 * 8) + rotation_param2
|
||||
if node.param2 ~= final_param2 and rotation_param2 < 6 then
|
||||
node.param2 = final_param2
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of foliage in new mapblocks.
|
||||
local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16)
|
||||
local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"})
|
||||
for _, fpos in pairs(foliage) do
|
||||
local fnode = minetest.get_node(fpos)
|
||||
local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(fpos).foliage_palette_index
|
||||
if fnode.param2 ~= foliage_palette_index and fnode.name ~= "mcl_core:vine" then
|
||||
fnode.param2 = foliage_palette_index
|
||||
minetest.set_node(fpos, fnode)
|
||||
elseif fnode.name == "mcl_core:vine" then
|
||||
local biome_param2 = foliage_palette_index
|
||||
local rotation_param2 = fnode.param2
|
||||
local final_param2 = (biome_param2 * 8) + rotation_param2
|
||||
if fnode.param2 ~= final_param2 and rotation_param2 < 6 then
|
||||
fnode.param2 = final_param2
|
||||
minetest.set_node(fpos, fnode)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
minetest.register_lbm({
|
||||
label = "Fix water palette indexes", -- Set correct palette indexes of water in old mapblocks.
|
||||
name = "mcl_mapgen_core:fix_water_palette_indexes",
|
||||
nodenames = {"group:water_palette"},
|
||||
run_at_every_load = false,
|
||||
action = function(pos, node)
|
||||
local water_palette_index = mcl_util.get_palette_indexes_from_pos(pos).water_palette_index
|
||||
if node.param2 ~= water_palette_index then
|
||||
node.param2 = water_palette_index
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of water in new mapblocks.
|
||||
local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16)
|
||||
local water = minetest.find_nodes_in_area(pos1, pos2, {"group:water_palette"})
|
||||
for _, wpos in pairs(water) do
|
||||
local wnode = minetest.get_node(wpos)
|
||||
local water_palette_index = mcl_util.get_palette_indexes_from_pos(wpos).water_palette_index
|
||||
if wnode.param2 ~= water_palette_index then
|
||||
wnode.param2 = water_palette_index
|
||||
minetest.set_node(wpos, wnode)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
|
|
@ -224,6 +224,14 @@ local function spawn_villagers(minp,maxp)
|
|||
end
|
||||
end
|
||||
|
||||
local function fix_village_water(minp,maxp)
|
||||
local palettenodes = minetest.find_nodes_in_area(vector.offset(minp,-20,-20,-20),vector.offset(maxp,20,20,20), "group:water_palette")
|
||||
for _, palettenodepos in pairs(palettenodes) do
|
||||
local palettenode = minetest.get_node(palettenodepos)
|
||||
minetest.set_node(palettenodepos, {name = palettenode.name})
|
||||
end
|
||||
end
|
||||
|
||||
local function init_nodes(p1, p2, size, rotation, pr)
|
||||
construct_node(p1, p2, "mcl_itemframes:item_frame")
|
||||
construct_node(p1, p2, "mcl_furnaces:furnace")
|
||||
|
@ -327,6 +335,7 @@ function settlements.place_schematics(settlement_info, pr)
|
|||
else
|
||||
init_nodes(p1, p2, size, rotation, pr)
|
||||
spawn_villagers(p1,p2)
|
||||
fix_village_water(p1,p2)
|
||||
end
|
||||
end,
|
||||
pr
|
||||
|
|
|
@ -115,6 +115,15 @@ mobs_griefing (Mobs change blocks) bool true
|
|||
# If enabled, mobs won't damage particles when they got hurt.
|
||||
mobs_disable_blood (Disable mob damage particles) bool false
|
||||
|
||||
#Percentage of peaceful spawn attempts that succeed (default:35)
|
||||
mcl_mob_peaceful_percentage_spawned (Peaceful percentage success) int 35 0 100
|
||||
|
||||
#Percentage of peaceful spawn attempts that are group spawns (default:15)
|
||||
mcl_mob_peaceful_group_percentage_spawned (Peaceful group percentage) int 15 0 100
|
||||
|
||||
#Percentage of hostile spawn attempts that are group spawns (default:20)
|
||||
mcl_mob_hostile_group_percentage_spawned (Hostile group percentage) int 20 0 100
|
||||
|
||||
#Maximum amount mobs (default:500)
|
||||
mcl_mob_cap_total (Global mob cap) int 500 0 2048
|
||||
|
||||
|
@ -124,8 +133,11 @@ mcl_mob_cap_player (Mob cap per player) int 75 0 2048
|
|||
#Maximum amount of monsters that will spawn near a player (default:70)
|
||||
mcl_mob_cap_monster (Mob cap monsters) int 70 0 2048
|
||||
|
||||
#Maximum amount of animals that will spawn near a player (default:10)
|
||||
mcl_mob_cap_animal (Mob cap animals) int 10 0 1024
|
||||
#Maximum amount of animals that will spawn near a player (default:13)
|
||||
mcl_mob_cap_animal (Mob cap animals) int 13 0 1024
|
||||
|
||||
#Maximum amount of water mobs that will spawn near a player (default:8)
|
||||
mcl_mob_cap_water (Mob cap water) int 8 0 1024
|
||||
|
||||
#Maximum amount of ambient mobs that will spawn near a player (default:15)
|
||||
mcl_mob_cap_ambient (Mob cap ambient mobs) int 15 0 1024
|
||||
|
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 785 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 647 B |
Before Width: | Height: | Size: 455 B |
Before Width: | Height: | Size: 840 B After Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |