Compare commits
2 Commits
600c83ea04
...
26a73117a9
| Author | SHA1 | Date | |
|---|---|---|---|
| 26a73117a9 | |||
| 87e5304acd |
@@ -113,7 +113,7 @@ function Tree:place(pos)
|
||||
local pos1, pos2 = pos - v(16, 0, 16), pos + v(16, 80, 16) --[[@as MapVector]]
|
||||
|
||||
if isAreaGenerated(pos1, pos2) then
|
||||
corePlaceSchematic(pos, self.path, getRotation(pos), nil, nil, 'place_center_x, place_center_z')
|
||||
corePlaceSchematic(pos, self.path, getRotation(pos), nil, false, 'place_center_x, place_center_z')
|
||||
else
|
||||
coreEmergeArea(pos1, pos2)
|
||||
end
|
||||
@@ -122,7 +122,7 @@ end
|
||||
---@param voxelManip VoxelManip
|
||||
---@param pos MapVector
|
||||
function Tree:placeOnVM(voxelManip, pos)
|
||||
local result = corePlaceSchematicOnVM(voxelManip, pos, self.path, getRotation(pos), nil, nil, 'place_center_x, place_center_z')
|
||||
local result = corePlaceSchematicOnVM(voxelManip, pos, self.path, getRotation(pos), nil, false, 'place_center_x, place_center_z')
|
||||
|
||||
if not result then
|
||||
voxelManip:set_node_at(pos, {name = self.placerName, force_place = true})
|
||||
|
||||
@@ -62,3 +62,18 @@ function Smc.getItemDefinition(itemName)
|
||||
|
||||
return item.itemDef
|
||||
end
|
||||
|
||||
---@param itemName ItemStack|ItemStackString
|
||||
---@return Item.ItemDefinition|Node.NodeDefinition|nil
|
||||
function Smc.getItemDefinitionOrNil(itemName)
|
||||
if type(itemName) ~= 'string' then
|
||||
itemName = itemName:get_name()
|
||||
end
|
||||
|
||||
local item = Smc.getRegisteredItemByName(itemName)
|
||||
if item == nil then
|
||||
return nil
|
||||
end
|
||||
|
||||
return item.itemDef
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user