diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index 9e1c1edb28..a609ec9b7c 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -2,10 +2,10 @@ All mobs in this mod must use variables in this table, instead of hardcoding the itemstring. This way, external mods are enabled to replace the itemstrings to provide -their own items and subgame integration is made much simpler. +their own items and game integration is made much simpler. An item IDs is supposed to be overwritten by adding -mobs_mc.override.items["example:item"] in a subgame mod +mobs_mc.override.items["example:item"] in a game mod with name "mobs_mc_gameconfig". ]] @@ -147,7 +147,7 @@ mobs_mc.items = { -- Light blue intentionally missing -- Special items - music_discs = {}, -- No music discs by default; used by creeper. Override this if your subgame has music discs. + music_discs = {}, -- No music discs by default; used by creeper. Override this if your game has music discs. } -- Tables for attracting, feeding and breeding mobs diff --git a/mods/ENTITIES/mobs_mc/README.md b/mods/ENTITIES/mobs_mc/README.md index 9d05149500..d3ac29a16b 100644 --- a/mods/ENTITIES/mobs_mc/README.md +++ b/mods/ENTITIES/mobs_mc/README.md @@ -19,8 +19,8 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers ## Useful information for developers -### Subgame integration -Want to include this mod in your subgame? Read `gameconfig.md`. +### Game integration +Want to include this mod in your game? Read `gameconfig.md`. ### Links diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index 02d7e04c71..552dffd572 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -96,6 +96,7 @@ mobs:register_mob("mobs_mc:enderdragon", { }) +local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false mobs:register_arrow("mobs_mc:roar_of_the_dragon2", { visual = "sprite", @@ -131,13 +132,15 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon2", { end end - minetest.set_node(pos, {name="air"}) - if math.random(1,2)==1 then - local dx = math.random(-1,1) - local dy = math.random(-1,1) - local dz = math.random(-1,1) - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - minetest.set_node(p, {name="air"}) + if mobs_griefing then + minetest.set_node(pos, {name="air"}) + if math.random(1,2)==1 then + local dx = math.random(-1,1) + local dy = math.random(-1,1) + local dz = math.random(-1,1) + local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + minetest.set_node(p, {name="air"}) + end end end }) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index f0294c5b99..1b60dac602 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -161,6 +161,8 @@ local select_enderman_animation = function(animation_type) end end +local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false + mobs:register_mob("mobs_mc:enderman", { -- TODO: Make endermen attack when looked at type = "animal", @@ -194,6 +196,9 @@ mobs:register_mob("mobs_mc:enderman", { animation = select_enderman_animation("normal"), _taken_node = "", do_custom = function(self, dtime) + if not mobs_griefing then + return + end -- Take and put nodes if not self._take_place_timer or not self._next_take_place_time then self._take_place_timer = 0 diff --git a/mods/ENTITIES/mobs_mc/gameconfig.md b/mods/ENTITIES/mobs_mc/gameconfig.md index dabfb9359e..8394a053c0 100644 --- a/mods/ENTITIES/mobs_mc/gameconfig.md +++ b/mods/ENTITIES/mobs_mc/gameconfig.md @@ -1,8 +1,8 @@ -# Subgame integration help +# Game integration help -This mod has been designed to make subgame integration rather easy. Ideally, it should be possible to include this mod verbatim in your subgame, with modifications only done by an external mod. +This mod has been designed to make game integration rather easy. Ideally, it should be possible to include this mod verbatim in your game, with modifications only done by an external mod. -To integrate this mod in a subgame, you have to do 2 things: Adding the mod, and adding another mod which tells `mobs_mc` which items to use. The idea is that `mobs_mc` should work with any items. Specifically, these are the steps you need to follow: +To integrate this mod in a game, you have to do 2 things: Adding the mod, and adding another mod which tells `mobs_mc` which items to use. The idea is that `mobs_mc` should work with any items. Specifically, these are the steps you need to follow: * Add the `mobs_mc` mod and its dependencies * Add a mod with name “`mobs_mc_gameconfig`” @@ -21,7 +21,7 @@ Some things to note: * Every override is optional, but explicitly setting all the item overrides is strongly recommended * `mobs_mc` ships many (but not all) items on its own. If not item name override is set, the `mobs_mc` item is used - * You decide whether your subgame defines its own items, outside of `mobs_mc` or if you let `mobs_mc` do the work. + * You decide whether your game defines its own items, outside of `mobs_mc` or if you let `mobs_mc` do the work. * Make sure to avoid duplicate items! * After finishing this, throughly test this * Without `mobs_mc_gameconfig`, the mod assumes Minetest Game items diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index 8756f5dc76..0f07a8616d 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -8,6 +8,8 @@ local MP = minetest.get_modpath(minetest.get_current_modname()) local S, NS = dofile(MP.."/intllib.lua") local snow_trail_frequency = 0.5 -- Time in seconds for checking to add a new snow trail +local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false + mobs:register_mob("mobs_mc:snowman", { type = "npc", passive = true, @@ -51,6 +53,9 @@ mobs:register_mob("mobs_mc:snowman", { }, blood_amount = 0, do_custom = function(self, dtime) + if not mobs_griefing then + return + end -- Leave a trail of top snow behind. -- This is done in do_custom instead of just using replace_what because with replace_what, -- the top snop may end up floating in the air. diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 65d8ed9b29..a29cbef12c 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -73,6 +73,8 @@ mobs:register_mob("mobs_mc:wither", { blood_amount = 0, }) +local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false + mobs:register_arrow("mobs_mc:roar_of_the_dragon", { visual = "sprite", visual_size = {x = 1, y = 1}, @@ -106,13 +108,15 @@ mobs:register_arrow("mobs_mc:roar_of_the_dragon", { end end - minetest.set_node(pos, {name="air"}) - if math.random(1,2)==1 then - dx = math.random(-1,1) - dy = math.random(-1,1) - dz = math.random(-1,1) - local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} - minetest.set_node(p, {name="air"}) + if mobs_griefing then + minetest.set_node(pos, {name="air"}) + if math.random(1,2)==1 then + local dx = math.random(-1,1) + local dy = math.random(-1,1) + local dz = math.random(-1,1) + local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + minetest.set_node(p, {name="air"}) + end end end })