Jump to content

Recommended Posts

Posted (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 by StinkyMadness
Posted
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.

Posted
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.

Posted (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 by StinkyMadness
Posted
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.

Posted (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. :aproove-smile:

Edited by Rootware
  • Thanks 1
Posted
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. :aproove-smile:


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...

Posted

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.

  • Upvote 1
Posted (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 by stalker66
  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • 🌍 https://l2origins.org/ 🛡️ LINEAGE II ORIGINS — SEASON 1 🛡️ 🌑 High Five Classic | True Old-School Experience 🌑 ⚠️ Opening on March 6th at 16:00 Welcome back to the origins of Lineage II. ⚔️ ABOUT THE SERVER Lineage2 Origins is built for players who miss the true retail feeling. Classic progression, real challenges, fair competition — enhanced only with carefully selected QoL features, never breaking the original gameplay. 🌿 PHASED GEAR PROGRESSION 🟢 Month 1: Vesper max 🟢 Month 2: Vorpal unlocked 🟢 Month 3+: Top-grade & Elegia released 🚫 NO AUTO-FARM ✔️ External auto-clicker allowed (1 per client, download page only) ❌ Bots & illegal automation forbidden 🛡️ Strong anti-bot + captcha system ⚠️ AFK players will be punished — stay active or logout 📊 RATES & CORE SETTINGS 🔹 Adena: x5 🔹 Drop / Spoil: x5 🔹 Skill EXP: x15 🔹 Max Windows: 2 per PC 🔹 Subclass: Lv 85 (no quest required) 🔹 Party Level Diff: 30 (55–85) 🔹 No custom items (armors / weapons / jewelry) 🔥 FEATURES ✨ Global & Raid Teleport ✨ NPC Buffer (34 buffs) ✨ Auto Events & PvP Zones ✨ Ranking & Clan Progression ✨ GM Shop & Premium System ✨ All-In-One Community Board ✨ Party & Solo Instances ✨ Siege & Territory War Rewards ✨ RaidBoss Kill Rewards ✨ Lucky Creature Event ✨ Daily Login Rewards ✨ Advanced DDoS Protection & Backups ⚔️ ENCHANTMENTS 🔸 Safe: +3 🔸 Max: +12 (Month 2: +14 | Month 3: +16) 🔸 Blessed: 50% (Premium 65%) 🔸 Normal: 45% (Premium 60%) 🏟️ OLYMPIAD 🔹 Max Enchant: +6 🔹 Start Players: 4 🔹 Period: 1st & 15th 🏰 SIEGE & TW 🔹 Siege Time: 16:00 & 20:00 🔹 Territory War: 20:00 🔹 Max Wards: 3 per Castle 🌌 Lineage2 Origins Fair. Competitive. Nostalgic. A true return to the origins of Lineage II.
    • Bastante confiable, ya trabaje en varios proyectos con el y la verdad te da confianza que hoy en dia poca gente hay asi lo  recomiendo 100%  Gracias por todo amigo ! seguiremos trabajando juntos segurisimamente! 
    • Arcana Mace Acumen +6 : 200 Euro    Leave a message here or better on Discord : grandmaster1991   Discord : GrandMaster#1689  
    • overbooked till 3 of march!! Not accepting more works for now, everything after 3 of match!
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..