Move settings into settings.lua
parent
c58f022570
commit
26d76dced9
|
@ -226,7 +226,7 @@ end
|
||||||
|
|
||||||
local tool_uses = {0, 30, 110, 150, 280, 300, 500, 1000}
|
local tool_uses = {0, 30, 110, 150, 280, 300, 500, 1000}
|
||||||
local function addWearout(player, tool_def)
|
local function addWearout(player, tool_def)
|
||||||
if not core.settings:get_bool("creative_mode") then
|
if not cmer.creative then
|
||||||
local item = player:get_wielded_item()
|
local item = player:get_wielded_item()
|
||||||
if tool_def and tool_def.damage_groups and tool_def.damage_groups.fleshy then
|
if tool_def and tool_def.damage_groups and tool_def.damage_groups.fleshy then
|
||||||
local uses = tool_uses[tool_def.damage_groups.fleshy] or 0
|
local uses = tool_uses[tool_def.damage_groups.fleshy] or 0
|
||||||
|
@ -241,7 +241,8 @@ end
|
||||||
|
|
||||||
local function spawnParticles(...)
|
local function spawnParticles(...)
|
||||||
end
|
end
|
||||||
if core.settings:get_bool("creatures_enable_particles") == true then
|
|
||||||
|
if cmer.enable_particles then
|
||||||
spawnParticles = function(pos, velocity, texture_str)
|
spawnParticles = function(pos, velocity, texture_str)
|
||||||
local vel = vector.multiply(velocity, 0.5)
|
local vel = vector.multiply(velocity, 0.5)
|
||||||
vel.y = 0
|
vel.y = 0
|
||||||
|
|
1
init.lua
1
init.lua
|
@ -46,6 +46,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
local scripts = {
|
local scripts = {
|
||||||
|
"settings",
|
||||||
"common",
|
"common",
|
||||||
"functions",
|
"functions",
|
||||||
"register",
|
"register",
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
-- @module register.lua
|
-- @module register.lua
|
||||||
|
|
||||||
|
|
||||||
local allow_hostile = core.settings:get_bool("only_peaceful_mobs") ~= true
|
|
||||||
|
|
||||||
local function translate_def(def)
|
local function translate_def(def)
|
||||||
local new_def = {
|
local new_def = {
|
||||||
physical = true,
|
physical = true,
|
||||||
|
@ -201,7 +199,7 @@ local function translate_def(def)
|
||||||
|
|
||||||
self.object:set_hp(self.hp)
|
self.object:set_hp(self.hp)
|
||||||
|
|
||||||
if not core.settings:get_bool("enable_damage") then
|
if not cmer.enable_damage then
|
||||||
self.hostile = false
|
self.hostile = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -266,7 +264,7 @@ function cmer.register_mob(def) -- returns true if sucessfull
|
||||||
core.register_entity(":" .. def.name, mob_def)
|
core.register_entity(":" .. def.name, mob_def)
|
||||||
|
|
||||||
-- register spawn
|
-- register spawn
|
||||||
if def.spawning and not (def.stats.hostile and not allow_hostile) then
|
if def.spawning and not (def.stats.hostile and not cmer.allow_hostile) then
|
||||||
local spawn_def = def.spawning
|
local spawn_def = def.spawning
|
||||||
spawn_def.mob_name = def.name
|
spawn_def.mob_name = def.name
|
||||||
spawn_def.mob_size = def.model.collisionbox
|
spawn_def.mob_size = def.model.collisionbox
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
cmer.enable_particles = core.settings:get_bool("creatures_enable_particles", false)
|
||||||
|
|
||||||
|
cmer.allow_hostile = core.settings:get_bool("only_peaceful_mobs") ~= true
|
||||||
|
|
||||||
|
cmer.enable_damage = core.settings:get_bool("enable_damage", false)
|
||||||
|
|
||||||
|
cmer.creative = core.settings:get_bool("creative_mode", false)
|
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
# Only spawn mobs that don't attack players.
|
||||||
|
only_peaceful_mobs (Peaceful only) bool false
|
||||||
|
|
||||||
|
creatures_enable_particles (Enable particles) bool false
|
Loading…
Reference in New Issue