forked from mrkubax10/industrialtest
Compare commits
3 Commits
089550cc28
...
fix-jetpac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ca1604b52 | ||
|
|
a4ba22b9ef | ||
|
|
9df0d6cee5 |
30
nodes.lua
30
nodes.lua
@@ -354,19 +354,6 @@ if not industrialtest.mods.mclRubber then
|
|||||||
name=="mcl_core:podzol" or name=="mcl_core:podzol_snow" or
|
name=="mcl_core:podzol" or name=="mcl_core:podzol_snow" or
|
||||||
name=="mcl_core:dirt" or name=="mcl_core:mycelium" or name=="mcl_core:coarse_dirt"
|
name=="mcl_core:dirt" or name=="mcl_core:mycelium" or name=="mcl_core:coarse_dirt"
|
||||||
end)
|
end)
|
||||||
definition._on_bone_meal=function(itemstack,user,pointed)
|
|
||||||
if industrialtest.random:next(1,100)>45 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local meta=minetest.get_meta(pointed.under)
|
|
||||||
local stage=meta:get_int("stage") or 0
|
|
||||||
stage=stage+1
|
|
||||||
if stage>=3 then
|
|
||||||
industrialtest.internal.makeRubberTree(pointed.under)
|
|
||||||
else
|
|
||||||
meta:set_int("stage",stage)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label="Rubber sapling growing",
|
label="Rubber sapling growing",
|
||||||
nodenames={"industrialtest:rubber_sapling"},
|
nodenames={"industrialtest:rubber_sapling"},
|
||||||
@@ -392,6 +379,23 @@ if not industrialtest.mods.mclRubber then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
mcl_dye.register_on_bone_meal_apply(function(pointed)
|
||||||
|
local node=minetest.get_node(pointed.under)
|
||||||
|
if node.name~="industrialtest:rubber_sapling" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if industrialtest.random:next(1,100)>45 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local meta=minetest.get_meta(pointed.under)
|
||||||
|
local stage=meta:get_int("stage") or 0
|
||||||
|
stage=stage+1
|
||||||
|
if stage>=3 then
|
||||||
|
industrialtest.internal.makeRubberTree(pointed.under)
|
||||||
|
else
|
||||||
|
meta:set_int("stage",stage)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
definition.groups.attached_node=1
|
definition.groups.attached_node=1
|
||||||
definition.groups.dig_immediate=3
|
definition.groups.dig_immediate=3
|
||||||
|
|||||||
@@ -20,12 +20,18 @@ industrialtest.internal.unpackTableInto(industrialtest.JetpackBase,{
|
|||||||
part="torso"
|
part="torso"
|
||||||
})
|
})
|
||||||
local soundHandles = {}
|
local soundHandles = {}
|
||||||
|
local reverseGravityForce = 1
|
||||||
|
local movementGravity = tonumber(minetest.settings:get("movement_gravity"))
|
||||||
|
|
||||||
|
|
||||||
function industrialtest.JetpackBase.update(self, player, inv, itemstack, dtime)
|
function industrialtest.JetpackBase.update(self, player, inv, itemstack, dtime)
|
||||||
local playerName = player:get_player_name()
|
local playerName = player:get_player_name()
|
||||||
local control = player:get_player_control()
|
local control = player:get_player_control()
|
||||||
if control.jump and self:tryFly(itemstack) then
|
if control.jump and self:tryFly(itemstack) then
|
||||||
self.addYVelocityClamped(player,1,10)
|
if movementGravity and movementGravity > 10 then
|
||||||
|
reverseGravityForce = 2
|
||||||
|
end
|
||||||
|
self.addYVelocityClamped(player,reverseGravityForce,10)
|
||||||
if not soundHandles[playerName] then
|
if not soundHandles[playerName] then
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
local handle = minetest.sound_play("industrialtest_jetpack_loop", {
|
local handle = minetest.sound_play("industrialtest_jetpack_loop", {
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ local S=minetest.get_translator("industrialtest")
|
|||||||
industrialtest.Treetap=table.copy(industrialtest.Tool)
|
industrialtest.Treetap=table.copy(industrialtest.Tool)
|
||||||
industrialtest.internal.unpackTableInto(industrialtest.Treetap,{
|
industrialtest.internal.unpackTableInto(industrialtest.Treetap,{
|
||||||
name="industrialtest:treetap",
|
name="industrialtest:treetap",
|
||||||
define={onPlace=true},
|
|
||||||
description=S("Treetap"),
|
description=S("Treetap"),
|
||||||
inventoryImage="industrialtest_treetap.png",
|
inventoryImage="industrialtest_treetap.png",
|
||||||
uses=50,
|
uses=50,
|
||||||
@@ -65,7 +64,6 @@ minetest.register_craft({
|
|||||||
industrialtest.ElectricTreetap=table.copy(industrialtest.ElectricTool)
|
industrialtest.ElectricTreetap=table.copy(industrialtest.ElectricTool)
|
||||||
industrialtest.internal.unpackTableInto(industrialtest.ElectricTreetap,{
|
industrialtest.internal.unpackTableInto(industrialtest.ElectricTreetap,{
|
||||||
name="industrialtest:electric_treetap",
|
name="industrialtest:electric_treetap",
|
||||||
define={onPlace=true},
|
|
||||||
description=S("Electric Treetap"),
|
description=S("Electric Treetap"),
|
||||||
inventoryImage="industrialtest_electric_treetap.png",
|
inventoryImage="industrialtest_electric_treetap.png",
|
||||||
capacity=10000,
|
capacity=10000,
|
||||||
|
|||||||
Reference in New Issue
Block a user