Update motorbike mod to Git commit f918701...
...and patch to make ownable. Commit: https://github.com/Extex101/motorbike/tree/f918701
This commit is contained in:
parent
7121c63041
commit
b4b068c346
@ -133,7 +133,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||||||
* [helicopter][] ([GPL][lic.gpl2.0] / [CC0][lic.cc0] / CC BY-NC) -- version: [d3985b0 Git][ver.helicopter] *2021-04-27* ([patched][patch.helicopter])
|
* [helicopter][] ([GPL][lic.gpl2.0] / [CC0][lic.cc0] / CC BY-NC) -- version: [d3985b0 Git][ver.helicopter] *2021-04-27* ([patched][patch.helicopter])
|
||||||
* [hot_air_balloons][] ([LGPL][lic.lgpl2.1] / [CC BY-SA][lic.ccbysa3.0]) -- version: [39a3572 Git][ver.hot_air_balloons] *2020-11-17*
|
* [hot_air_balloons][] ([LGPL][lic.lgpl2.1] / [CC BY-SA][lic.ccbysa3.0]) -- version: [39a3572 Git][ver.hot_air_balloons] *2020-11-17*
|
||||||
* [hovercraft][] ([LGPL / CC BY-SA / CC0][lic.hovercraft]) -- version: [4d50e68 Git][ver.hovercraft] *2017-05-14* ([patched][patch.hovercraft])
|
* [hovercraft][] ([LGPL / CC BY-SA / CC0][lic.hovercraft]) -- version: [4d50e68 Git][ver.hovercraft] *2017-05-14* ([patched][patch.hovercraft])
|
||||||
* [motorbike][] ([MIT][lic.motorbike]) -- version: [9527d56 Git][ver.motorbike] *2021-04-01* ([patched][patch.motorbike])
|
* [motorbike][] ([MIT][lic.motorbike]) -- version: [f918701 Git][ver.motorbike] *2021-05-22* ([patched][patch.motorbike])
|
||||||
* ui/
|
* ui/
|
||||||
* [bookmarks_gui][] ([BSD 3-Clause][lic.bookmarks_gui]) -- version: [f7ae10a Git][ver.bookmarks_gui] *2017-08-29*
|
* [bookmarks_gui][] ([BSD 3-Clause][lic.bookmarks_gui]) -- version: [f7ae10a Git][ver.bookmarks_gui] *2017-08-29*
|
||||||
* [hbarmor][] ([MIT][lic.mit] / [CC BY-SA][lic.ccbysa3.0]) -- version: [1.0.0][ver.hbarmor] *2019-04-01*
|
* [hbarmor][] ([MIT][lic.mit] / [CC BY-SA][lic.ccbysa3.0]) -- version: [1.0.0][ver.hbarmor] *2019-04-01*
|
||||||
@ -586,7 +586,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||||||
[ver.moreblocks]: https://github.com/minetest-mods/moreblocks/tree/3b97ea5
|
[ver.moreblocks]: https://github.com/minetest-mods/moreblocks/tree/3b97ea5
|
||||||
[ver.moremesecons]: https://github.com/minetest-mods/MoreMesecons/tree/1dab017
|
[ver.moremesecons]: https://github.com/minetest-mods/MoreMesecons/tree/1dab017
|
||||||
[ver.moreores]: https://github.com/minetest-mods/moreores/tree/3fe0ba8
|
[ver.moreores]: https://github.com/minetest-mods/moreores/tree/3fe0ba8
|
||||||
[ver.motorbike]: https://github.com/Extex101/motorbike/tree/9527d56
|
[ver.motorbike]: https://github.com/Extex101/motorbike/tree/f918701
|
||||||
[ver.mthudclock]: https://gitlab.com/Rochambeau/mthudclock/tree/d86e745
|
[ver.mthudclock]: https://gitlab.com/Rochambeau/mthudclock/tree/d86e745
|
||||||
[ver.mydoors]: https://github.com/minetest-mods/mydoors/tree/eef3b5f
|
[ver.mydoors]: https://github.com/minetest-mods/mydoors/tree/eef3b5f
|
||||||
[ver.myfences]: https://github.com/DonBatman/myfences/tree/c6e529a
|
[ver.myfences]: https://github.com/DonBatman/myfences/tree/c6e529a
|
||||||
@ -661,7 +661,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||||||
[patch.minetest_game]: https://github.com/AntumMT/mtgame-minetest/tree/355a756
|
[patch.minetest_game]: https://github.com/AntumMT/mtgame-minetest/tree/355a756
|
||||||
[patch.moreblocks]: https://github.com/AntumMT/mod-moreblocks/tree/6dda839
|
[patch.moreblocks]: https://github.com/AntumMT/mod-moreblocks/tree/6dda839
|
||||||
[patch.moreores]: https://github.com/AntumMT/mod-moreores/tree/ae59578
|
[patch.moreores]: https://github.com/AntumMT/mod-moreores/tree/ae59578
|
||||||
[patch.motorbike]: https://github.com/AntumMT/mod-motorbike/tree/3bb0c6a
|
[patch.motorbike]: https://github.com/AntumMT/mod-motorbike/tree/fda6a40
|
||||||
[patch.mysheetmetal]: https://github.com/AntumMT/mod-mysheetmetal/tree/2ffb3a2
|
[patch.mysheetmetal]: https://github.com/AntumMT/mod-mysheetmetal/tree/2ffb3a2
|
||||||
[patch.nether]: https://github.com/AntumMT/mod-nether/tree/7a84ddd
|
[patch.nether]: https://github.com/AntumMT/mod-nether/tree/7a84ddd
|
||||||
[patch.pipeworks]: https://gitlab.com/AntumMT/mod-pipeworks/tree/48b082e
|
[patch.pipeworks]: https://gitlab.com/AntumMT/mod-pipeworks/tree/48b082e
|
||||||
|
4
mods/transport/motorbike/depends.txt
Normal file
4
mods/transport/motorbike/depends.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
player_api
|
||||||
|
default
|
||||||
|
wool
|
||||||
|
signs?
|
@ -19,7 +19,11 @@ local settings = {
|
|||||||
-- Ability to punch the motorbike to kick the rider
|
-- Ability to punch the motorbike to kick the rider
|
||||||
kick = true,
|
kick = true,
|
||||||
-- Enable custom plates, requires "signs" mod
|
-- Enable custom plates, requires "signs" mod
|
||||||
custom_plates = true
|
custom_plates = true,
|
||||||
|
-- Bike is be placed directly in inventory when punched
|
||||||
|
punch_inv = true,
|
||||||
|
-- "owner" attribute is set when bike is placed
|
||||||
|
ownable = minetest.settings:get_bool("mount_ownable", true),
|
||||||
}
|
}
|
||||||
for setting, default in pairs(settings) do
|
for setting, default in pairs(settings) do
|
||||||
local value = minetest.settings:get("motorbike." .. setting)
|
local value = minetest.settings:get("motorbike." .. setting)
|
||||||
@ -27,7 +31,6 @@ for setting, default in pairs(settings) do
|
|||||||
biker[setting] = value
|
biker[setting] = value
|
||||||
end
|
end
|
||||||
biker.path = minetest.get_modpath"motorbike"
|
biker.path = minetest.get_modpath"motorbike"
|
||||||
dofile(biker.path .. "/settings.lua")
|
|
||||||
dofile(biker.path .. "/functions.lua")
|
dofile(biker.path .. "/functions.lua")
|
||||||
local bikelist = {
|
local bikelist = {
|
||||||
"black",
|
"black",
|
||||||
@ -64,12 +67,16 @@ for _, colour in pairs(bikelist) do
|
|||||||
},
|
},
|
||||||
drop = "motorbike:" .. colour,
|
drop = "motorbike:" .. colour,
|
||||||
on_activate = function(self, staticdata)
|
on_activate = function(self, staticdata)
|
||||||
if staticdata and biker.signs then
|
if staticdata then
|
||||||
self.platenumber = staticdata
|
local sdata = minetest.deserialize(staticdata)
|
||||||
local pos = self.object:get_pos()
|
self.owner = sdata.owner
|
||||||
self.plate = minetest.add_entity(pos, "motorbike:licenseplate")
|
if biker.signs then
|
||||||
if self.plate then
|
self.platenumber = sdata.platenumber
|
||||||
self.plate:set_attach(self.object, "", { x = -0.2, y = -1.9, z = -12.12 }, { x = 0, y = 0, z = 0 })
|
local pos = self.object:get_pos()
|
||||||
|
self.plate = minetest.add_entity(pos, "motorbike:licenseplate")
|
||||||
|
if self.plate then
|
||||||
|
self.plate:set_attach(self.object, "", { x = -0.2, y = -1.9, z = -12.12 }, { x = 0, y = 0, z = 0 })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.timer1 = 0
|
self.timer1 = 0
|
||||||
@ -79,6 +86,11 @@ for _, colour in pairs(bikelist) do
|
|||||||
end,
|
end,
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
if not self.driver then
|
if not self.driver then
|
||||||
|
local pname = clicker:get_player_name()
|
||||||
|
if settings.ownable and self.owner and self.owner ~= pname then
|
||||||
|
minetest.chat_send_player(pname, "You cannot ride " .. self.owner .. "'s motorbike")
|
||||||
|
return
|
||||||
|
end
|
||||||
biker.attach(self, clicker, false)
|
biker.attach(self, clicker, false)
|
||||||
minetest.sound_play("motorbike_start", {
|
minetest.sound_play("motorbike_start", {
|
||||||
max_hear_distance = 24,
|
max_hear_distance = 24,
|
||||||
@ -96,8 +108,13 @@ for _, colour in pairs(bikelist) do
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not self.driver then
|
if not self.driver then
|
||||||
|
local pname = puncher:get_player_name()
|
||||||
|
if settings.ownable and self.owner and self.owner ~= pname then
|
||||||
|
minetest.chat_send_player(pname, "You cannot take " .. self.owner .. "'s motorbike")
|
||||||
|
return
|
||||||
|
end
|
||||||
if biker.breakable then
|
if biker.breakable then
|
||||||
if not biker.punch_inv then
|
if not settings.punch_inv then
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local item = minetest.add_item(pos, self.drop)
|
local item = minetest.add_item(pos, self.drop)
|
||||||
if item then
|
if item then
|
||||||
@ -108,7 +125,7 @@ for _, colour in pairs(bikelist) do
|
|||||||
local stack = ItemStack(self.drop)
|
local stack = ItemStack(self.drop)
|
||||||
local pinv = puncher:get_inventory()
|
local pinv = puncher:get_inventory()
|
||||||
if not pinv:room_for_item("main", stack) then
|
if not pinv:room_for_item("main", stack) then
|
||||||
core.chat_send_player(puncher:get_player_name(), "You do not have room in your inventory")
|
core.chat_send_player(pname, "You do not have room in your inventory")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pinv:add_item("main", stack)
|
pinv:add_item("main", stack)
|
||||||
@ -123,7 +140,13 @@ for _, colour in pairs(bikelist) do
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_step = biker.drive,
|
on_step = biker.drive,
|
||||||
get_staticdata = function(self) if biker.signs then return self.platenumber end end
|
get_staticdata = function(self)
|
||||||
|
local sdata = {
|
||||||
|
owner = self.owner,
|
||||||
|
platenumber = self.platenumber,
|
||||||
|
}
|
||||||
|
return minetest.serialize(sdata)
|
||||||
|
end
|
||||||
})
|
})
|
||||||
minetest.register_craftitem("motorbike:" .. colour, {
|
minetest.register_craftitem("motorbike:" .. colour, {
|
||||||
description = colour:gsub("^%l", string.upper):gsub("_", " ") .. " bike",
|
description = colour:gsub("^%l", string.upper):gsub("_", " ") .. " bike",
|
||||||
@ -131,7 +154,9 @@ for _, colour in pairs(bikelist) do
|
|||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then return end
|
if pointed_thing.type ~= "node" then return end
|
||||||
local pos = { x = pointed_thing.above.x, y = pointed_thing.above.y + 1, z = pointed_thing.above.z }
|
local pos = { x = pointed_thing.above.x, y = pointed_thing.above.y + 1, z = pointed_thing.above.z }
|
||||||
local bike = minetest.add_entity(pos, "motorbike:bike_" .. colour, biker.get_plate(placer:get_player_name()))
|
local pname = placer:get_player_name()
|
||||||
|
local sdata = {owner=pname, platenumber=biker.get_plate(pname)}
|
||||||
|
local bike = minetest.add_entity(pos, "motorbike:bike_" .. colour, minetest.serialize(sdata))
|
||||||
bike:set_yaw(placer:get_look_horizontal())
|
bike:set_yaw(placer:get_look_horizontal())
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name = motorbike
|
name = motorbike
|
||||||
description = Adds various coloured motorbikes to Minetest Game
|
description = Adds various coloured motorbikes to Minetest Game
|
||||||
depends = player_api, default, wool
|
depends = default, player_api, wool
|
||||||
optional_depends = signs
|
optional_depends = signs
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
-- If enabled, bike is be placed in inventory when punched.
|
|
||||||
biker.punch_inv = core.settings:get_bool("motorbike.punch_inv", false)
|
|
@ -1,3 +1,36 @@
|
|||||||
|
|
||||||
|
# Turning speed of bike, 1 is instant.
|
||||||
|
motorbike.turn_power (Turning speed) float 0.07
|
||||||
|
|
||||||
|
# Top speed the bike can go.
|
||||||
|
motorbike.max_speed (Top speed) float 17
|
||||||
|
|
||||||
|
# Top speed in reverse.
|
||||||
|
motorbike.max_reverse (Top speed reverse) float 5
|
||||||
|
|
||||||
|
# Acceleration.
|
||||||
|
motorbike.acceleration (Acceleration) float 1.5
|
||||||
|
|
||||||
|
# Braking power.
|
||||||
|
motorbike.braking (Braking power) float 5
|
||||||
|
|
||||||
|
# Step height.
|
||||||
|
motorbike.stepheight (Step height) float 1.3
|
||||||
|
|
||||||
|
# Whether the bike is breakable.
|
||||||
|
motorbike.breakable (Breakable) bool true
|
||||||
|
|
||||||
|
# Same as max_speed but on nodes like dirt, sand, gravel ect.
|
||||||
|
motorbike.crumbly_spd (Top speed crumbly) float 11
|
||||||
|
|
||||||
|
# Ability to punch the motorbike to kick the rider.
|
||||||
|
motorbike.kick (Punch kicks rider) bool true
|
||||||
|
|
||||||
|
# Enable custom plates, requires "signs" mod.
|
||||||
|
motorbike.custom_plates (Custom plates) bool true
|
||||||
|
|
||||||
# If enabled, bike is placed in inventory when punched.
|
# If enabled, bike is placed in inventory when punched.
|
||||||
motorbike.punch_inv (Punch places in inventory) bool false
|
motorbike.punch_inv (Punch places in inventory) bool true
|
||||||
|
|
||||||
|
# Mounted entities can only be used by owners.
|
||||||
|
mount_ownable (Ownable mounts) bool true
|
||||||
|
@ -44,6 +44,9 @@ enable_mob_nametags (Enable mob nametags) bool false
|
|||||||
# player is looking.
|
# player is looking.
|
||||||
mount_turn_player_look (Turn with look direction) bool false
|
mount_turn_player_look (Turn with look direction) bool false
|
||||||
|
|
||||||
|
# Mounted entities can only be used by owners.
|
||||||
|
mount_ownable (Ownable mounts) bool true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user