Skip to content

Commit

Permalink
Various license/code improvements and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Panquesito7 committed Jan 16, 2024
1 parent e00fb0e commit a2aedab
Show file tree
Hide file tree
Showing 8 changed files with 634 additions and 544 deletions.
15 changes: 15 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Authors

## Source code

[David Leal](https://github.com/Panquesito7) and contributors ([GNU LGPLv2.1+](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)).

## Media

[David Leal](https://github.com/Panquesito7) ([CC BY-SA 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/)).\
Various Minetest contributors/modders ([CC BY-SA 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/) and others):

- `screenshot.png`.
- The character model was taken from [`character.blend`](https://github.com/minetest/minetest_game/blob/master/mods/player_api/models/character.blend) and the texture from [`character.png`](https://github.com/minetest/minetest_game/blob/master/mods/player_api/models/character.png) ([CC BY-SA 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/)). The authors can be found [here](https://github.com/minetest/minetest_game/blob/master/mods/player_api/README.txt#L16-L23). A slight white background and effect were added by me ([Panquesito7](https://github.com/Panquesito7)) to the asset falling under the [same license](https://creativecommons.org/licenses/by-sa/3.0/).
- The texts and the arrows were created by me ([Panquesito7](https://github.com/Panquesito7)), and are licensed under [CC BY-SA 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/).
- All the other assets/artwork were taken from [Minetest Game](https://github.com/minetest/minetest_game) and the [More Blocks](https://github.com/minetest-mods/moreblocks) mod via taking a screenshot in-game with the [Minetest](https://github.com/minetest/minetest) software, and belong to their respective copyright holders falling under their respective licenses.
502 changes: 502 additions & 0 deletions COPYING.LESSER

Large diffs are not rendered by default.

515 changes: 0 additions & 515 deletions LICENSE.md

This file was deleted.

101 changes: 101 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
License of source code
----------------------

GNU Lesser General Public License, version 2.1
Copyright (C) 2023-2024 David Leal (halfpacho@gmail.com) and contributors

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Licenses of media
-----------------

Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Copyright (C) 2023-2024 David Leal (halfpacho@gmail.com)

You are free to:

Share — copy and redistribute the material in any medium or format for any
purpose, even commercially.
Adapt — remix, transform, and build upon the material for any purpose, even
commercially.

The licensor cannot revoke these freedoms as long as you follow the license
terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license,
and indicate if changes were made. You may do so in any reasonable manner,
but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must
distribute your contributions under the same license as the original.

No additional restrictions — You may not apply legal terms or technological
measures that legally restrict others from doing anything the license permits.

Notices:

You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for
your intended use. For example, other rights such as publicity, privacy, or moral rights
may limit how you use the material.

For more details:
https://creativecommons.org/licenses/by-sa/4.0/

-----------------------

Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) Various Minetest contributors/modders

You are free to:

Share — copy and redistribute the material in any medium or format for any
purpose, even commercially.
Adapt — remix, transform, and build upon the material for any purpose, even
commercially.

The licensor cannot revoke these freedoms as long as you follow the license
terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license,
and indicate if changes were made. You may do so in any reasonable manner,
but not in any way that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must
distribute your contributions under the same license as the original.

No additional restrictions — You may not apply legal terms or technological
measures that legally restrict others from doing anything the license permits.

Notices:

You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for
your intended use. For example, other rights such as publicity, privacy, or moral rights
may limit how you use the material.

For more details:
https://creativecommons.org/licenses/by-sa/3.0/

Authors
-------

See `AUTHORS.md`
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@
[![luacheck](https://github.com/Panquesito7/minetest-precise_jump/actions/workflows/luacheck.yml/badge.svg)](https://github.com/Panquesito7/minetest-precise_jump/actions/)
[![ContentDB](https://content.minetest.net/packages/Panquesito7/precise_jump/shields/downloads/)](https://content.minetest.net/packages/Panquesito7/precise_jump/)

Calculates jump time and reduces the speed of the player for a more realistic feeling.\
Calculates jump time and reduces the jump height of the player for a more realistic feeling.\
This is something that's being used in a lot of **platformer** games. Very useful in:

- Advanced parkours that do not require the full jump.
- Advanced parkours.
- The full jump isn't required in various cases.
- Very specific cases, such as PvE and PvP.

![Screenshot](https://raw.githubusercontent.com/Panquesito7/minetest-precise_jump/main/screenshot.png)
![Screenshot](https://content.minetest.net/uploads/9c0c932591.png)

Here's a video showcasing the mod in action.

[![Precise Jump showcase](https://markdown-videos-api.jorgenkh.no/url?url=https%3A%2F%2Fyoutu.be%2FTB1LNyI5Fzw)](https://youtu.be/TB1LNyI5Fzw)

## Settings

These settings can be customized by modifying [`minetest.conf`](https://wiki.minetest.net/Minetest.conf) or directly in the Minetest settings.

- `precise_jump.privilege_required`: Whether a privilege is required or not to perform precise jumps (`false` by default).

## To-do

- Make it a more smooth feeling when jumping.
- Probably adjust the velocity values.
- Make it a smoother feeling when jumping.
- Adjust the velocity values.
- Make sure the mod doesn't conflict with the Double Jump, Wall Jump, and other physics mods.

## Installation

Expand All @@ -43,4 +38,4 @@ For further information or help, see:\

## License

See [`LICENSE.md`](LICENSE.md) for full details.
See [`LICENSE.txt`](LICENSE.txt) for full license information and [`AUTHORS.md`](AUTHORS.md) for all the contributors.
25 changes: 9 additions & 16 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
Removes player speed depending on the jump time for a more realistic feeling. Built for Minetest.
Copyright (C) 2023 David Leal (halfpacho@gmail.com)
Calculates jump time and reduces the jump height of the player for a more realistic feeling. Built for Minetest.
Copyright (C) 2023-2024 David Leal (halfpacho@gmail.com) and contributors
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -17,17 +17,14 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--]]

local jump_time, is_holding = { }, { }
local privilege_required = minetest.settings:get_bool("precise_jump.privilege_required") or false

local S = minetest.get_translator(minetest.get_current_modname())
local jump_time, is_holding = { }, { }

if privilege_required then
minetest.register_privilege({"precise_jump"}, {
description = S("Allows the player to perform precise jumps."),
give_to_admin = true
})
end
minetest.register_privilege("precise_jump", {
description = S("Allows the player to perform precise jumps."),
give_to_singleplayer = false,
give_to_admin = false
})

-- Table containing a list of velocities depending on the jump time.
-- Modifying these values might cause unwanted side effects.
Expand Down Expand Up @@ -77,11 +74,7 @@ end

minetest.register_globalstep(function(dtime)
for _, player in ipairs(minetest.get_connected_players()) do
if privilege_required then
if minetest.check_player_privs(player, {precise_jump = true}) then
calculate_time(player)
end
else
if minetest.check_player_privs(player, { precise_jump = true }) then
calculate_time(player)
end
end
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion settingtypes.txt

This file was deleted.

0 comments on commit a2aedab

Please sign in to comment.