bergerhealer / TrainCarts

Minecarts redefined
MIT License
206 stars 63 forks source link

Error messages using signs #179

Closed Lawlzasaurusrex closed 6 years ago

Lawlzasaurusrex commented 6 years ago
BkCommonLib version: 1.12.2-v3
TrainCarts version:1.12.2-v1
Spigot version: craftbukkit 1.12.1 git-Bukkit-8f47214

Problem or bug:

Got in a cart and added coal to the furnace in front of me, there is a sign for charging for a ticket that the cart goes over. Havent tried much else yet.

[13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_ENTER for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] at com.bergerkiller.bukkit.tc.signactions.SignAction.executeAll(SignAction.java:204) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute GROUP_ENTER for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] at com.bergerkiller.bukkit.tc.signactions.SignAction.executeAll(SignAction.java:204) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_MOVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_MOVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_LEAVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] at com.bergerkiller.bukkit.tc.signactions.SignAction.executeAll(SignAction.java:204) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_ENTER for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] at com.bergerkiller.bukkit.tc.signactions.SignAction.executeAll(SignAction.java:204) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_MOVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_MOVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute MEMBER_LEAVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] at com.bergerkiller.bukkit.tc.signactions.SignAction.executeAll(SignAction.java:204) ~[?:?] [13:22:10 ERROR]: [Train_Carts] Failed to execute GROUP_LEAVE for SignActionTicket: java.lang.RuntimeException: BROKEN at com.bergerkiller.bukkit.tc.signactions.SignActionTicket.execute(SignActionTicket.java:26) ~[?:?] at com.bergerkiller.bukkit.tc.signactions.SignAction.executeAll(SignAction.java:204) ~[?:?]

Expected behaviour: Not sure what to put here :) Expecting no errors? Lol. Hoping it would charge for the ticket. Lets me get in, start the cart, and everything works well. But the errors jump and no tickets or exit signs work.

Steps to reproduce:

Placed a furnace and normal cart, get in, put coal in the furnace, cart rolls over ticket buy sign.

bergerkiller commented 6 years ago

Ticket sign doesnt work at the moment, because there is no money plugin available to handle any of it. The plugin that used to handle that, got discontinued, hence the BROKEN.

Lawlzasaurusrex commented 6 years ago

Thanks for the quick response. I went ahead and tried a bunch of the other signs and I've confirmed your user error :P. Is there plan to fix this by connecting it to essentialsX? Also, is there plan to find a new plugin to use it all with since SignLink is no longer updated?

Been using this plugin for years and I'm happy to continue using it. Thanks for the great work!

bergerkiller commented 6 years ago

SignLink is updated though. Latest version works just fine, even better than the older release pre-2017 :)

It is always possible to breath new life into this feature. Its been badly designed from the start though. And with the absence of a unified money API I would probably have to add support for all sorts of eco plugins. Its why I made the new ticket system based on maps, so that the /giving of tickets can be handled by another plugin. I prefer map items as tickets over a sign system like this, because then you can check user priviliges before its too late and he has to pay...

https://www.youtube.com/watch?v=fVA_MPxXVO0&t=39s

It would help me to know what your goal is? Prevent people from entering the train before they have a ticket? Or charge them money while in the ride? When to charge the player money is the key here

The map-based ticket API does not yet have eco support, but its something I consider adding. Not sure how the player should initiate receiving the ticket. I think a command would be nice, because that command can be put on a clickable sign using a plugin like https://www.spigotmc.org/resources/command-signs.10512/

Lawlzasaurusrex commented 6 years ago

Found the updated SignLink - thanks.

I think my only goal is to make sure players are charged for the ride so either method works. I wonder if you could write the plugin to run a command for the player. Then someone can put whatever eco system they want in there. For example - with essentials - it could just use /take and someone can put in the config.yml under the specific section "take {player} 500" for example and the plugin could run it.

Of course I'm not an avid coder so I dont know how much that takes to do that.

bergerkiller commented 6 years ago

I dont know myself how to use essentials like this, which is part of the problem I guess. Many things are possible, just don't know which is the most obvious.

What I do know is that you need to check for tickets before they enter the train, not while they are in it. Otherwise you must deal with booting them out of the train instead of not letting them enter at all.

I'll need to think about this a bit. Of course, another way is to have something non-traincarts related which simply creates a gate or door you can only walk through if you have the money, where you are charged. Does such a plugin exist? It should...

Lawlzasaurusrex commented 6 years ago

I dont know that something exists in that manner but maybe it could be used in collaboration with worldguard flags for entry and exit (says whether a certain person or group can enter or exit an area).

Maybe a ticket could be bought using an outside sign or button that gives the person the ability to enter the train using /region addmember, then after the person is on the train, a sign below the train could sense who is above, and remove the person from the region. Most of it would just be telling console to run some commands. You would just need to make sure that once a person buys a ticket, they cant buy another concurrently.