Skip to content

Commit 5645765

Browse files
author
unknown
committed
v1.13.0
1 parent 9655a53 commit 5645765

16 files changed

Lines changed: 720 additions & 71 deletions

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ A plugin which allows you to customize XP drops in more ways than the default OS
1414
- Customize which skills to filter from showing XP drops at all.
1515
- Attach XP drop location to in game player model.
1616
- Add a custom prefix and suffix to the XP drop text.
17-
- Show predicted damage from XP drop.
17+
- Show predicted damage from XP drop.
1818
- Replace the XP tracker widget with a minimalistic one.
1919
- Export your plugin settings to share with a friend by right-clicking the xp orb in-game.
20+
- Show predicted hits with vanilla XP drops. `Use Customizable XP drops` off and `Show prdicted hit` on.
21+
- Show predicted hits from party members.
2022

2123
#### Change log
24+
- v1.13.0 - Show XP drops/predicted hits from party members.
2225
- v1.12.1 - Fix regression for a combination of settings, added special attack to predicted hit message, added predicted hit message to party.
2326
- v1.12.0 - Add plugin message for predicted hit.
2427
- v1.11.0 - Add `Use Customizable XP drops` setting. It's on by default. If off the xp tracker and predicted hits can still function.
@@ -113,7 +116,7 @@ Round of experience gained happens on the server before it is sent to the client
113116
Furthermore, some monsters in OSRS give bonus experience in the form of a multiplier over the experience gained.
114117
This plugin tries to use the same multipliers per monster but the list is incomplete leading to incorrect predicted hits.
115118

116-
#### Predicted hits plugin/party message
119+
#### Predicted hits plugin message
117120
This plugin emits a message over the event bus when a hit is predicted. Under namespace `customizable-xp-drops` and name `predicted-hit`.
118121
The data field of this message is a map with a key `value` in which a JSON string is stored which contains all the information about the predicted hit.
119122
Copy over [PredictedHit.java](src/main/java/com/xpdrops/predictedhit/PredictedHit.java) to your own plugin and use this to deserialize the JSON string under the aforementioned `value` key in the data map.\
@@ -131,19 +134,6 @@ protected void onPluginMessage(PluginMessage pluginMessage)
131134
}
132135
}
133136
```
134-
When `Send predicted hits over party` under `Miscellaneous` is turned on the plugin also sends this message over the party service.
135-
Copy over [PredictedHit.java](src/main/java/com/xpdrops/predictedhit/PredictedHit.java) and [PredictedHitPartyMessage.java](src/main/java/com/xpdrops/predictedhit/PredictedHitPartyMessage.java) to your plugin and register the message with
136-
```java
137-
wsClient.registerMessage(PredictedHitPartyMessage.class);
138-
```
139-
Example for listening to the party message
140-
```java
141-
@Subscribe
142-
protected void onPredictedHitPartyMessage(PredictedHitPartyMessage partyMessage)
143-
{
144-
log.debug("Hit {} special attack {}", partyMessage.getPredictedHit().getHit(), partyMessage.getPredictedHit().isSpecialAttack());
145-
}
146-
```
147137

148138
#### XP drops are delayed
149139
Try increasing the `Vertical XP drop speed` and/or lowering the `XP drop delay` settings.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
}
3434

3535
group = 'com.xpdrops'
36-
version = '1.12.1'
36+
version = '1.13.0'
3737
sourceCompatibility = '1.8'
3838

3939
tasks.withType(JavaCompile).configureEach {

src/main/java/com/xpdrops/CustomizableXpDropsPlugin.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import com.xpdrops.overlay.XpDropOverlayManager;
1111
import com.xpdrops.predictedhit.Hit;
1212
import com.xpdrops.predictedhit.PredictedHit;
13-
import com.xpdrops.predictedhit.PredictedHitPartyMessage;
13+
import com.xpdrops.predictedhit.party.PredictedHitPartyManager;
1414
import com.xpdrops.predictedhit.XpDropDamageCalculator;
1515
import com.xpdrops.predictedhit.npcswithscalingbonus.ChambersLayoutSolver;
1616
import lombok.Getter;
@@ -45,11 +45,10 @@
4545
import net.runelite.client.events.ConfigChanged;
4646
import net.runelite.client.events.PluginMessage;
4747
import net.runelite.client.game.ItemVariationMapping;
48-
import net.runelite.client.party.PartyService;
49-
import net.runelite.client.party.WSClient;
5048
import net.runelite.client.plugins.Plugin;
5149
import net.runelite.client.plugins.PluginDependency;
5250
import net.runelite.client.plugins.PluginDescriptor;
51+
import net.runelite.client.plugins.party.PartyPlugin;
5352
import net.runelite.client.plugins.xptracker.XpTrackerPlugin;
5453
import net.runelite.client.util.Text;
5554

@@ -65,8 +64,11 @@
6564

6665
import static net.runelite.api.ScriptID.XPDROPS_SETDROPSIZE;
6766

67+
// Depends on XpTrackerPlugin for custom xp tracker
6868
@PluginDependency(XpTrackerPlugin.class)
69-
// Plugin class and xp drop manager
69+
// Depends on PartyPlugin for PartyConfig
70+
@PluginDependency(PartyPlugin.class)
71+
// Plugin class
7072
@PluginDescriptor(
7173
name = "Customizable XP drops",
7274
description = "Allows one to use fully customizable xp drops independent of the in-game ones"
@@ -112,10 +114,7 @@ public class CustomizableXpDropsPlugin extends Plugin
112114
private Gson gson;
113115

114116
@Inject
115-
private PartyService partyService;
116-
117-
@Inject
118-
private WSClient wsClient;
117+
private PredictedHitPartyManager predictedHitPartyManager;
119118

120119
@Provides
121120
XpDropsConfig provideConfig(ConfigManager configManager)
@@ -207,7 +206,7 @@ protected void startUp()
207206

208207
importExport.addImportExportMenuOptions();
209208

210-
wsClient.registerMessage(PredictedHitPartyMessage.class);
209+
predictedHitPartyManager.startUp();
211210

212211
long totalTime = System.currentTimeMillis() - time;
213212
log.debug("Plugin took {}ms to start.", totalTime);
@@ -248,9 +247,9 @@ else if ((attackStyle == AttackStyle.CASTING) && (castingMode == 1))
248247
protected void shutDown()
249248
{
250249
xpDropOverlayManager.shutdown();
251-
setXpTrackerHidden(false); // should be according to varbit?
250+
setXpTrackerHidden(false);
252251
importExport.removeMenuOptions();
253-
wsClient.unregisterMessage(PredictedHitPartyMessage.class);
252+
predictedHitPartyManager.shutDown();
254253
}
255254

256255
protected void setXpTrackerHidden(boolean hidden)
@@ -505,6 +504,7 @@ protected void onStatChanged(StatChanged event)
505504
protected void onBeforeRender(BeforeRender beforeRender)
506505
{
507506
xpDropOverlayManager.update();
507+
predictedHitPartyManager.update();
508508
}
509509

510510
@Subscribe
@@ -623,10 +623,6 @@ private void postPredictedHit(PredictedHit hit)
623623
HashMap<String, Object> data = new HashMap<>();
624624
data.put("value", gson.toJson(hit));
625625
eventBus.post(new PluginMessage(namespace, name, data));
626-
627-
if (config.predictedHitOverParty() && partyService.isInParty())
628-
{
629-
partyService.send(new PredictedHitPartyMessage(hit));
630-
}
626+
predictedHitPartyManager.postPredictedHit(hit);
631627
}
632628
}

0 commit comments

Comments
 (0)