FTBTeam / FTB-Mods-Issues

Any mod issues, be it FTB Teams, Quests or any other of our mods can be reported here!
20 stars 1 forks source link

[Bug]: FTB Chunks add some default configuration #303

Open flamehaze1427 opened 2 years ago

flamehaze1427 commented 2 years ago

Mod

Ftb teams /ftb chunks

Mod version

1605

Forge / Fabric version

1.65.5

Modpack & version

No response

What issue are you having?

Can't change the default permissions for land claims. Example:: set block interaction to public but keep block edit to private. Also not able to stop players from changing their land claims back to private. Didn't see anything in config to change one permission but not the other.

Crashlogs

No response

Steps to reproduce

Change default setting to public, everyone can still change land claim back to any other setting

Anything else to note?

No response

Raidobw2 commented 2 years ago

Hi, sorry for the delay, I check this tracker less often.

What exactly are you trying to achieve? There are ways to allow interactions without changing the global behavior for all players.

The easiest solution for most server owners is to use a "server team". A server team can claim a common "shop" or "community" area and set the interactions for the people there.

First you want to create a server team. Here I've called it "Maintenance". /ftbteams server create Maintenance Then you want to set the block interaction mode to public, like so. Note that "#45ce0d48" is the id my server team got, yours might be different. Use command suggestions to have it complete for you (start typing the name it will show up). /ftbteams server settings Maintenance#45ce0d48 ftbchunks:block_interact_mode public Then I can stand in the middle of spawn and do this: /ftbchunks admin claim_as Maintenance#45ce0d48 120 ~ ~ minecraft:overworld This will claim as the Maintenance server team for a radius of 120 blocks. This will be around position "~ ~" which is X.Z of your player's current coordinates. "minecraft:overworld" specifies that this will claim in the Overworld, the "normal" world you spawn in.

For server ops you can use /ftbchunks admin bypass_protection I think to bypass any protection, including server teams. Server teams cannot have any members (apart from the server itself), so this is generally useful to configure an area for your players, initially.

Otherwise, one can add tags to allow global interactions on any block. For example, if you want anyone to be able to open doors, adding that specific tag to the door blocks will allow anyone to open doors. Usually it's done with KubeJS, but can also work in a datapack or any other datapack/recipe loader mod. kubejs/server_scripts/tags.js

onEvent("block.tags", (event) => {
    event.add('ftbchunks:interact_whitelist', 'minecraft:doors');
}

Can be adjusted to chests or whatever you like, and only needed on the server (Change minecraft:doors to another tag or block id, or add another line under it). Use /kubejs hand to see information about a block you're holding, with KubeJS installed.

Hopefully this answers some of your concerns, if not then let me know and I'll turn this into a feature request for a global setting for that permission.

Raidobw2 commented 2 years ago

I assume my above reply contained information you needed, else, let me know

JaxCatGames commented 2 years ago

Hey, Raidobw2! I need this to be more of a global setting.

I tried creating a datapack with these commands. It works fine if I enter the commands manually as the client while on the server, but running the command server side just gives me an error that no such command exists:

execute as @p[tag=!party] run ftbteams party create execute as @a[tag=!party] run say Party made! tag @a[tag=!party] add party

Since I found out there were no global settings, I was trying to force everyone onto their own teams then force permissions like this:

execute as @a run ftbteams party settings ftbchunks:block_edit_mode private execute as @a run ftbteams party settings ftbchunks:block_interact_mode allies execute as @a run ftbteams party allies add @a

But again, that doesn't work as a datapack or direct console command. In game as a client with op, perfectly valid. So if there is another option to make it like this, please let me know.

JaxCatGames commented 2 years ago

The upper-case @A is an artifact of some kind. In the actual code, they are lower-case.

Raidobw2 commented 2 years ago

Hmm, I'm unsure what the error would be in your script and how you call those functions from your datapack. You could try to start only with the first line and see if that works, then add the second one, etc. Might be just an actual permission issue on the commands.

If you run plugins on the server, also use only Forge/Fabric instead (depending on which the modpack was made). Plugins can mess with permissions.

I don't have a good solution to your problem, but I'll turn this ticket into an enhancement since you brought clarifications which could have applied to the original poster of this issue. Maybe this can be implemented in the future, in the mod's config directly as a global setting. Or, maybe some KubeJS integration can be done for this, there's a bunch of events in FTB Teams to hook in.

Also, please use code blocks to post code, as you ended up pinging random people. Then you can use the preview button to help see it before posting

execute as @p[tag=!party] run ftbteams party create

Raidobw2 commented 2 years ago

This is related with https://github.com/FTBTeam/FTB-Mods-Issues/issues/412, if the configuration file is properly copied as a default config then customization options for modpack authors increases more with this current issue's improvements