-
Notifications
You must be signed in to change notification settings - Fork 22
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
PermissionsEx Chat Handling #521
Comments
Not sure if have to use reflection here... if so i don't know how to do that properly. |
Interacting with Bukkit plugins from Minecraft mods requires a good bit of
work. It's been a while since I last attempted it but there were hoops that
I had to jump though to get it working. If memory serves me the classpaths
for mods and plugins are split or requires a bit of finessing. I'll look
into it again and see how it should be done. The error you show
specifically denotes PEX not being in the classpath the mods are looking in
typically. Is it installed properly as a plug-in? Or is that error
occurring during build time?--
~ Joe Goett
|
Yeah. The error comes from calling the PermissionsEx.user().getPrefix()/getSuffix(). I set up the deploader to download PEX and the gradle script to compile it. I built a fresh build with ./gradlew clean build -i I'm pretty sure this is going to require reflection, but my reflection code hasn't fixed it. |
I got the reflection part nailed:
|
For the invoke calls, replace instance with null and Player.class with the actual Player instance. Doing that should fix the IllegalArgumentException. |
Yeah that fixed IllegalArgumentException but caused:
|
That is likely caused by the separate classpaths for mods and plugins. If I
remember right the way I resolved it was to create a Bukkit plugin that
hooked into MyTown. It might have changed since the last time I did that
but that's what I remember.--
~ Joe Goett
|
Hmm. I think you added a modified bukkit.jar to the dependencies to fix the problem because i can't find any reflection in the MT2 src. I'm at a loss here, don't know what to do. |
I know for certain it's not a modified Bukkit jar. If you look at
GitHub.com/MyEssentials/ForgePermsCBBridge and
GitHub.com/MyEssentials/ForgePerms you can see how we tackled it in the
past.--
~ Joe Goett
|
You may also see how it is handled more recently in
GitHub.com/MyEssentials/mypermissions--
~ Joe Goett
|
I appologize, I just saw we do indeed have a modified Bukkit jar, which I
find odd.
--
~ Joe Goett
|
Ahahahaha, Yeah the modified bukkit jar is a splendid way to go about it. :P The code is already setup to work with PermissionsEx, although i can't find explicit references to it's API. However, i can't seem to use reflection to import its methods. I tried to go another route, and create two chat handler classes, one for forge and the other for bukkit, where the latter gets triggered if it's installation is detected. For some reason, i can't import methods from bukkitchathandler.instance into forgechathandler.instance. So the crude, manual way of doing this doesn't work either. Guess i'll have to go the reflection route, and if you have time it would be easier to work together. |
Is this information fine for the deps.info file?
|
Hi again,
I created a class called ChatHandler which overrides the ChatManager class.
It basically does this:
[CitizenRank][EmpireName] Username: message
example: [L][Rome] Player123: Hello World
I want it to do this:
[PexPrefix][CitizenRank][EmpireName][PexSuffix] Username: message
example: [Admin][L][Rome] Username: message
**No suffix in this example ^
Was wondering if you could help me set this up, because i get this error:
So i modified the class to include:
The text was updated successfully, but these errors were encountered: