packetevents icon indicating copy to clipboard operation
packetevents copied to clipboard

SpigotConversionUtil Additions

Open jtJava opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. It would be helpful to have methods added to the conversion util for the following: EntityEquipment -> List<Equipment> PlayerProfile/GameProfile -> UserProfile Pose -> EntityPose

Describe the solution you'd like Simple conversion methods added to the util class.

Describe alternatives you've considered to solve your solution without us adding this as a feature? I just do it myself without legacy version compatibility.

Add any other context or screenshots about the feature request here. image

jtJava avatar Mar 14 '24 02:03 jtJava

https://github.com/retrooper/packetevents/blob/c8d0733935a8d3cf80752fb1d755132f4a72eb3e/spigot/src/main/java/io/github/retrooper/packetevents/util/SpigotReflectionUtil.java#L395

This should be changed to return a UserProfile object with the texture included, and then a method for conversion using the Paper profile should be added to avoid unnecessary reflection.

jtJava avatar Mar 14 '24 03:03 jtJava

https://github.com/retrooper/packetevents/blob/c8d0733935a8d3cf80752fb1d755132f4a72eb3e/spigot/src/main/java/io/github/retrooper/packetevents/util/SpigotReflectionUtil.java#L395

This should be changed to return a UserProfile object with the texture included, and then a method for conversion using the Paper profile should be added to avoid unnecessary reflection.

packet events is supporting spigot, not paper, therefore irs unavoidable, it gets cached which is a good thing

Tofaa2 avatar Mar 14 '24 06:03 Tofaa2

Is your feature request related to a problem? Please describe. It would be helpful to have methods added to the conversion util for the following: EntityEquipment -> List PlayerProfile/GameProfile -> UserProfile Pose -> EntityPose

Describe the solution you'd like Simple conversion methods added to the util class.

Describe alternatives you've considered to solve your solution without us adding this as a feature? I just do it myself without legacy version compatibility.

Add any other context or screenshots about the feature request here. image

legacy version compatibility is really easy, it's just getValue and getSignature instead of value and signature

jordoncodes avatar Mar 20 '24 22:03 jordoncodes

Good suggestion, will be considered for the next update.

retrooper avatar Mar 30 '24 23:03 retrooper