Repository navigation
Conversation
|
|
||
| /** @deprecated Use {@link #getWidth(int, NetworkPlayerInfo, EntityPlayer)} */ | ||
| @Deprecated | ||
| default int getWidth(@NotNull NetworkPlayerInfo netInfo, @Nullable EntityPlayer entityPlayer) { return 0; } |
There was a problem hiding this comment.
i don't see the point of passing i you can make a map and cache things in your handler and have a on tick method too
|
1. with old 2. with my In this example, you can see how in my version a developer has the option to create the data he needs when its available to create and then simply use the data he created in the Note: with my |
…devs # Conflicts: # src/main/java/fr/alexdoru/mwe/api/ISquadInfoRenderer.java
| /** | ||
| * @return {@code true} if the squad HUD is currently rendered | ||
| */ | ||
| public static boolean isSquadHUDEnabled() { |
There was a problem hiding this comment.
dont need it. thought it might be useful for other developers.
|
Your first version is much faster, computing distances costs nothing compared to creating objects and iterating collections |
Changes I encourage
Added
ISquadInfoRenderer#getWidth(int listIndex, @NotNull NetworkPlayerInfo netInfo, @Nullable EntityPlayer entityPlayer)to replace:
ISquadInfoRenderer#getWidth(@NotNull NetworkPlayerInfo netInfo, @Nullable EntityPlayer entityPlayer)Added
ISquadInfoRenderer#render(int listIndex, @NotNull NetworkPlayerInfo netInfo, @Nullable EntityPlayer entityPlayer, int x, int y, int reservedWidth, int reservedHeight)to replace:
ISquadInfoRenderer#render(@NotNull NetworkPlayerInfo netInfo, @Nullable EntityPlayer entityPlayer, int x, int y, int reservedWidth)Added
ISquadInfoRenderer#processData(int listSize, @Unmodifiable List<NetworkPlayerInfo> netInfoList, @Unmodifiable List<EntityPlayer> entityPlayerList)andISquadInfoRenderer#clearData()The idea behind these changes is to give developers the option to create their own data with
processDataandclearDataand access their data in
getWidthandrenderwith thelistIndexparameter(I added
reservedHeighttorenderbecause I believe developers could use it. for example, to center something)Note:
to make the new
getWidthandrendermethods work nicely I had to make themdefaultand by default execute the oldgetWidthandrendermethods, this is for backwards compatibility.I made the old
getWidthandrendermethodsdefaultaswell so developers who use the updated version dont have to implement them and can directly only implement the newgetWidthandrendermethods.Optional Additions
Added Priority logic to
ISquadInfoRenders (same as forge'sEventPrioritylogic).this can be useful for some developers
(
HIGHESTis drawn first,LOWESTis drawn last)Added
MWEApi.Hud.isSquadHUDEnabled()method just incase some developers could use it