Eleven Posted September 14, 2022 Posted September 14, 2022 Hello McX! Im using aCis 401 and i tryed to adapt a Top Enchant Manager from an older revision. thats my code. In order to make it work i had to make some changes in ItemData.java. Check bellow Is that the correct way? Everything seems to work fine but i want to make sure that is not affected anything else. Thanks in advance. Quote
0 Katara512 Posted September 15, 2022 Posted September 15, 2022 what you did right now is to move weapon map outside your main method, why to do that? Quote
0 Zake Posted September 15, 2022 Posted September 15, 2022 Well, let's just ignore almost everything and stick to your only change. You don't have to loop through all the weapons in order to get the item name. You also don't have to change your weapons map from temporary variable to a constant (public static). Since your only concern is the item name you can just make it like final Item itemTemplate = ItemData.getInstance().getTemplate(id here); final String itemName = itemTemplate.getName(); Quote
0 Tryskell Posted September 18, 2022 Posted September 18, 2022 (edited) If the point is only to retrieve item name to put it in a NpcHtmlMessage, you can use the client option "&#"+itemId + ";". Obviously it only works if you properly edited client to reflect what names are on the server, but it's by far the cheapest option. So you only String weaponName = "&#" + rs.getInt("itemId") + ";"; or even better, you integrate it directly into your ret String and you put your different rs.get methods directly into String (you can then delete the first 7 lines, for loop included, and keep only ret +=). Edited September 18, 2022 by Tryskell Quote
Question
Eleven
Hello McX!
Im using aCis 401 and i tryed to adapt a Top Enchant Manager from an older revision. thats my code.
In order to make it work i had to make some changes in ItemData.java. Check bellow
Is that the correct way? Everything seems to work fine but i want to make sure that is not affected anything else.
Thanks in advance.
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.