Skip to content

Commit

Permalink
Merge pull request #72 from Skamiz/foo
Browse files Browse the repository at this point in the history
some small fixes
  • Loading branch information
Gerold55 authored Sep 1, 2020
2 parents d93e5a8 + 899ccdb commit 7025d63
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 28 deletions.
8 changes: 4 additions & 4 deletions mods/hbhunger/hunger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ local function poisenp(tick, time, time_left, player)
if player:get_hp()-1 > 0 then
player:set_hp(player:get_hp()-1)
end

end

function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound)
Expand All @@ -79,7 +79,7 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
if h == nil or hp == nil then
return
end
minetest.sound_play({name = sound or "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16})
minetest.sound_play({name = sound or "hbhunger_eat_generic", gain = 1}, {pos=user:get_pos(), max_hear_distance = 16})

-- Saturation
if h < 30 and hunger_change then
Expand Down Expand Up @@ -109,7 +109,7 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
if inv:room_for_item("main", replace_with_item) then
inv:add_item("main", replace_with_item)
else
minetest.add_item(user:getpos(), replace_with_item)
minetest.add_item(user:get_pos(), replace_with_item)
end
end
end
Expand Down Expand Up @@ -140,7 +140,7 @@ if minetest.get_modpath("mobs") ~= nil then
hbhunger.register_food("mobs:chicken_cooked", 6)
hbhunger.register_food("mobs:chicken_raw", 2, "", 3)
hbhunger.register_food("mobs:chicken_egg_fried", 2)
if minetest.get_modpath("bucket") then
if minetest.get_modpath("bucket") then
hbhunger.register_food("mobs:bucket_milk", 3, "bucket:bucket_empty")
end
else
Expand Down
6 changes: 3 additions & 3 deletions mods/ruins/loot.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
local loot = {
--on average 1 torches min 0 max 3
{name="ws_core:lantern_floor",mid=1,var=2},
{name="ws_core:lantern",mid=1,var=2},
--on average 0 picks min 0 max 1
--mid value 0.15 increases the chance of getting to 15%
{name="ws_core:pick_scrap",mid=.15,var=1},
--mid value 0.30 increases the chance of getting to 30%
{name="ws_core:scrap",mid=.3,var=1},
--on average 8 wood min 0 max 16
--25% chance to get 0 wood
{name="ws_core:planks_old",mid=8,var=16},
Expand Down
2 changes: 1 addition & 1 deletion mods/ws_core/craftitems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if inv:room_for_item("main", new_stack) then
inv:add_item("main", new_stack)
else
minetest.add_item(player:getpos(), new_stack)
minetest.add_item(player:get_pos(), new_stack)
end
else
stack:get_meta():from_table({ fields = data })
Expand Down
14 changes: 7 additions & 7 deletions mods/ws_core/item_entity.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- mods/ws_core/item_entity.lua
--
--
--
--
--
--
-- If item_entity_ttl is not set, enity will have default life time
-- Setting it to -1 disables the feature

Expand Down Expand Up @@ -31,7 +31,7 @@ minetest.register_entity(":__builtin:item", {
-- Pushing item out of solid nodes
force_out = nil,
force_out_start = nil,

burn_up = function(self)
-- disappear in a smoke puff
local p = self.object:get_pos()
Expand Down Expand Up @@ -68,7 +68,7 @@ minetest.register_entity(":__builtin:item", {
if stack and flammable > 0 then
self.flammable = flammable
end

if self.itemstring == "" then
-- item not yet known
return
Expand Down Expand Up @@ -210,7 +210,7 @@ minetest.register_entity(":__builtin:item", {
if self.ignite_timer > 10 then
self.ignite_timer = 0

local snode = minetest.get_node_or_nil(self.object:getpos())
local snode = minetest.get_node_or_nil(self.object:get_pos())
if not snode then
return
end
Expand All @@ -228,7 +228,7 @@ minetest.register_entity(":__builtin:item", {
end
end
end

if self.force_out then
-- This code runs after the entity got a push from the is_stuck code.
-- It makes sure the entity is entirely outside the solid node
Expand Down
19 changes: 6 additions & 13 deletions mods/ws_core/nodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ minetest.register_node("ws_core:grass_block", {
drop = {
max_items = 1,
items = {
{items = {'ws_core:bone'}, rarity = 13},
{items = {'ws_core:bone_shard'}, rarity = 13},
{items = {'ws_core:dirt'}}
}
}
Expand All @@ -119,7 +119,7 @@ minetest.register_node("ws_core:dirt", {
drop = {
max_items = 1,
items = {
{items = {'ws_core:bone'}, rarity = 13},
{items = {'ws_core:bone_shard'}, rarity = 13},
{items = {'ws_core:dirt'}}
}
}
Expand All @@ -135,7 +135,7 @@ minetest.register_node("ws_core:dirt_dry", {
drop = {
max_items = 1,
items = {
{items = {'ws_core:bone'}, rarity = 13},
{items = {'ws_core:bone_shard'}, rarity = 13},
{items = {'ws_core:dirt_dry'}}
}
}
Expand Down Expand Up @@ -169,7 +169,7 @@ minetest.register_node("ws_core:dirt_dry_forest", {
drop = {
max_items = 1,
items = {
{items = {'ws_core:bone'}, rarity = 13},
{items = {'ws_core:bone_shard'}, rarity = 13},
{items = {'ws_core:dirt_dry'}}
}
}
Expand All @@ -194,7 +194,7 @@ minetest.register_node("ws_core:clay_dirt", {
drop = {
max_items = 1,
items = {
{items = {'ws_core:bone'}, rarity = 13},
{items = {'ws_core:bone_shard'}, rarity = 13},
{items = {'ws_core:clay_lump'}, rarity = 13},
{items = {'ws_core:clay_dirt'}}
}
Expand Down Expand Up @@ -1164,14 +1164,7 @@ minetest.register_node("ws_core:bone", {
{name = "ws_bone.png",
tileable_vertical = false}},
paramtype2 = "facedir",
groups = {cracky = 1},
groups = {cracky = 3},
on_place = minetest.rotate_node,
sounds = ws_core.node_sound_dirt_defaults(),
drop = {
max_items = 1,
items = {
{items = {'ws_core:bone'}}
}
}
})

0 comments on commit 7025d63

Please sign in to comment.