Compare commits

...

3 Commits

Author SHA1 Message Date
Starbeamrainbowlabs 31c2574ad4
README: Add mod compat list 2023-12-30 13:33:06 +00:00
Starbeamrainbowlabs c6e047baef
README: Add @nosowow's project 2023-12-30 13:25:36 +00:00
Starbeamrainbowlabs 2f98b86c5f
movetool, //speed: add optdepend on pova
pova is a physics_override manager mod, so it's important we have support for it to ensure we play nice with other mods
Ref https://content.minetest.net/packages/TenPlus1/pova/
2023-12-30 13:12:10 +00:00
5 changed files with 106 additions and 20 deletions

View File

@ -149,6 +149,21 @@ git checkout TAG_NAME_HERE
```
## Integrations
WorldEditAdditions tries to be compatible with as many other mods and games as possible. If things aren't working as expected with your mod/game, please do [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) and let us know.
Currently, we have explicit compatibility code added to support the following mods:
- [`bonemeal`](https://content.minetest.net/packages/TenPlus1/bonemeal/): For `//forest`, `//bonemeal`, and other commands that use bonemeal to grow things.
- [`pova`](https://content.minetest.net/packages/TenPlus1/pova/) for adjusting player movement speed.
All compatibility code is optional: you don't *have* to have any of these mods installed in order to use WorldEditAdditions.
The following mods have known issues:
- [`moretrees`](https://content.minetest.net/packages/mt-mods/moretrees/): Saplings are incompatible with bonemeal. See [this FAQ](https://github.com/sbrl/Minetest-WorldEditAdditions/#why-dont-the-moretrees-trees-work-with-forest).
## Troubleshooting
If you're experiencing issues with this mod, try checking this FAQ before opening an issue.
@ -172,7 +187,9 @@ The only side effect of this is that WorldEdit commands such as `//shift` are no
### The position markers disappear when far way
This is a limitation of Minetest. You can workaround it though by setting [`active_block_range`](https://github.com/minetest/minetest/blob/5.6.1/minetest.conf.example#L2868) to a higher value - though be aware this also affects ABMs and other entities as well, so it can cause server lag.
The new positioning system now partially rectifies this issue with the region marker walls by creating a grid of entities instead of a single entity, such that a portion of them are more likely to be in range.
The new positioning system now rectifies this issue with the region marker walls by creating a grid of entities instead of a single entity, such that a portion of them are more likely to be in range.
If this is not showing for you, please update WorldEditAdditions and try again.
## Contributing
@ -181,13 +198,14 @@ Contributions are welcome! Please state in your pull request(s) that you release
Please also make sure that the logic for every new command has it's own file. For example, the logic for `//floodfill` goes in `worldeditadditions/floodfill.lua`, the logic for `//overlay` goes in `worldeditadditions/overlay.lua`, etc. More contributing help can be found in [the contributing guide](CONTRIBUTING.md).
### Inspiration
Want to contribute, but finding it tough to search for inspiration of what to implement? Here are some great places to look:
Want to contribute, but finding it tough to find inspiration of what to implement? Here are some great places to look:
- [**Our issue tracker:**](https://github.com/sbrl/Minetest-WorldEditAdditions/issues) There are always a bunch of issues open with cool commands and features that have yet to be implemented.
- **Other software:** Software for Minecraft is often far more mature than that available for Minetest. As a result, it's full of cool ideas. A lot of the existing commands in WorldEditAdditions were sourced from here.
- WorldEdit for Minecraft
- VoxelSniper(-Reimagined) for Minecraft
- WorldPainter for Minecraft
- Axiom
- **Do some building:** When you put WorldEditAdditions to use in building projects of your own, things will absolutely stand out to you what you want in the creative building process that WorldEditAdditions doesn't yet have.
- **Watch others build stuff:** Doesn't even have to be Minetest! There are lots of talented Minecraft builders with videos and series on e.g. YouTube. From their creative building processes, many ideas can be derived.
@ -197,7 +215,9 @@ The ultimate goal is for WorldEditAdditions to support the creative building pro
## WorldEditAdditions around the web
Are you using WorldEditAdditions for a project? Open an issue and I'll add your project to the below list!
- _(None that I'm aware of yet! Open an issue or get in touch and I'll link to your project (-:)_
- [@notsowow has built a magical mountain castle](https://worldeditadditions.mooncarrot.space/img/gallery-notsowow_100pcent.jpeg)
- _(No others that I'm aware of yet! Open an issue or get in touch and I'll link to your project (-:)_
## License
This mod is licensed under the _Mozilla Public License 2.0_, a copy of which (along with a helpful summary as to what you can and can't do with it) can be found in the `LICENSE` file in this repository.

View File

@ -49,23 +49,36 @@ worldeditadditions_core.register_command("speed", {
local player = minetest.get_player_by_name(name)
if mode == "absolute" then
player:set_physics_override({
speed = speed,
climb_speed = speed
})
weac.player_set_physics_override(player,
"worldeditadditions_movetool", {
speed = speed,
climb_speed = speed
}
)
-- player:set_physics_override({
-- })
elseif mode == "relative" then
local overrides = player:get_physics_override()
local overrides = weac.player_get_physics_override(
player, "worldeditadditions_movetool"
)
local src_speed = overrides.speed or 1
local src_climb_speed = overrides.climb_speed or 1
player:set_physics_override({
speed = src_speed + speed,
climb_speed = src_climb_speed + speed
})
weac.player_set_physics_override(player,
"worldeditadditions_movetool", {
speed = src_speed + speed,
climb_speed = src_climb_speed + speed
}
)
-- player:set_physics_override({
-- })
else
return false, "Error: Unknown adjustment mode '"..tostring(mode).."'. This is a bug."
end
local overrides_after = player:get_physics_override()
local overrides_after = weac.player_get_physics_override(
player, "worldeditadditions_movetool"
)
-- local overrides_after = player:get_physics_override()
local time_taken = weac.get_ms_time() - start_time

View File

@ -1,3 +1,3 @@
name = worldeditadditions_core
description = worldeditadditions: core components
optional_depends = worldedit, worldedit_commands, worldedit_shortcommands
optional_depends = worldedit, worldedit_commands, worldedit_shortcommands, pova

View File

@ -37,6 +37,47 @@ end
-- /lua print(Vector3.clone(minetest.get_player_by_name(myname):get_look_dir()))
function wea_c.player_get_physics_override(player, purpose_str)
if type(player) == "string" then
player = minetest.get_player_by_name(player)
end
if minetest.global_exists("pova") then
return pova.get_override(player:get_player_name(), purpose_str)
else
return minetest.get_physics_override(player:get_player_name())
end
end
function wea_c.player_set_physics_override(player, purpose_str, overrides)
if type(player) == "string" then
player = minetest.get_player_by_name(player)
end
local player_name = player:get_player_name()
if minetest.global_exists("pova") then
local overrides_old = wea_c.player_get_physics_override(player, purpose_str)
local do_set = false
if overrides_old == nil then
overrides_old = {}
do_set = true
end
for key, value in pairs(overrides) do
overrides_old[key] = value
end
-- Only set if this is the first time adding an override with this purpose_str for this player. On subsequent alterations, we update the existing overrides table
if do_set then
pova.add_override(player:get_player_name(), purpose_str, overrides_old)
end
pova.do_override(player)
else
minetest.set_physics_override(player_name, overrides)
end
end
--- DEPRECATED =================================================================
-- TODO: Refactor commands that use the following functions to use player_dir then delete these functions

View File

@ -1,16 +1,28 @@
local weac = worldeditadditions_core
local function adjust_speed_relative(player, offset)
local overrides = player:get_physics_override()
local overrides = weac.player_get_physics_override(
player, "worldeditadditions_movetool"
)
if overrides == nil then overrides = {} end
-- local overrides = player:get_physics_override()
local src_speed = overrides.speed or 1
local src_climb_speed = overrides.climb_speed or 1
player:set_physics_override({
speed = math.max(src_speed + offset, 0.5),
climb_speed = math.max(src_climb_speed + offset, 0.5)
})
weac.player_set_physics_override(
player, "worldeditadditions_movetool", {
speed = math.max(src_speed + offset, 0.5),
climb_speed = math.max(src_climb_speed + offset, 0.5)
}
)
-- player:set_physics_override({
-- })
-- Completely paranoid is me
local overrides_after = player:get_physics_override()
local overrides_after = weac.player_get_physics_override(
player, "worldeditadditions_movetool"
)
worldedit.player_notify(player:get_player_name(), "Movement speed is now x" .. tostring(overrides_after.speed))
end