Compare commits
6 Commits
909f20992e
...
2.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| d47c4ad2ae | |||
| 5b2a9b09e8 | |||
| 4ed120bea3 | |||
| 0219e61908 | |||
| 0329750877 | |||
| 27479f302c |
28
README.md
28
README.md
@@ -1,25 +1,35 @@
|
|||||||
# IndustrialTest
|
# IndustrialTest
|
||||||
IndustrialTest is a mod for [Minetest](https://www.minetest.net/) that adds various tech and machinery related stuff.
|
IndustrialTest is a mod for [Minetest](https://luanti.org) that adds various tech and machinery related stuff.
|
||||||
|
|
||||||
|
## Guide
|
||||||
|
Guide can be accessed in-game using `/industrialtest_guide` command.
|
||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
Currently IndustrialTest supports following games:
|
Currently IndustrialTest supports following games:
|
||||||
- [Minetest Game](https://content.minetest.net/packages/Minetest/minetest_game) and derivatives
|
- [Minetest Game](https://content.luanti.org/packages/Minetest/minetest_game) and derivatives
|
||||||
- [MineClone2](https://content.minetest.net/packages/Wuzzy/mineclone2/) and derivatives
|
- [VoxeLibre](https://content.luanti.org/packages/Wuzzy/mineclone2) and derivatives
|
||||||
|
|
||||||
## Additional dependencies
|
## Additional dependencies
|
||||||
- Minetest Game
|
- Minetest Game
|
||||||
- [3D Armor](https://content.minetest.net/packages/stu/3d_armor)
|
- [3D Armor](https://content.luanti.org/packages/stu/3d_armor)
|
||||||
- VoxeLibre
|
- VoxeLibre
|
||||||
- none
|
- none
|
||||||
|
|
||||||
## Optional dependencies
|
## Optional dependencies
|
||||||
- [Rubber Addon for MineClone](https://content.minetest.net/packages/biochemist/mcl_rubber)
|
- [Rubber Addon for MineClone](https://content.luanti.org/packages/biochemist/mcl_rubber)
|
||||||
- [Pipeworks](https://content.minetest.net/packages/VanessaE/pipeworks)
|
- [Pipeworks](https://content.luanti.org/packages/VanessaE/pipeworks)
|
||||||
- [Logistica](https://content.minetest.net/packages/ZenonSeth/logistica)
|
- [Logistica](https://content.luanti.org/packages/ZenonSeth/logistica)
|
||||||
- [Mesecons](https://content.minetest.net/packages/Jeija/mesecons)
|
- [Mesecons](https://content.luanti.org/packages/Jeija/mesecons)
|
||||||
|
|
||||||
|
## Locale
|
||||||
|
Mod is available in following languages:
|
||||||
|
- English / en_US (base)
|
||||||
|
- Polish / pl_PL (by mrkubax10)
|
||||||
|
|
||||||
|
New translations highly appreciated!
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
||||||
- HandfulOfFrogs <<handfuloffrogs@gmail.com>> [some programming, graphics]
|
- HandfulOfFrogs <<handfuloffrogs@gmail.com>> [some programming, graphics]
|
||||||
- LuanHawk <Discord: LuanHawk#8733> [lead graphics]
|
- LuanHawk <Discord: luanhawk> [lead graphics]
|
||||||
- Migdyn <<temp1@cubesoftware.xyz>> [graphics]
|
- Migdyn <<temp1@cubesoftware.xyz>> [graphics]
|
||||||
|
|||||||
@@ -95,7 +95,11 @@ function industrialtest.ElectricMachine.onTimer(self,pos,elapsed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function industrialtest.ElectricMachine.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
|
function industrialtest.ElectricMachine.allowMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
|
||||||
|
local meta=minetest.get_meta(pos)
|
||||||
|
local inv=meta:get_inventory()
|
||||||
|
local movedItemStack=inv:get_stack(fromList,fromIndex)
|
||||||
local found=false
|
local found=false
|
||||||
|
|
||||||
if self.powerLists then
|
if self.powerLists then
|
||||||
for _,value in ipairs(self.powerLists) do
|
for _,value in ipairs(self.powerLists) do
|
||||||
if value.list==toList then
|
if value.list==toList then
|
||||||
@@ -104,7 +108,7 @@ function industrialtest.ElectricMachine.allowMetadataInventoryMove(self,pos,from
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if found and not industrialtest.api.hasPowerStorage(movedItemStack:get_meta()) then
|
if found and not industrialtest.api.hasPowerStorage(movedItemStack:get_meta()) and not self.isValidElectricItemDef(movedItemStack) then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -121,7 +125,7 @@ function industrialtest.ElectricMachine.allowMetadataInventoryPut(self,pos,listn
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if found and not industrialtest.api.hasPowerStorage(stack:get_meta()) then
|
if found and not industrialtest.api.hasPowerStorage(stack:get_meta()) and not self.isValidElectricItemDef(stack) then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -205,6 +209,11 @@ function industrialtest.ElectricMachine.powerExchange(self,pos)
|
|||||||
local powerFlow=meta:get_int("industrialtest.powerFlow")
|
local powerFlow=meta:get_int("industrialtest.powerFlow")
|
||||||
for _,listDesc in ipairs(self.powerLists) do
|
for _,listDesc in ipairs(self.powerLists) do
|
||||||
local slot=inv:get_stack(listDesc.list,1)
|
local slot=inv:get_stack(listDesc.list,1)
|
||||||
|
if not industrialtest.api.hasPowerStorage(slot:get_meta()) and self.isValidElectricItemDef(slot) then
|
||||||
|
local def=slot:get_definition()
|
||||||
|
def._industrialtest_self:prepare(slot)
|
||||||
|
inv:set_stack(listDesc.list,1,slot)
|
||||||
|
end
|
||||||
if slot:get_count()>0 then
|
if slot:get_count()>0 then
|
||||||
if listDesc.direction=="o" then
|
if listDesc.direction=="o" then
|
||||||
if meta:get_int("industrialtest.powerAmount")<=0 then
|
if meta:get_int("industrialtest.powerAmount")<=0 then
|
||||||
@@ -235,6 +244,12 @@ function industrialtest.ElectricMachine.powerExchange(self,pos)
|
|||||||
return shouldRerunTimer
|
return shouldRerunTimer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Checks if itemstack has a valid electric item definition, even if it's not prepared
|
||||||
|
function industrialtest.ElectricMachine.isValidElectricItemDef(itemstack)
|
||||||
|
local def=itemstack:get_definition()
|
||||||
|
return def._industrialtest_self and def._industrialtest_self.flow and def._industrialtest_self.flow and def._industrialtest_self.prepare
|
||||||
|
end
|
||||||
|
|
||||||
function industrialtest.ElectricMachine.createPowerIndicatorWidget(charged,x,y)
|
function industrialtest.ElectricMachine.createPowerIndicatorWidget(charged,x,y)
|
||||||
return table.concat({
|
return table.concat({
|
||||||
string.format("box[%f,%f;0.3,4.8;#202020]",x,y),
|
string.format("box[%f,%f;0.3,4.8;#202020]",x,y),
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ end
|
|||||||
local function hasMetalBoots(player)
|
local function hasMetalBoots(player)
|
||||||
local inv
|
local inv
|
||||||
if industrialtest.mtgAvailable then
|
if industrialtest.mtgAvailable then
|
||||||
_,inv=armor:get_valid_player(player,"")
|
local _unused
|
||||||
|
_unused,inv=armor:get_valid_player(player,"")
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
inv=player:get_inventory()
|
inv=player:get_inventory()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -121,7 +121,87 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if industrialtest.mclAvailable then
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output=industrialtest.elementKeys.coal,
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","",""},
|
||||||
|
{"","","industrialtest:uu_matter"},
|
||||||
|
{"industrialtest:uu_matter","",""}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output=industrialtest.elementKeys.stoneWithIron,
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","","industrialtest:uu_matter"},
|
||||||
|
{"","industrialtest:uu_matter",""},
|
||||||
|
{"industrialtest:uu_matter","","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output=industrialtest.elementKeys.diamond,
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"},
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"},
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output=industrialtest.elementKeys.stickyResin.." 32",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","","industrialtest:uu_matter"},
|
||||||
|
{"","",""},
|
||||||
|
{"industrialtest:uu_matter","","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:tin_dust 4",
|
||||||
|
recipe={
|
||||||
|
{"","",""},
|
||||||
|
{"industrialtest:uu_matter","","industrialtest:uu_matter"},
|
||||||
|
{"","","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:copper_dust 4",
|
||||||
|
recipe={
|
||||||
|
{"","","industrialtest:uu_matter"},
|
||||||
|
{"industrialtest:uu_matter","","industrialtest:uu_matter"},
|
||||||
|
{"","",""}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if industrialtest.mtgAvailable then
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:iridium_lump",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"},
|
||||||
|
{"","industrialtest:uu_matter",""},
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
elseif industrialtest.mclAvailable then
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:raw_iridium",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"},
|
||||||
|
{"","industrialtest:uu_matter",""},
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
output="mcl_core:vine 24",
|
output="mcl_core:vine 24",
|
||||||
@@ -141,4 +221,34 @@ if industrialtest.mclAvailable then
|
|||||||
{"industrialtest:uu_matter",""}
|
{"industrialtest:uu_matter",""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output=industrialtest.elementKeys.powerCarrier.." 10",
|
||||||
|
recipe={
|
||||||
|
{"","",""},
|
||||||
|
{"","industrialtest:uu_matter",""},
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output=industrialtest.elementKeys.blueDye,
|
||||||
|
recipe={
|
||||||
|
{"","industrialtest:uu_matter",""},
|
||||||
|
{"","industrialtest:uu_matter",""},
|
||||||
|
{"","industrialtest:uu_matter","industrialtest:uu_matter"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="mcl_core:emerald 8",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"},
|
||||||
|
{"industrialtest:uu_matter","industrialtest:uu_matter","industrialtest:uu_matter"},
|
||||||
|
{"","industrialtest:uu_matter",""}
|
||||||
|
}
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user