1
0
Fork 0

Merge pull request 'master' (#11) from MineClone2/MineClone2:master into bone_meal

Reviewed-on: NO11/MineClone2#11
This commit is contained in:
NO11 2021-11-10 17:13:54 +00:00
commit fafa47d643
4 changed files with 33 additions and 5 deletions

View File

@ -1,5 +1,27 @@
mcl_util = {} mcl_util = {}
-- Updates all values in t using values from to*.
function table.update(t, ...)
for _, to in ipairs{...} do
for k,v in pairs(to) do
t[k] = v
end
end
return t
end
-- Updates nil values in t using values from to*.
function table.update_nil(t, ...)
for _, to in ipairs{...} do
for k,v in pairs(to) do
if t[k] == nil then
t[k] = v
end
end
end
return t
end
-- Based on minetest.rotate_and_place -- Based on minetest.rotate_and_place
--[[ --[[

View File

@ -12,7 +12,7 @@ Params:
* pos: position * pos: position
## mcl_worlds.y_to_layer(y) ## mcl_worlds.y_to_layer(y)
This function is used to calculate the minetest y layer and dimension of the given <y> minecraft layer. This function is used to calculate the minetest y layer and dimension of the given <y> minecraft layer.
Mainly used for ore generation. Mainly used for ore generation.
Takes an Y coordinate as input and returns: Takes an Y coordinate as input and returns:
@ -78,4 +78,4 @@ Table containing all function registered with mcl_worlds.register_on_dimension_c
Notify this mod of a dimension change of <player> to <dimension> Notify this mod of a dimension change of <player> to <dimension>
* player: player, player who changed the dimension * player: player, player who changed the dimension
* dimension: string, new dimension ("overworld", "nether", "end", "void") * dimension: string, new dimension ("overworld", "nether", "end", "void")

View File

@ -115,7 +115,7 @@ local boat = {
collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh", visual = "mesh",
mesh = "mcl_boats_boat.b3d", mesh = "mcl_boats_boat.b3d",
textures = {"mcl_boats_texture_oak_boat.png"}, textures = {"mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png", "mcl_boats_texture_oak_boat.png"},
visual_size = boat_visual_size, visual_size = boat_visual_size,
hp_max = boat_max_hp, hp_max = boat_max_hp,
damage_texture_modifier = "^[colorize:white:0", damage_texture_modifier = "^[colorize:white:0",
@ -148,6 +148,11 @@ function boat.on_activate(self, staticdata, dtime_s)
self._v = data.v self._v = data.v
self._last_v = self._v self._last_v = self._v
self._itemstring = data.itemstring self._itemstring = data.itemstring
while #data.textures < 5 do
table.insert(data.textures, data.textures[1])
end
self.object:set_properties({textures = data.textures}) self.object:set_properties({textures = data.textures})
end end
end end
@ -434,8 +439,9 @@ for b=1, #boat_ids do
pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground)) pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground))
end end
local boat = minetest.add_entity(pos, "mcl_boats:boat") local boat = minetest.add_entity(pos, "mcl_boats:boat")
local texture = "mcl_boats_texture_"..images[b].."_boat.png"
boat:get_luaentity()._itemstring = itemstring boat:get_luaentity()._itemstring = itemstring
boat:set_properties({textures = { "mcl_boats_texture_"..images[b].."_boat.png" }}) boat:set_properties({textures = { texture, texture, texture, texture, texture }})
boat:set_yaw(placer:get_look_horizontal()) boat:set_yaw(placer:get_look_horizontal())
if not minetest.is_creative_enabled(placer:get_player_name()) then if not minetest.is_creative_enabled(placer:get_player_name()) then
itemstack:take_item() itemstack:take_item()

View File

@ -183,7 +183,7 @@ minetest.register_entity("mcl_enchanting:book", {
collisionbox = {0, 0, 0}, collisionbox = {0, 0, 0},
pointable = false, pointable = false,
physical = false, physical = false,
textures = {"mcl_enchanting_book_entity.png"}, textures = {"mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png", "mcl_enchanting_book_entity.png"},
static_save = false, static_save = false,
}, },
_player_near = false, _player_near = false,