Filling out the template for funsies:
Versions
EnderContainers version: 2.2.2
Platform version: git-Paper-349 (MC: 1.17.1) [but literally anything, really]
Describe the bug
FactionsUUID support fails, throwing an exception to console instead.
[02:38:38 ERROR]: Could not pass event PlayerInteractEvent to EnderContainers v2.2.2
java.lang.NoClassDefFoundError: com/massivecraft/factions/zcore/fperms/PermissableAction
at fr.utarwyn.endercontainers.dependency.Factions1Dependency.validateBlockChestOpening(Factions1Dependency.java:52) ~[Endercontainers-2.2.2.jar:?]
at fr.utarwyn.endercontainers.dependency.DependenciesManager.validateBlockChestOpening(DependenciesManager.java:74) ~[Endercontainers-2.2.2.jar:?]
at fr.utarwyn.endercontainers.enderchest.EnderChestListener.onPlayerInteract(EnderChestListener.java:81) ~[Endercontainers-2.2.2.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor915.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.17.1.jar:git-Paper-349]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.17.1.jar:git-Paper-349]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.17.1.jar:git-Paper-349]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[patched_1.17.1.jar:git-Paper-349]
at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:543) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:542) ~[app:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1815) ~[app:?]
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:33) ~[app:?]
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:9) ~[app:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[app:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[app:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[app:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1423) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.server.MinecraftServer.shouldRun(MinecraftServer.java:192) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[app:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1401) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1394) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[app:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1372) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1283) ~[patched_1.17.1.jar:git-Paper-349]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-349]
at java.lang.Thread.run(Thread.java:831) ~[?:?]
To Reproduce
- Interact with an enderchest
- ???
Profit! Exception!
Expected behavior
Not throwing an exception to console.
Screenshots
Nope!
Additional context
Alright, time to talk! 😁
Basically, since 2019 there have been a few changes that break the built-in support for FactionsUUID (aka a 1.x fork).
PermissibleAction became an interface, with PermissibleActions being an enum implementation of it, so PermissibleActions.CONTAINER would be the new referenced action.
Faction#hasAccess returns a boolean, because returning an enum was dumb.
Faction#hasAccess gained an optional, but really preferred, parameter. New method to call takes an FLocation at the end. This will be used for an upcoming feature of defining different access for different claims in a faction.
So the new line would be overall:
if (currentFac != playerFac || playerFac.getAccess(fPlayer, PermissableAction.CONTAINER, new FLocation(block))) {
(Though you could just create that FLocation once by reusing the one from the earlier use in getting the currentFac value)
However, this would break support for people inexplicably running a 2011 version of 1.x, and more importantly for folks running forks of FUUID. Those forks generally broke off in 2018 or earlier so they won't have this code. FactionsUUID forks are an absolute nightmare for managing support, so I'm sorry in advance. Some of them do hilarious things like continue to use our versioning system so you can't even easily check versions.
One thought I had was adding a matchAuthor to your DependencyResolver and just checking for me (mbaxter, not mbax - someone beat me to the username here) in the author list.
I'm happy to provide a PR for this if you want, but I wanted to bring it up first since it's your codebase.
For building, if you want to do it:
repository: https://ci.ender.zone/plugin/repository/everything/
groupId: com.massivecraft
artifactId: Factions
version: 1.6.9.5-U0.6.3
For a less formal back and forth discussion, which I welcome, I can be found on Discord as mbaxter#1592 (and we share Spigot's discord as a common ground so you should be able to find me and friend me 😄 ), but I'm happy to limit discussion to here as well.
Filling out the template for funsies:
Versions
EnderContainers version: 2.2.2
Platform version: git-Paper-349 (MC: 1.17.1) [but literally anything, really]
Describe the bug
FactionsUUID support fails, throwing an exception to console instead.
To Reproduce
Profit!Exception!Expected behavior
Not throwing an exception to console.
Screenshots
Nope!
Additional context
Alright, time to talk! 😁
Basically, since 2019 there have been a few changes that break the built-in support for FactionsUUID (aka a 1.x fork).
PermissibleActionbecame an interface, withPermissibleActionsbeing an enum implementation of it, soPermissibleActions.CONTAINERwould be the new referenced action.Faction#hasAccessreturns a boolean, because returning an enum was dumb.Faction#hasAccessgained an optional, but really preferred, parameter. New method to call takes anFLocationat the end. This will be used for an upcoming feature of defining different access for different claims in a faction.So the new line would be overall:
(Though you could just create that FLocation once by reusing the one from the earlier use in getting the currentFac value)
However, this would break support for people inexplicably running a 2011 version of 1.x, and more importantly for folks running forks of FUUID. Those forks generally broke off in 2018 or earlier so they won't have this code. FactionsUUID forks are an absolute nightmare for managing support, so I'm sorry in advance. Some of them do hilarious things like continue to use our versioning system so you can't even easily check versions.
One thought I had was adding a matchAuthor to your DependencyResolver and just checking for me (
mbaxter, not mbax - someone beat me to the username here) in the author list.I'm happy to provide a PR for this if you want, but I wanted to bring it up first since it's your codebase.
For building, if you want to do it:
For a less formal back and forth discussion, which I welcome, I can be found on Discord as
mbaxter#1592(and we share Spigot's discord as a common ground so you should be able to find me and friend me 😄 ), but I'm happy to limit discussion to here as well.