Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Util Additions #7267

Merged
merged 8 commits into from
Dec 24, 2024
Merged

Conversation

TheAbsolutionism
Copy link
Contributor

Description

This PR aims to add additional Utils and change sound effects.

NamespacedUtils - I have this in a couple of my PRs and it's in burb's LootTables PR, figured I could extract it into it's own PR to have it concluded in one place so it can be discussed and finalized within one spot. Then this could be merged before the PRs that contain it.

SoundUtils - Utilize NamespacedUtils

Fixes EffStopSound relating to this issue https://discord.com/channels/135877399391764480/138027100593455104/1317593379722362962


Target Minecraft Versions: any
Requirements: none
Related Issues: none

Copy link
Contributor

@Asleeepp Asleeepp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take my very important approval

@Efnilite Efnilite added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Dec 16, 2024
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had spoken with Sovde about this yesterday, and I am not too sure about encoding namespaced keys, mainly because they are still user-facing in game via commands and such. Given runtime errors will soon be available, I would prefer for us to restrict what characters are available. I'd like to hear thoughts from others though 🙂

@sovdeeth
Copy link
Member

fyi we're currently discussing how to better handle namsepace keys - oh pickle just responded

@TheAbsolutionism
Copy link
Contributor Author

Alrighty, that's fine. Let me know what y'all decide to do. Based off context, just sounds like the createNamespacedKey method may or may not be removed.

@ShaneBeee
Copy link
Contributor

ShaneBeee commented Dec 16, 2024

Just wanted to throw my 2 cents in:

  1. private static final Set<Character> LEGAL_NAMESPACE_CHARS = Sets.newHashSet(ArrayUtils.toObject("abcdefghijklmnopqrstuvwxyz0123456789._-/".toCharArray()));
    this should probably be LEGAL_KEY_CHARS as these are the characters allowed in a KEY not in a NAMESPACE.

  2. I didnt fully read the entire util class, so pardon me if I missed something, but why not use a regex pattern instead of a set of characters?

  3. Since the majority of places a NamespacedKey will be used will be for Minecraft things (ie: recipes, tags, sounds, etc), why are you having the default namespace be Skript? Shouldn't it be Minecraft?
    I doubt anyone will ever really need to use the "skript" namespace.

@TheAbsolutionism
Copy link
Contributor Author

@ShaneBeee For 1 and 2, that's how it was originally from Pikachu's old closed Recipe PR. Pikachu and Sovde told me to port it over to my Recipe PR. In this instance though, I did make a few changes, such as opting in for Minecraft namespace.

For 3, I could reverse the order and make Minecraft the default, doesn't matter to me.

Copy link
Contributor

@Burbulinis Burbulinis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Sovde and Pickle about restricting what characters are available

@TheAbsolutionism TheAbsolutionism mentioned this pull request Dec 19, 2024
19 tasks
…tions

# Conflicts:
#	src/main/java/ch/njol/skript/events/SimpleEvents.java
Copy link
Contributor

@ShaneBeee ShaneBeee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a lil something I noticed

Copy link
Member

@Moderocky Moderocky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok.

@Moderocky Moderocky merged commit 7db4243 into SkriptLang:dev/feature Dec 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants