Custom Model Data Support #34
Labels
No labels
API
Addon Request
Bug
Duplicate
Enhancement
Feature Request
High Priority
Hybrid Software
Incompatibility
Invalid
Legacy
Low Priority
Missing Information
Needs Confirmation
Possible with API
Question
Won't Fix
v2
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: SBDevelopment/VehiclesPlus#34
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
Compiling a vehicle.yml file using custom-model-data instead of damaged for the texture pack, when I try to buy a vehicle it doesn't work.
To Reproduce
Steps to reproduce the behavior:
partList:
list0:
className: me.legofreak107.vehiclesplus.vehicles.vehicles.objects.addons.skins.Skin
skin:
==: org.bukkit.inventory.ItemStack
v: 2230
type: STICK
meta:
==: ItemMeta
meta-type: UNSPECIFIC
Unbreakable: true
custom-model-data: 1000
After using the /vehicle shop command and try to buy a vehicle, it gives this error.
[16:03:35 WARN]: [VehiclesPlusPro] Task #37024 for VehiclesPlusPro v2.0.8 generated an exception java.lang.ClassCastException: org.bukkit.craftbukkit.v1_15_R1.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.LeatherArmorMeta at me.legofreak107.vehiclesplus.vehicles.commands.VehiclesCommand$2$1.run(VehiclesCommand.java:274) ~[?:?] at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.15.2.jar:git-Paper-387] at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.15.2.jar:git-Paper-387] at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1265) ~[patched_1.15.2.jar:git-Paper-387] at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:431) ~[patched_1.15.2.jar:git-Paper-387] at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1182) ~[patched_1.15.2.jar:git-Paper-387] at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:971) ~[patched_1.15.2.jar:git-Paper-387] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
Expected behavior
It should recognize the custom-model-data (following this guide https://www.spigotmc.org/wiki/itemstack-serialization/) but it doesn't work. I need to use custom model data instead of the damaged feature to link the vehicle to the texture pack.
Screenshots or Video Recordings
No screenshots, just errors.
Server and Plugin Informations
Additional context
No.
Adding this feature would basically allow any custom textures plugin to hook into VehiclesPlus with no need to manually hook any API.
I upvote this
Why is it that you need to use custom model data as opposed to damage?
Because it's a standard in 1.14+ plugins and damage values trick must be dropped.
Every custom models framework uses custom model data now so if you add this feature to your plugin it will be compatible with every custom models plugin out there
I have no plans to add this. I would have to drop support for 1.12 and 1.13 which are both versions that have large percentages of servers using VehiclesPlus.
There is no need to drop the support completely.
You just have to accept CustomModelData NBT tag in your items loading code, only if the server version is 1.14+
This won't require you to rebase the entire plugin
I dont think you would need to drop support for ealier versions would you? Should you not be able to fork your current work and make the neccessary changes for 1.14+ and keep them on separate streams?
Make one plugin for pre 1.14 and manage it separately from the 1.14+ versions?
I'm sure it would require just 3 lines of code to be added to the items generation part in order to support custom model data feature, I don't see why not adding this
Well, managing 2 different versions of the plugin is not easy.
Yea exact, it's easier to add a check "if server version >= 1.14 load custom model data"
easy
Or accept and be happy what you have :)
You bought the plugin back when you thought the plugin was worth that price. Of course you can leave suggestions but when the dev says no. It's no. That's it. I think Relavis wants to "stabilize" the plugin first. Because the last dev of this plugin before Relavis was awful.
Whatever
It's not that easy. Because you are importing from the 1.14 API of Spigot, it will not work on 1.12 & 1.13 unless you create a special class for it.
Maybe I will look into this, because I think it's something that will get more standardized in higher versions.
@NessunoMC @LoneDev6
Can you try to make the baseColorList empty?

So it's like:
The problem is that it tries to cast it to LeatherArmor if it detects the colors.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Reopened as a duplicate issue was created.
Custom model data seems to be working fine for me on 2.2.7. Please reply if you have issues.