Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ draconis.dragon_api = {
end
local item, item_name = self:follow_wielded_item(player)
if item_name then
if not minetest.is_creative_enabled(player) then
if not minetest.is_creative_enabled(player:get_player_name()) then
item:take_item()
player:set_wielded_item(item)
end
Expand Down Expand Up @@ -1514,7 +1514,7 @@ draconis.wyvern_api = {
end
local item, item_name = self:follow_wielded_item(player)
if item_name then
if not minetest.is_creative_enabled(player) then
if not minetest.is_creative_enabled(player:get_player_name()) then
item:take_item()
player:set_wielded_item(item)
end
Expand Down
8 changes: 4 additions & 4 deletions api/behaviors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ local function find_target(self, list)
local targets = creatura.get_nearby_players(self)
if #targets > 0 then -- If there are players nearby
local target = targets[random(#targets)]
local is_creative = target:is_player() and minetest.is_creative_enabled(target)
local is_creative = target:is_player() and minetest.is_creative_enabled(target:get_player_name())
local is_owner = owner and target == owner
if is_creative or is_owner then targets = {} end
end
Expand All @@ -155,7 +155,7 @@ creatura.register_movement_method("draconis:fly_pathfind", function(self)
local steer_to
local steer_timer = 0.01
local width = self.width
local wayp_threshold = width + (width / self.turn_rate)
local wayp_threshold = width + (width / self.turn_rate or 6)

self:set_gravity(0)
local function func(_self, goal, speed_x)
Expand Down Expand Up @@ -196,7 +196,7 @@ creatura.register_movement_method("draconis:fly_simple", function(self)
local steer_to
local steer_timer = 0.25
local width = self.width
local wayp_threshold = width + (width / self.turn_rate)
local wayp_threshold = width + (width / (self.turn_rate or 6))

self:set_gravity(0)
local function func(_self, goal, speed_factor)
Expand All @@ -216,7 +216,7 @@ creatura.register_movement_method("draconis:fly_simple", function(self)
local dir = (steer_to or vec_dir(pos, goal))
_self:set_forward_velocity(speed)
_self:set_vertical_velocity(speed * dir.y)
_self:tilt_to(dir2yaw(dir), turn_rate)
_self:tilt_to(dir2yaw(dir), turn_rate or 6)
end
return func
end)
Expand Down
2 changes: 1 addition & 1 deletion craftitems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ minetest.register_craftitem("draconis:draconic_steel_ingot_ice", {
----------

local function egg_rightclick(self, clicker, item)
if not minetest.is_creative_enabled(clicker) then
if not minetest.is_creative_enabled(clicker:is_player() and clicker:get_player_name() or "") then
local inv = clicker:get_inventory()
if inv:room_for_item("main", {name = item}) then
clicker:get_inventory():add_item("main", item)
Expand Down
14 changes: 11 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@ draconis.sounds = {
dirt = {}
}

draconis.has_mcl = minetest.get_modpath("mcl_core")

if minetest.get_modpath("default") then
if default.node_sound_wood_defaults then
draconis.sounds.wood = default.node_sound_wood_defaults()
elseif draconis.has_mcl then
draconis.sounds.wood = mcl_sounds.node_sound_wood_defaults()
end
if default.node_sound_stone_defaults then
draconis.sounds.stone = default.node_sound_stone_defaults()
elseif draconis.has_mcl then
draconis.sounds.stone = mcl_sounds.node_sound_stone_defaults()
end
if default.node_sound_dirt_defaults then
draconis.sounds.dirt = default.node_sound_dirt_defaults()
elseif draconis.has_mcl then
draconis.sounds.dirt = mcl_sounds.node_sound_dirt_defaults()
end
end

Expand All @@ -55,9 +63,9 @@ draconis.colors_ice = {

draconis.global_nodes = {}

draconis.global_nodes["flame"] = "fire:basic_flame"
draconis.global_nodes["ice"] = "default:ice"
draconis.global_nodes["steel_blockj"] = "default:steelblock"
draconis.global_nodes["flame"] = draconis.has_mcl and "mcl_fire:fire" or "fire:basic_flame"
draconis.global_nodes["ice"] = draconis.has_mcl and "mcl_core:ice" or "default:ice"
draconis.global_nodes["steel_blockj"] = draconis.has_mcl and "mcl_core:ironblock" or "default:steelblock"

minetest.register_on_mods_loaded(function()
for name, def in pairs(minetest.registered_nodes) do
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = draconis
depends = creatura
optional_depends = default, mcl_player, stairs, 3d_armor
optional_depends = default, mcl_player, stairs, 3d_armor, mcl_core
description = Adds advanced Dragons and powerful equipment
title = Draconis

7 changes: 3 additions & 4 deletions nodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ local random = math.random
-- Get Craft Items --

local steel_ingot = "default:steel_ingot"

local stack_size = 99
minetest.register_on_mods_loaded(function()
for name in pairs(minetest.registered_items) do
for name, def in pairs(minetest.registered_items) do
if name:match(":steel_ingot") or name:match(":ingot_steel")
or name:match(":iron_ingot") or name:match(":ingot_iron") then
steel_ingot = name
stack_size = def.stack_max or stack_size
break
end
end
Expand Down Expand Up @@ -251,8 +252,6 @@ register_node("draconis:bone_pile_frozen", {
-- Draconic Steel Forge --
--------------------------

local stack_size = minetest.registered_items[steel_ingot].stack_max or 99

local forge_core = {
["draconis:draconic_forge_fire"] = "draconis:dragonstone_block_fire",
["draconis:draconic_forge_ice"] = "draconis:dragonstone_block_ice"
Expand Down