Git Product home page Git Product logo

Comments (6)

yusshu avatar yusshu commented on August 25, 2024 1

the biggest problem i can see with this is conflicting resources, especially when dealing with replacing vanilla ones, what should happen when a resource is in /initial-resources/ but then a plugin also wants to replace the same resource?

We would deserialize them (new in 0.6.0-SNAPSHOT), add them to the ResourcePack before the ResourcePackGenerateEvent and let plugins check if a resource exists, for example

class MyPluginResourcePackGenerateListener implements EventListener<ResourcePackGenerateEvent> {
  
    @Override
    public void handle(ResourcePackGenerateEvent event) {
        PackMeta packMeta = event.packMeta();
        if (packMeta == null) {
            event.packMeta(9, "Default description");
        } else {
            // colorize description
            event.packMeta(
                packMeta.format(),
                replaceAmpersandBySectionSignSmartly(packMeta.description())
            );
        }
    }
  
}

from creative.

dev-hydrogen avatar dev-hydrogen commented on August 25, 2024

for ideas youre free to look at my resources plugin, licensed as mit
personally i would really like a "credits" system implemented where all plugins that add resources can also add a "credit" of their own to a file in the resource pack

from creative.

dev-hydrogen avatar dev-hydrogen commented on August 25, 2024

the biggest problem i can see with this is conflicting resources, especially when dealing with replacing vanilla ones, what should happen when a resource is in /initial-resources/ but then a plugin also wants to replace the same resource?

from creative.

yusshu avatar yusshu commented on August 25, 2024

for ideas youre free to look at my resources plugin, licensed as mit personally i would really like a "credits" system implemented where all plugins that add resources can also add a "credit" of their own to a file in the resource pack

Thank you for the resources plugin,
and, the credits system could be implemented yeah

from creative.

dev-hydrogen avatar dev-hydrogen commented on August 25, 2024

the biggest problem i can see with this is conflicting resources, especially when dealing with replacing vanilla ones, what should happen when a resource is in /initial-resources/ but then a plugin also wants to replace the same resource?

We would deserialize them (new in 0.6.0-SNAPSHOT), add them to the ResourcePack before the ResourcePackGenerateEvent and let plugins check if a resource exists, for example

class MyPluginResourcePackGenerateListener implements EventListener<ResourcePackGenerateEvent> {
  
    @Override
    public void handle(ResourcePackGenerateEvent event) {
        PackMeta packMeta = event.packMeta();
        if (packMeta == null) {
            event.packMeta(9, "Default description");
        } else {
            // colorize description
            event.packMeta(
                packMeta.format(),
                replaceAmpersandBySectionSignSmartly(packMeta.description())
            );
        }
    }
  
}

I believe event listeners are handled in random order, unless the plugin developer sets a specific priority for the listener, what should happen in that case?

from creative.

yusshu avatar yusshu commented on August 25, 2024

I believe event listeners are handled in random order, unless the plugin developer sets a specific priority for the listener, what should happen in that case?

I think we should implement our own event system, similar to LuckPerms

from creative.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.