IzzelAliz / Arclight

A Bukkit(1.19/1.20) server implementation in modding environment using Mixin. ⚡
GNU General Public License v3.0
1.59k stars 235 forks source link

[1.16] Unable to call Spigot in Forge #615

Closed austin4195 closed 2 years ago

austin4195 commented 2 years ago

I have confirmed that ...

Arclight version

arclight-1.16.5-1.0.24-SNAPSHOT-156b78b

OS & Java versions

CentOS - Java 11 OpenJDK

Plugins and Mods

Plugins:
LuckPerms, PointsPlugin, VoidGen, InventoryRollbackPlus, PlaceholderAPI, ServerListPlus, Vault, Votifier, ForgeEconomiesSpigotBridge, Multiverse-Core, DeluxeChat, ShopGUIPlus, GUIPlus, FastAsyncWorldEdit (WorldEdit), DiscordSRV, DeluxeMenus, TAB, EverNifeCore, PixelmonEconomyBridge, CMILib, GriefDefender, CMI

Mods:
• minecraft forge-1.16.5-36.2.34-server.jar : minecraft (1.16.5) - 1
• mods_folder ForgeEconomies-Forge-1.8.0-1.16.5.jar : economies (1.8.0) - 1
• mods_folder Atlantis-1.16.5-5.4.3.jar : atlantis (5.4.3) - 1
• mods_folder ForgePlaceholderAPI-Forge-2.0.4-1.16.5.jar : forgeplaceholderapi (2.0.4) - 1
• mods_folder BetterCompatibilityChecker-1.0.7-build.22+mc1.16.5.jar : bcc (1.0.7-build.22+mc1.16.5) - 1
• maven_libs forge-1.16.5-36.2.34-universal.jar : forge (36.2.34) - 1
• mods_folder Menus-Forge-2.0.5-1.16.5.jar : menus (2.0.5) - 1
• mods_folder AquaCrates-1.16.5-1.0.0-universal.jar : aquacrates (1.0.0-universal) - 1
• mods_folder Pixelmon-1.16.5-9.0.2-server.jar : pixelmon (9.0.2) - 3
• mods_folder byg-1.3.5.jar : byg (1.3.4) - 1
• mods_folder AquaDailies-1.16.5-3.0.0-universal.jar : aquadailies (3.0.0-universal) - 1
• mods_folder AquaSkills-1.16.5-4.0.2-universal.jar : aquaskills (4.0.2-universal) - 1
• arclight arclight.jar : arclight (1.16.5-1.0.24-SNAPSHOT-156b78b) - 1

Description

Through the use of something like ForgePlaceholderAPI and SpigotPAPI bridge, there is a way to call Spigot's PlaceholderAPI placeholders and use them with Forge mods. This is accomplished thanks to ForgePlaceholderAPI (FPAPI), which can handle the management of the placeholders and exposes them to other Forge mods through its API.

Using FPAPI placeholders in Spigot things (like DeluxeMenus) works as expected. If I use %FPAPIBridge_forge_name%, it will parse as the player's name reported to Forge and will display that in something like DeluxeMenus or TAB.

The reverse is not true, however. If I wanted to use %luckperms_prefix% inside of something like ForgeMenus, an error will appear as seen in logs. After speaking with the developer of FPAPI and ForgeMenus, this was concluded to be an error in how Arclight exposes Spigot plugins to Forge.

I know of many other developers who would love to be able to call Spigot into their Forge mods and allow for better operation so it is my hope that something can be done about this.

Step to reproduce

No response

Logs

https://www.toptal.com/developers/hastebin/hayulekali.swift

Server pack link (Optional)

No response

IzzelAliz commented 2 years ago

This is how classloaders work. You should have one interface in your mod, let your plugin implement this and pass it to your mod.

Having mods calling plugins directly violates the parent delegation model, which is weird and not easy to implement and maintain.