Create nex-droprate-calculator
This plugin monitors the players contribution to Nex fights and continuously calculates the roll for a unique drop.
New plugin nex-droprate-calculator: https://github.com/Worley03/nex-droprate-calculator/tree/eeed6eff6cd667465c00bd7931c4df60186bf160
NexDroprateCalculatorPanel is really annoying to review, you should use variables instead of casting repeatedly:
- runPanel.add(new JLabel(labelTitle("- Current Kill -")));
- ((JLabel) runPanel.getComponent(0)).setFont(font);
+ JLabel currentKillHeader = new JLabel("- Current Kill -");
+ currentKillHeader.setFont(font);
+ runPanel.add(currentKillHeader);
No more repeat casting. Sorry I should of revised that section!
- onConfigChanged is fired to all plugins for all other plugins' config changes as well. Check for the config group to match your own as the first thing in this method https://github.com/Worley03/nex-droprate-calculator/blob/284f36eb6fdbf64bf9ad02b4f1d7547421247cc8/src/main/java/com/nexdropratecalculator/NexDroprateCalculatorPlugin.java#L74
- add the config once at plugin startup rather than on every game tick https://github.com/Worley03/nex-droprate-calculator/blob/284f36eb6fdbf64bf9ad02b4f1d7547421247cc8/src/main/java/com/nexdropratecalculator/NexDroprateCalculatorPlugin.java#L86-L89
- You can use onNpcSpawned to detect Nex, then
Merging, but you should consider replacing all your getComponent calls with just persisting the components in fields.