Coder Social home page Coder Social logo

Comments (5)

Phoenix616 avatar Phoenix616 commented on June 19, 2024

What exactly are you trying to do and at which point is the sign text not changed? When it's applied to the world or in a plugin function somewhere?

Because the signs are changed by using the setSignLine method in the SignChangeEvent so Bukkit is responsible for actually setting the changed lines on the sign in the end.

from chestshop-3.

DrOreo002 avatar DrOreo002 commented on June 19, 2024

I'm trying this code on PreShopCrationEvent..

for (int i = 0; i < 4; i++) {
e.setSignLine((byte) i, "");
}

and it should change the sign's text right?. Btw I'm making a shop limiter addon where it will cancel the event and I want to clear the sign's line when player reached the max limit..

But the problem is.., that code is not working and its not changing the sign's text.

Also I'm not on my pc rn, I'm using my phone to reply, I'll continue this tommorow, thanks

from chestshop-3.

DrOreo002 avatar DrOreo002 commented on June 19, 2024

Btw, I hope I've explained it correctly. I'm not really good at english. Thanks..

from chestshop-3.

Phoenix616 avatar Phoenix616 commented on June 19, 2024

Yeah I think I see what the issue is. When cancelling the event it will not reach the line setting part. Maybe we should move the sign setting before the return when it's cancelled or cancel the SignChangeEvent too when the PreShopCreationEvent is cancelled. Not sure which the better solution is but the way it's now it's not really practical.

from chestshop-3.

DrOreo002 avatar DrOreo002 commented on June 19, 2024

Okay I can use my pc now. Here's my code (not working tho), I've tried to cancel the event after I changed the sign.

        if (currShop >= limit) {
            player.sendMessage(Main.getPrefix() + "You have reached the max limit of shops creation. Please contact server admin if you need some help.");
            for (int i = 0; i < 4; i++) {
                e.setSignLine((byte) i, "");
            }
            e.setSignLine((byte) 0, "[ Error ]");
            e.setOutcome(PreShopCreationEvent.CreationOutcome.OTHER);
            return;
        }

Can you help me?, If you can't well its okay

from chestshop-3.

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.