Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
unused_args = false
allow_defined_top = true

globals = {
"minetest","wings","jetpack","flyingcarpet"
}

read_globals = {
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},

-- Builtin
"vector", "ItemStack",
"dump", "DIR_DELIM", "VoxelArea", "Settings",

-- MTG
"default", "sfinv", "creative",

-- Playereffects and mana
"playereffects","mana",

-- Mineclone
"mcl_loot", "tga_encoder", "mcl_util", "flowlib", "mcl_sounds", "mcl_autogroup",
"mcl_events", "biomeinfo", "mcl_damage", "mcl_particles", "mcl_worlds", "mcl_colors",
"mcl_explosions", "mcl_vars", "controls", "walkover", "mcl_meshhand", "mcl_fovapi",
"playerphysics", "mcl_hunger", "mcl_death_drop", "mcl_player", "mcl_playerplus",
"mcl_gamemode", "mcl_spawn", "mcl_skins", "mcl_sprint", "mcl_playerinfo",
"mcl_item_id", "tt", "mcl_craftguide", "doc", "mcl_dripping",
"mcl_entity_invs", "mcl_item_entity", "mcl_burning",
"mcl_minecarts", "pillager", "mobs_mc", "sounds",
"textures", "mcl_mobs", "mcl_paintings",
"mcl_grindstone", "mcl_walls", "mcl_bamboo",
"mcl_maps", "mcl_clock", "mcl_end", "mcl_starting_inventory",
"mcl_bows", "mcl_bows_s", "mcl_dye", "mcl_copper",
"mcl_flowerpots", "mcl_furnaces", "mcl_farming",
"mcl_campfires", "mcl_crafting_table", "mcl_doors",
"mcl_jukebox", "screwdriver", "mcl_itemframes",
"mcl_heads", "mcl_beacons", "xpanes", "mcl_enchanting",
"mcl_beds", "mcl_throwing", "mcl_banners", "mcl_mobspawners",
"mcl_cocoas", "mcl_smithing_table", "mcl_flowers",
"mcl_core", "mcl_torches", "mcl_target", "mesecon", "mcl_observers",
"mcl_sculk", "mcl_armor", "mcl_lanterns", "mcl_stairs", "mcl_bells",
"mcl_hamburger", "mcl_signs", "mcl_honey", "mcl_stonecutter", "mcl_fire",
"mcl_compass", "mcl_ocean", "mcl_fences", "mcl_buckets", "mcl_potions",
"tnt", "mcl_cherry_blossom", "mcl_portals", "mcl_chests", "mcl_shields",
"mcl_wip", "mcl_raids", "mcl_moon", "lightning", "mcl_weather",
"mcl_formspec", "mcl_death_messages", "mcl_bossbars", "awards",
"mcl_inventory", "mcl_title", "mcl_offhand", "hb", "mcl_experience",
"mcl_info", "mcl_credits", "tsm_railcorridors", "mcl_mapgen_core",
"mcl_structures", "settlements", "mcl_dungeons", "mcl_colors_official"
}
4 changes: 4 additions & 0 deletions Readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ Two of these mods have a dependency on [Wuzzy's playereffects mod](https://forum
All of the mods can be configured extensively through the config.lua file found in each mod.

Look at the readme's of the mods for more info.

### License

Code and images are licensed under the MIT license.
File renamed without changes.
7 changes: 0 additions & 7 deletions flyingcarpet/config.lua

This file was deleted.

2 changes: 1 addition & 1 deletion flyingcarpet/depends.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
default
default?
25 changes: 18 additions & 7 deletions flyingcarpet/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dofile(minetest.get_modpath("flyingcarpet") .. "/config.lua")
flyingcarpet = {}
local player_properties = minetest.get_modpath("mcl_player") and mcl_player or default

local function get_sign(i)
if i == 0 then
Expand Down Expand Up @@ -30,17 +31,17 @@ function carpet:on_rightclick(clicker)
if self.driver and clicker == self.driver then
clicker:set_detach()
self.driver = nil
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 10)
if flyingcarpet.one_use == true then
player_properties.player_attached[name] = false
player_properties.player_set_animation(clicker, "stand" , 10)
if minetest.settings:get_bool("flyingcarpet.one_use", false) == true then
self.object:remove()
end
elseif not self.driver then
self.driver = clicker
clicker:set_attach(self.object, "", {x=-4,y=10.1,z=0}, {x=0,y=90,z=0})
default.player_attached[name] = true
player_properties.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 10)
player_properties.player_set_animation(clicker, "sit" , 10)
end)
self.object:setyaw(clicker:get_look_yaw()-math.pi/2)
end
Expand Down Expand Up @@ -156,12 +157,22 @@ minetest.register_craftitem("flyingcarpet:carpet", {
end,
})

if flyingcarpet.crafts == true then
if minetest.settings:get_bool("flyingcarpet.crafts",true) == true then
if minetest.get_modpath("default") ~= nil then
minetest.register_craft({
output = "flyingcarpet:carpet",
recipe = {
{"group:wool", "group:wool", "group:wool"},
{"default:mese", "default:goldblock", "default:mese"},
},
})
elseif minetest.get_modpath("mcl_core") ~= nil then
minetest.register_craft({
output = "flyingcarpet:carpet",
recipe = {
{"group:wool", "group:wool", "group:wool"},
{"mesecons:redstone", "mcl_core:goldblock", "mesecons:redstone"},
},
})
end
end
3 changes: 3 additions & 0 deletions flyingcarpet/mod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title = Flying Carpet
name = flyingcarpet
optional_depends = default, mcl_core, mesecons
5 changes: 5 additions & 0 deletions flyingcarpet/settingtypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# If you want carpets to be available only through /giveme or at admin shops, set this to false.
flyingcarpet.crafts (Crafts available) bool true

# If you want flying carpets to be only one use, set this to true.
flyingcarpet.one_use (One-use flying carpets) bool false
File renamed without changes.
58 changes: 47 additions & 11 deletions jetpack/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
dofile(minetest.get_modpath("jetpack") .. "/config.lua")
if jetpack.fast == true then
local jetpack_fast = minetest.settings:get_bool("jetpack.fast", false)
local jetpack_crafts = minetest.settings:get_bool("jetpack.crafts", true)
local jetpack_time = tonumber(minetest.settings:get("jetpack.time")) or 7
local jetpack_time_bronze = tonumber(minetest.settings:get("jetpack.time_bronze")) or 15
local jetpack_time_gold = tonumber(minetest.settings:get("jetpack.time_gold")) or 30

if jetpack_fast == true then
playereffects.register_effect_type("flyj", "Fly mode available", "jetpack.png", {"fly"},
function(player)
local playername = player:get_player_name()
Expand Down Expand Up @@ -43,7 +48,7 @@ minetest.register_craftitem("jetpack:jetpack", {
if privs.fly == true then
minetest.chat_send_player(playername, "You already have the fly priv, and so have no need of this jetpack!")
else
playereffects.apply_effect_type("flyj", jetpack.time, user)
playereffects.apply_effect_type("flyj", jetpack_time, user)
itemstack:take_item()
return itemstack
end
Expand All @@ -60,7 +65,7 @@ minetest.register_craftitem("jetpack:jetpack_bronze", {
if privs.fly == true then
minetest.chat_send_player(playername, "You already have the fly priv, and so have no need of this jetpack!")
else
playereffects.apply_effect_type("flyj", jetpack.time_bronze, user)
playereffects.apply_effect_type("flyj", jetpack_time_bronze, user)
itemstack:take_item()
return itemstack
end
Expand All @@ -77,18 +82,20 @@ minetest.register_craftitem("jetpack:jetpack_gold", {
if privs.fly == true then
minetest.chat_send_player(playername, "You already have the fly priv, and so have no need of this jetpack!")
else
playereffects.apply_effect_type("flyj", jetpack.time_gold, user)
playereffects.apply_effect_type("flyj", jetpack_time_gold, user)
itemstack:take_item()
return itemstack
end
end,
})

if jetpack.crafts == true and minetest.get_modpath("default") ~= nil then
minetest.register_craftitem("jetpack:jetpack_base", {
description = "Jetpack Tubes",
inventory_image = "jetpack_base.png",
})
minetest.register_craftitem("jetpack:jetpack_base", {
description = "Jetpack Tubes",
inventory_image = "jetpack_base.png",
})

if jetpack_crafts == true then
if minetest.get_modpath("default") then
minetest.register_craft({
output = "jetpack:jetpack_base",
recipe = {
Expand Down Expand Up @@ -121,10 +128,39 @@ if jetpack.crafts == true and minetest.get_modpath("default") ~= nil then
{"default:diamond", "default:mese_crystal", "default:diamond"},
},
})
end
if minetest.get_modpath("mcl_core") then
minetest.register_craft({
output = "jetpack:jetpack_base",
recipe = {
{"mcl_core:ironblock", "mcl_minecarts:chest_minecart", "mcl_core:ironblock"},
{"mcl_core:gold_ingot", "mcl_core:diamondblock", "mcl_core:gold_ingot"},
{"mcl_core:lapisblock", "mcl_core:emeraldblock", "mcl_core:lapisblock"},
},
})

minetest.register_craft({
output = "jetpack:jetpack",
recipe = {
{"mcl_core:gold_nugget", "jetpack:jetpack_base", "mcl_core:gold_nugget"},
{"mcl_core:goldblock", "mcl_end:end_rod_green", "mcl_core:goldblock"},
{"mcl_core:diamond", "mcl_potions:swiftness", "mcl_core:diamond"},
},
})

minetest.register_craft({
output = "jetpack:jetpack_gold",
recipe = {
{"mcl_core:diamondblock", "jetpack:jetpack_base", "mcl_core:diamondblock"},
{"mcl_core:emeraldblock", "mcl_core:goldblock", "mcl_core:emeraldblock"},
{"mcl_core:diamond", "mesecons:redstone", "mcl_core:diamond"},
},
})
end
end

--Not sure if this is a hack, but it stops unkown items appearing if jetpack.crafts is set to false, while removing them from the creative inventory.
if jetpack.crafts == false then
if jetpack_crafts == false then
minetest.register_craftitem("jetpack:jetpack_base", {
description = "Jetpack Tubes",
inventory_image = "jetpack_base.png",
Expand Down
4 changes: 4 additions & 0 deletions jetpack/mod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title = Jetpack
name = jetpack
depends = playereffects
optional_depends = default, mcl_core, mesecons
15 changes: 15 additions & 0 deletions jetpack/settingtypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This grants and revokes the fast priv along with fly when it is set to true.
# If you grant the fast priv on your server, do *not* enable it.
# As when the effect wears off, the fast priv of the player will go as well.
jetpack.fast (Grant fast privilege with jetpack) bool false

# Times for each of the jetpack types.
# I advise increasing them if fast is not a default priv and jetpack.fast = false.
# They are at the current times because any longer allows large distances to be covered with fast.
# Even with this, the gold jetpack allows players with fast to cover almost 300 nodes.
jetpack.time (Standard jetpack time) int 7
jetpack.time_bronze (Bronze jetpack time) int 15
jetpack.time_gold (Gold jetpack time) int 30

# If you want jetpack to be available only through /giveme or at admin shops, set this to false.
jetpack.crafts (Enable crafting of jetpacks) bool true
File renamed without changes.
Loading