StinkyMadness Posted July 6, 2019 Author Posted July 6, 2019 (edited) i think can be done with many ways: _list.remove(_list.indexOf(itemId)); _list.remove(Integer.valueOf(ItemId)); _list.remove(new Integer(itemId)); But the critical its to find the best performance. Edited July 6, 2019 by StinkyMadness Quote
Tryskell Posted July 6, 2019 Posted July 6, 2019 15 minutes ago, Rootware said: @Tryskell my example works correct. I get index first and after remove object from ArrayList by him index. What's wrong? All follows Eclipse documentation. Until JIT does its work and saves the day, it's (probably) costier. Quote
Rootware Posted July 6, 2019 Posted July 6, 2019 5 minutes ago, StinkyMadness said: i think can be done with many ways: _list.remove(_list.indexOf(itemId)); _list.remove(Integer.valueOf(ItemId)); _list.remove(new Integer(itemId)); But the critical its to find the best performance. In your case not matter "best way", because too small list for feeling difference. Less few billions object in list pointless for catching performance. Quote
StinkyMadness Posted July 6, 2019 Author Posted July 6, 2019 (edited) 19 minutes ago, Rootware said: In your case not matter "best way", because too small list for feeling difference. Less few billions object in list pointless for catching performance. Yes but is one list for each player... if all use it you better find best performance. In other way already work with (Integer itemId) Edited July 6, 2019 by StinkyMadness Quote
Tryskell Posted July 6, 2019 Posted July 6, 2019 10 minutes ago, Rootware said: In your case not matter "best way", because too small list for feeling difference. Less few billions object in list pointless for catching performance. remove(Integer.valueOf( is the regular writing style, over L2J and aCis. End of story. Quote
Rootware Posted July 7, 2019 Posted July 7, 2019 (edited) 12 hours ago, StinkyMadness said: Yes but is one list for each player... if all use it you better find best performance. In other way already work with (Integer itemId) If you cares about player instance, as multiplier can change performance, then cares about cleanup any customs from any this instance. By the way, everyone player's instance it's another thread and not matter how many time will be done list's operation. In your case this difference less 0,00001 second. The general story line was in style of coding. Edited July 7, 2019 by Rootware 1 Quote
StinkyMadness Posted July 7, 2019 Author Posted July 7, 2019 1 hour ago, Rootware said: If you cares about player instance, as multiplier can change performance, then cares about cleanup any customs from any this instance. By the way, everyone player's instance it's another thread and not matter how many time will be done list's operation. In your case this difference less 0,00001 second. The general story line was in style of coding. i know player's instance its already kinda mess xD i'm just telling that there are 3 or more ways that are doing the same job.. i care to learn.. the best performance.. not only for this case... Quote
Elfo Posted July 8, 2019 Posted July 8, 2019 I always felt like things like this have more of a place in the CommunityBoard, instead of the NpcHtml. You have more space and to add more things. Also previous/next pagination can get hectic without numbered pagination so I would add that. In terms of the code the following can be optimized: npc.getDropData().forEach(c -> list.add(c)); Collections.reverse(list); You can iterate over the getDropData() enumerable in a reverse fashion in order to prevent the reverse call. You just add the objects in reverse before hand. You can move "final int ITEMS_PER_LIST = 7;" outside of the static method to prevent the allocation to the object every time the method is called. You should chain sb.append within your sb.append calls. Strings are immutable so you're allocating more memory for no reason. You can change this: if (_ignored.contains(itemId)) _ignored.remove(itemId); else _ignored.add(itemId); To this: var existed = _ignored.remove(itemId); if(!existed) _ignored.add(itemId); You also should rename the public methods "ignoredDropContain" and "ignored" in Player.java. They are really bad names and they don't imply what they do. They also don't belong in the Player class. There are other small things as well but too nit picky to mention. 1 Quote
stalker66 Posted July 11, 2019 Posted July 11, 2019 (edited) Hi, is this compatible with Interlude? Thanks! Never mind :), i successfully implemented it on my private server. The only question I have, what does the check boxes actually do? How do they work? Because i can't see any changes whatsoever. Edited July 12, 2019 by stalker66 Quote
l2destino Posted July 26, 2019 Posted July 26, 2019 Hey Sticky, it doesnt even open the panel when iam a normal player. If iam gm is opening normally. Do you know where is the problem? Quote
criss22 Posted September 11, 2019 Posted September 11, 2019 (edited) It is working. Thank you ! Update: Edited September 11, 2019 by criss22 Quote
Menadel Posted October 3, 2019 Posted October 3, 2019 Could someone help me put the images of the items in the table? I don't understand much about java and I'm still learning. Thanks Quote
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.