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

Mod Material support, for Hybrid Server #7126

Merged
merged 20 commits into from
Oct 31, 2024

Conversation

0XPYEX0
Copy link
Contributor

@0XPYEX0 0XPYEX0 commented Oct 2, 2024

Description

As title, support for items which added by mods
For PR: #7121

on enchant:
    if event-item is (cataclysm's the incinerator): # The item ID
        send "success" to player

b258fdd942e5bf2210428d7b21cdb3d9

on right click:
    send "%type of tool of player%" to player

63134e0a5c43b268706222ad750c48d0
It's an old screenshot. Now it's quack's abacus

The pattern just like: mod:an_item_name_with_line (parsed to alias)→ mod's an item name with line
And vanilla aliases are not changed. minecraft:dirtdirt


Target Minecraft Versions: any
Requirements: none
Related Issues: #4051 #4678 #4778 #6503

@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Oct 2, 2024
@BredyAK
Copy link

BredyAK commented Oct 2, 2024

I strongly recommend to approve this PR because:

  1. in future minecraft versions, maybe there will be a way to directly add blocks/items to minecraft by datapack. then the namespace may not be minecraft. but currently Skript doesn't support to create aliases for items which do not use minecraft as their namespace.
  2. as the 1st opinion said, if this PR is approved, then Hybird servers will also benefit from this, which could let modded items being added to Skript aliases.
  3. this PR doesn't break any Skript's current core things, but increased scalability.
  4. there are a lot of people want this too, such as https://forums.skunity.com/threads/14952/, https://forums.skunity.com/threads/9848/, https://forums.skunity.com/threads/14457/, etc. if you google "Skript Mod Item" or something similiar, you could find a lot more.

i know that Skript doesn't support Hybird servers, but this PR is intended to improve the scalability of Skript, not just for Hybird servers.

(ref: #7121 (comment))

If we check it, Skript cannot parse aliases of mod items (In Hybrid Server

(ref: #7121)

good job! your unrealized plan in the previous PR was finally realized, while ensuring the core functions of Skript.

Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

Looks pretty good!

src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/bukkitutil/BukkitUnsafe.java Outdated Show resolved Hide resolved
@BredyAK
Copy link

BredyAK commented Oct 2, 2024

i just did some tests, no worry, all of them are runned as expected:

  1. no matter what the option load default aliases in Skript's config file is set (true or false), it doesn't affect vanilla or mod's aliases' generation.
  2. when i execute !give cataclysm's the incinerator to player, i successfully get the expected item, and its id is cataclysm:the_incinerator.
  3. when i execute !give diamond chestplate to player, i successfully get the expected item, and its id is minecraft:diamond_chestplate.

this is an epic PR for me, thanks! this is why i love Skript's community.

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 2, 2024

Hey guys, maybe we could do like this?
image
I add a of expression, and make it looks like quack mod's abacus or abacus of mod quack
Should it be done or not?

@sovdeeth @Efnilite

@sovdeeth
Copy link
Member

sovdeeth commented Oct 2, 2024

Hey guys, maybe we could do like this?

I'm not a fan of the |s stuff, but i suppose mod's x and x from mod is ok
actually ignore the first part

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 2, 2024

Hey guys, maybe we could do like this?

I'm not a fan of the |s stuff, but i suppose mod's x and x from mod is ok

Just like abacus from mod quack, right? Not of ?

@sovdeeth
Copy link
Member

sovdeeth commented Oct 2, 2024

Hey guys, maybe we could do like this?

I'm not a fan of the |s stuff, but i suppose mod's x and x from mod is ok

Just like abacus from mod quack, right? Not of ?

I'd like <item> from <mod>, so abacus from quark

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 2, 2024

Hey guys, maybe we could do like this?

I'm not a fan of the |s stuff

Actually idk what is it, but there was a ¦s before, so I kept it

@BredyAK
Copy link

BredyAK commented Oct 2, 2024

I don't see a need for a config option, but I do want to ask whether we should add a warning when running on a modded server? We don't support modded platforms, so it is probably not a good idea for people to be using skript to build their modded servers. I know people will do it anyway, but I'd love to at least make it clear they are on their own.

i don't think there is a need to add warnings... because it doesn't affect vanilla server at all.
and you are using hybird server, how couldn't you know the warning things?

btw,

We don't support modded platforms

this is not a thing only about modded platforms. i could use my reply above:

I'm a bit concerned on how many aliases this will add if it's 3 per modded item, skript already suffers enough from how many they just add.

here is what this PR do:

  1. if you are a vanilla server, then just ignore this PR because it take no effect of your server.
  2. if you are a hybird server, then this PR will make Skript intelligently generate the aliases it needed. not only all the vanilla aliases will be kept, but also help you generate the extra aliases such as created by your mods, etc.

in future, maybe Mojang will provide a way to let creators add blocks/items/etc. to Minecraft by simply using datapakcs (like Bedrock Edition's behavior pack + resource pack), then creators could use their own nameplaces (not minceraft:), Skript will become more scalable then.

@EquipableMC
Copy link
Contributor

I don't see a need for a config option, but I do want to ask whether we should add a warning when running on a modded server? We don't support modded platforms, so it is probably not a good idea for people to be using skript to build their modded servers. I know people will do it anyway, but I'd love to at least make it clear they are on their own.

I feel like we should, because some modded platforms mess with some internal code so yeah, and plus if people go to open an issue about it, they may see that yellow warning message and not do it

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 3, 2024

I'm neutral. It doesn't matter if we warn them or not.

@MSCMDD
Copy link

MSCMDD commented Oct 3, 2024

I am in favor of this pull request. While it's true that Skript doesn't officially support Hybrid servers, a significant number of users still use it with Hybrid servers. Therefore, I believe it's highly beneficial to merge this.

@BredyAK
Copy link

BredyAK commented Oct 3, 2024

currently it doesn't support mod's entity type, maybe it will be better if this PR makes Skript support mod entities, just like using the command below to summon a mod entity:

!summon aether's blue swet at player's location

thank you for bringing this epic PR!

@sovdeeth
Copy link
Member

sovdeeth commented Oct 3, 2024

currently it doesn't support mod's entity type, maybe it will be better if this PR makes Skript support mod entities, just like using the command below to summon a mod entity:

!summon aether's blue swet at player's location

thank you for bringing this epic PR!

That's out of scope for this PR, and probably out of scope in general for skript at the current moment, since it would involve adding entitydatas.

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 3, 2024

!summon aether's blue swet at player's location

not planned now

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 26, 2024

Waiting for merging 🤔

@sovdeeth sovdeeth changed the base branch from dev/patch to dev/feature October 26, 2024 13:57
@sovdeeth sovdeeth requested a review from Moderocky October 26, 2024 14:32
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.

Include a warning that modded servers are not supported, we do not want issues about this filling the tracker.

@0XPYEX0
Copy link
Contributor Author

0XPYEX0 commented Oct 27, 2024

How about the warnings🤔
Will this be too harsh?😰

@Efnilite Efnilite added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Oct 29, 2024
@sovdeeth sovdeeth merged commit 6c23496 into SkriptLang:dev/feature Oct 31, 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. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants