Hey, does anyone know the Maven import I need to use to be able to access NMS?
Thanks!
Hey, does anyone know the Maven import I need to use to be able to access NMS?
Thanks!
What do you need NMS for? The Sponge API aims to make the use of NMS unnecessary, so itās possible that whatever you want to do can be done with the API already. Furthermore, to use NMS, youād need to import and setup the MCP mappings, used by both SpongeForge and SpongeVanilla, and doing that requires a couple more steps than a maven import (steps which I do not know how to accomplish
)ā¦
Well, thereās some things that I used in Spigot that Sponge doesnāt have, to my knowledge. For instance, hiding players without having those annoying potion effect particles everywhere. In Spigot, youād simply
Player#hidePlayer(targetPlayer);
and it did the packet-magic for you. It was brilliant. Also I need to do per-client spawning of entities for āinstancedā areas. Mappings huh? That doesnāt sound fun xD I figured it was just an import because thatās all I had to do with Spigot. Iām still kinda getting the hang of Sponge.
There is a Data API key Keys.VANISH I believe
Yeah, I heard about that. Unfortunately, you canāt specify who the vanished player is vanished from. Itās either everyone, or no one 
You could request for a feature like that⦠The sponge team is open to ideasā¦
Hmmm, where would I submit ideas? I have a few in mind. haha.
As suggested the first thing to do would be consider getting your desired functionality into SpongeAPI, though if you do need to access internal classes then itās quite simple.
I suggest you create a forge environment and include spongeforge as a dependency.
You can find ForgeGradle docs here: https://forgegradle.readthedocs.io/en/latest/
and a template build.gradle in forge
To add spongeforge as a dependency, put
compile 'org.spongepowered:spongeforge:{spongeforge_version}:dev'
in your dependencies. Example version: ā1.11.2-2201-6.0.0-BETA-2040ā
then run the gradle task setupDecompWorkspace to create the forgegradle workspace (or setupDevWorkspace if you donāt need to decompile MC sources)
This kind of per-player data stuff is already being planned:
But that doesnāt work on vanilla. I forget the vanilla way, but you might want to mention it.
Spigot is a modified jar of Minecraft. This means that method names and such are by and large deobfuscated already. Conversely, Sponge uses an unmodified Minecraft server jar, and mixes into it to make it implement the Sponge API at runtime. Thus, the classes and methods and variables are still obfuscated. You need a gradle plugin to properly map your deobfuscated calls to obfuscated calls.
So by saying that @simon816ās way doesnāt work with Vanilla, using his way Iād have to make a Forge mod to do NMS stuff and use a plugin messaging channel to communicate between the plugin and mod?
I didnāt know that about Spigot. That makes a lot of sense actually. Do you know what the name of the plugin is that Iād need? Even with the plugin though, I still wouldnāt have access to NMS without using Simonās suggestion, right?
There is a way to do it in vanilla, I have just forgotten it.
Pretty sure the ForgeGradle plugin has a configuration for that⦠I donāt remember how to set it up thoughā¦
Edit:
ha-ha, that moment when you realize you had the exact same problem:
The only question is: did I delete the project that has the proper configurations or notā¦
I would suggest that you take a bit of time to read Implementation-dependent Plugins ā Sponge 7.2.0 documentation. It describes most of the things you need to know when you really have to use NMS in your plugin, including setting up a Vanilla MCP workspace.