Custom Model Data Support #34

Closed
opened 2020-10-20 00:26:40 +02:00 by NessunoMC · 16 comments
NessunoMC commented 2020-10-20 00:26:40 +02:00 (Migrated from github.com)

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:

  1. Go to 'VehiclesPlusPro/vehicles/cars/vehicle.yml'
  2. Edit vehicle.yml as

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

  • Installed plugins: Vehicles Plus Pro with required plugins.
  • VehiclesPlus Version: 2.0.8
  • Pro or Lite? Pro
  • Server Platform and Version PaperSpigot 1.15.2 #389
  • Operating System CentOS 6

Additional context
No.

**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: 1. Go to 'VehiclesPlusPro/vehicles/cars/vehicle.yml' 2. Edit vehicle.yml as 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** - Installed plugins: **Vehicles Plus Pro with required plugins.** - VehiclesPlus Version: **2.0.8** - Pro or Lite? **Pro** - Server Platform and Version **PaperSpigot 1.15.2 #389** - Operating System CentOS 6 **Additional context** No.
LoneDev6 commented 2020-10-20 10:44:43 +02:00 (Migrated from github.com)

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

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
relavis commented 2020-10-21 21:39:48 +02:00 (Migrated from github.com)

Why is it that you need to use custom model data as opposed to damage?

Why is it that you *need* to use custom model data as opposed to damage?
LoneDev6 commented 2020-10-22 12:01:33 +02:00 (Migrated from github.com)

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

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
relavis commented 2020-10-22 17:18:28 +02:00 (Migrated from github.com)

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.

> 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.
LoneDev6 commented 2020-10-22 17:26:53 +02:00 (Migrated from github.com)

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

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
MadCabbagee commented 2020-10-24 18:29:58 +02:00 (Migrated from github.com)

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 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?
LoneDev6 commented 2020-10-26 10:55:42 +01:00 (Migrated from github.com)

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

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
Ricco0227 commented 2020-10-26 11:11:51 +01:00 (Migrated from github.com)

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?

Well, managing 2 different versions of the plugin is not easy.

> 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? Well, managing 2 different versions of the plugin is not easy.
LoneDev6 commented 2020-10-26 12:17:57 +01:00 (Migrated from github.com)

Yea exact, it's easier to add a check "if server version >= 1.14 load custom model data"
easy

Yea exact, it's easier to add a check "if server version >= 1.14 load custom model data" easy
Ricco0227 commented 2020-10-26 12:24:32 +01:00 (Migrated from github.com)

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.

> 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.
LoneDev6 commented 2020-10-26 13:45:29 +01:00 (Migrated from github.com)

Whatever

Whatever
stijnb1234 commented 2020-12-23 18:42:05 +01:00 (Migrated from github.com)

Yea exact, it's easier to add a check "if server version >= 1.14 load custom model data"
easy

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.

> Yea exact, it's easier to add a check "if server version >= 1.14 load custom model data" > easy 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.
stijnb1234 commented 2020-12-23 19:01:19 +01:00 (Migrated from github.com)

@NessunoMC @LoneDev6

Can you try to make the baseColorList empty?
image
So it's like:

baseColorList: []

The problem is that it tries to cast it to LeatherArmor if it detects the colors.

@NessunoMC @LoneDev6 Can you try to make the baseColorList empty? ![image](https://user-images.githubusercontent.com/27051051/103024960-1f9d4480-4551-11eb-81d9-50d993aafa3e.png) So it's like: ```yaml baseColorList: [] ``` The problem is that it tries to cast it to LeatherArmor if it detects the colors.
stijnb1234 commented 2021-01-03 11:44:20 +01:00 (Migrated from github.com)

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.

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.
relavis commented 2021-03-09 21:22:17 +01:00 (Migrated from github.com)

Reopened as a duplicate issue was created.

Reopened as a duplicate issue was created.
relavis commented 2021-04-08 00:19:18 +02:00 (Migrated from github.com)

Custom model data seems to be working fine for me on 2.2.7. Please reply if you have issues.

Custom model data seems to be working fine for me on 2.2.7. Please reply if you have issues.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: SBDevelopment/VehiclesPlus#34
No description provided.