Open TerdyTheTerd opened 3 years ago
Regarding maven difficulties, you may want to check if one of the dependencies is transitively including an older version of bukkit or spigot-api which is interfering wiith your own dependency.
It should be noted that before a certain version, PDH/PDC methods did not exist and we had (for a while) PersistentMetadata methods, but I'm not sure if PMD existed back into 1.8 (I misremembered). If it doesn't, then you would get into adding hacky NBT tags in 1.8 and I try to avoid NBT manipulation, personally.
This plugin maintains support for 1.8-1.16.5 so, any version-specific code should be present soley in a/the compatibility support module that is relevant to it and a version-agnostic interface should be added to CompatibilityProvider to expose those version-specific implementations of the same feature.
A few of the other modules (like Core) compile under one version and test under another.
That aside, I will consider this feature, but the possibility of it only working on some versions and not on others doesn't thrill me.
Added In | Deprecated In | Name | Persistent? | Works with |
---|---|---|---|---|
1.14 | N/A | PersistentDataContainer | Yes | Entities, Items |
1.13.2 | 1.14 | CustomItemTagContainer | Yes | Items* |
1.10.2 | N/A | Scoreboard Tags | Yes | Entities |
1.7.10? | N/A | Metadatable | No | Entities, Items |
1.2.1** | N/A | Custom NBT | Yes | Entities, Items |
looks like this is what we have to work with for setting tags on mobs in each version unless we keep an offline record of entity UUIDs
(*items, but you could abuse mob inventory to tag a mob - not recommended since you may want other items in those slots) (**not officially supported by bukkit/spigot, needs reflection - incompatible with Glowstone).
Ahh I didn't realize the plugin was aiming for such a large range of version support.
I'm unsure if you are willing to help, but the code itself took less than 10 minutes, yet I've been fighting the project for well over 4 hours trying to get it to just compile a jar for my server. No matter what I do, when ever I run maven to generate the jar file it ALWAYS reverts back and reimports bukkit over spigot for the Core module, throwing a compilation error due to bukkit not have the persistent data container.
Are there specific build configurations in this project to generate just a modern spigot 1.16.5 build. Is there something I am missing that keeps bringing bukkit back in over spigot in the pom? I am new to maven, and so far its been a nightmare, why on earth do none of the tools let me simple click on a dependency and remove from build...
For the Core, if you open the pom.xml (PlayerHeads-core/pom.xml), you can edit the versions used You can update the depdendency for Core by either:
This project is not your typical single-POM project, but the main POM provides defaults for all of the module projects. Each module project has its own POM and dependencies it sets. This is how I'm able to compile code for different versions into one plugin.
Some combination of importing and resetting seems to have done the trick. Thanks a bunch! My server has been waiting on this update for several days so I can enable SilkSpawners and let players use their rare mob head drops to change spawners they collect to the respective mob type, but I needed mobs spawned from spawners to not drop additional heads to prevent the mob heads from losing their value.
I'm not sure what you mean, if you mvn clean compile package install
(clean install might be enough) the parent project, it should build and produce a properly shaded JAR.
can you post your build log and the resulting JAR?
You might try this dev build to see if it has the same affect https://ci.meme.tips/job/PlayerHeads-5.x/1136/ [once it is finished] I haven't tested it though so there could be bugs preventing it from working properly on the first pass.
There are two new configuration options:
These will need to be applied from the config file and a /ph config reload will need to occur if you use Build 1134. Build 1135 should support the new config option in /ph config set properly.
so for your case you would probably want to set trackspawnermobs to true, then spawnermobbehavior either to vanilla or block. block will prevent all head drops for entities from spawners including vanilla head drops (wither skeletons, charged creepers) vanilla will only prevent head drops added by PH for spawner mobs.
Compatibility note: in 1.14 and higher, spawnreason tagging should be persistent across restarts. Lower than that, at this time metadata is used which is not persistent.
Oh wow that was fast. I have actually been using the changes that I implemented and they work well, but I will probably look to update to an official build later anyways.
Describe the solution you'd like Add a config option to not drop mob heads from mobs that were spawned from a mob spawner. This is to prevent mob heads from losing rarity easily with mob spawner farms, especially when using SilkSpawners or other such plugins.
Additional context CreatureSpawnEvent store PersistentData via PersistentDataContainer class from Spigot-API if spawn reason is SPAWNER. EntityDeathEvent check for PersistentData key that was set, return if set
I was implementing this myself, but I honestly cannot for the LIFE of me, get maven to behave and get spigot api added correctly. Build always fails because it cannot find the methods used in the above mentioned class.