diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 451d893b38..0c57b34b2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ -name: OpenOSRS - CI +name: OpenOSRS - CI (PR) -on: [pull_request, push] +on: pull_request jobs: pr-lint: @@ -75,4 +75,16 @@ jobs: if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS' uses: hmarr/auto-approve-action@v2.0.0 with: - github-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + github-token: "${{ secrets.GITHUB_TOKEN }}" + + automerge: + name: Automerge + needs: approve + runs-on: ubuntu-latest + + steps: + - name: automerge + uses: pascalgn/automerge-action@f84dd310ea4a19890c70a4ff11ab282a872fb94b + env: + AUTOMERGE: "automated pull request" + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..9a5991ea50 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,58 @@ +name: OpenOSRS - CI (push) + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + name: Build + + steps: + - uses: actions/checkout@v1 + - name: Make gradlew executable + run: chmod +x ./gradlew + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Assembling + run: ./gradlew assemble --console=plain + - name: Building + run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain + + test: + runs-on: ubuntu-latest + name: Test + + steps: + - uses: actions/checkout@v1 + - name: Make gradlew executable + run: chmod +x ./gradlew + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Assembling + run: ./gradlew assemble --console=plain + - name: Testing + run: ./gradlew test --stacktrace --console=plain + + checkstyle: + name: Checkstyle + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Make gradlew executable + run: chmod +x ./gradlew + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Assembling + run: ./gradlew assemble --console=plain + - name: Checking code conventions + run: ./gradlew checkstyleMain --console=plain \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index fac83295bf..5370e9ae41 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -27,7 +27,7 @@ const val kotlinVersion = "1.3.50" object ProjectVersions { const val launcherVersion = "2.0.3" - const val rlVersion = "1.5.37-SNAPSHOT" + const val rlVersion = "1.5.38-SNAPSHOT" const val openosrsVersion = "2.1.8.0" diff --git a/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java b/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java index 13f76eab65..f29bb831b3 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java +++ b/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java @@ -24,15 +24,11 @@ */ package net.runelite.api.events; -import javax.annotation.Nullable; import lombok.Data; -import net.runelite.api.Actor; @Data public class AreaSoundEffectPlayed implements Event { - @Nullable - private final Actor source; private int soundId; private int sceneX; private int sceneY; diff --git a/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java b/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java index 628ba5b58d..fd0be1044c 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java +++ b/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java @@ -24,15 +24,11 @@ */ package net.runelite.api.events; -import javax.annotation.Nullable; import lombok.Data; -import net.runelite.api.Actor; @Data public class SoundEffectPlayed implements Event { - @Nullable - private final Actor source; private int soundId; private int delay; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/SoundEffectOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/SoundEffectOverlay.java index ea9f060ee6..e98e0ef01e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/SoundEffectOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/SoundEffectOverlay.java @@ -110,7 +110,6 @@ class SoundEffectOverlay extends Overlay String text = "Id: " + event.getSoundId() + - " - S: " + (event.getSource() != null ? event.getSource().getName() : "") + " - L: " + event.getSceneX() + "," + event.getSceneY() + " - R: " + event.getRange() + " - D: " + event.getDelay(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootRecordSortType.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootRecordSortType.java index 9d72d9e8c0..da2c0f8e34 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootRecordSortType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootRecordSortType.java @@ -30,17 +30,40 @@ public enum LootRecordSortType implements Comparator if (o1.getSubTitle().equals(LootRecordType.DEATH.name())) { return Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem -> - IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum(); + IntStream.of((int) lootTrackerItem.getGePrice() * lootTrackerItem.getQuantity())).sum(); } if (o2.getSubTitle().equals(LootRecordType.DEATH.name())) { return Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem -> - IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum(); + IntStream.of((int) lootTrackerItem.getGePrice() * lootTrackerItem.getQuantity())).sum(); } int sum = Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem -> - IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum(); + IntStream.of((int) lootTrackerItem.getGePrice() * lootTrackerItem.getQuantity())).sum(); return sum + Arrays.stream(o2.getItems()).flatMapToInt(lootTrackerItem -> - IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum(); + IntStream.of((int) lootTrackerItem.getGePrice() * lootTrackerItem.getQuantity())).sum(); + } + }, + TOTAL_HA_VALUE + { + @Override + public int compare(LootTrackerRecord o1, LootTrackerRecord o2) + { + + // We want deaths at the bottom of the list + if (o1.getSubTitle().equals(LootRecordType.DEATH.name())) + { + return Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem -> + IntStream.of((int) lootTrackerItem.getHaPrice() * lootTrackerItem.getQuantity())).sum(); + } + if (o2.getSubTitle().equals(LootRecordType.DEATH.name())) + { + return Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem -> + IntStream.of((int) lootTrackerItem.getHaPrice() * lootTrackerItem.getQuantity())).sum(); + } + int sum = Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem -> + IntStream.of((int) lootTrackerItem.getHaPrice() * lootTrackerItem.getQuantity())).sum(); + return sum + Arrays.stream(o2.getItems()).flatMapToInt(lootTrackerItem -> + IntStream.of((int) lootTrackerItem.getHaPrice() * lootTrackerItem.getQuantity())).sum(); } }, ITEM_COUNT diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java index 3fd9374b10..8a370ca3ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerBox.java @@ -72,6 +72,8 @@ class LootTrackerBox extends JPanel private final ItemManager itemManager; @Getter(AccessLevel.PACKAGE) private final String id; + private final LootTrackerPriceType priceType; + private final boolean showPriceType; @Getter(AccessLevel.PACKAGE) private final List records = new ArrayList<>(); @@ -87,6 +89,8 @@ class LootTrackerBox extends JPanel final String id, @Nullable final String subtitle, final boolean hideIgnoredItems, + final LootTrackerPriceType priceType, + final boolean showPriceType, @Nullable final Boolean showDate, final BiConsumer onItemToggle) { @@ -95,6 +99,8 @@ class LootTrackerBox extends JPanel this.itemManager = itemManager; this.onItemToggle = onItemToggle; this.hideIgnoredItems = hideIgnoredItems; + this.priceType = priceType; + this.showPriceType = showPriceType; setLayout(new BorderLayout(0, 1)); setBorder(new EmptyBorder(5, 0, 0, 0)); @@ -200,7 +206,13 @@ class LootTrackerBox extends JPanel { buildItems(); - priceLabel.setText(QuantityFormatter.quantityToStackSize(totalPrice) + " gp"); + String priceTypeString = " "; + if (showPriceType) + { + priceTypeString = priceType == LootTrackerPriceType.HIGH_ALCHEMY ? "HA: " : "GE: "; + } + + priceLabel.setText(priceTypeString + QuantityFormatter.quantityToStackSize(totalPrice) + " gp"); priceLabel.setToolTipText(QuantityFormatter.formatNumber(totalPrice) + " gp"); final long kills = getTotalKills(); @@ -280,7 +292,7 @@ class LootTrackerBox extends JPanel continue; } - totalPrice += entry.getPrice(); + totalPrice += priceType == LootTrackerPriceType.HIGH_ALCHEMY ? entry.getHaPrice() : entry.getGePrice(); int quantity = 0; for (final LootTrackerItem i : items) @@ -296,9 +308,10 @@ class LootTrackerBox extends JPanel if (quantity != 0) { int newQuantity = entry.getQuantity() + quantity; - long pricePerItem = entry.getPrice() == 0 ? 0 : (entry.getPrice() / entry.getQuantity()); + long gePricePerItem = entry.getGePrice() == 0 ? 0 : (entry.getGePrice() / entry.getQuantity()); + long haPricePerItem = entry.getHaPrice() == 0 ? 0 : (entry.getHaPrice() / entry.getQuantity()); - items.add(new LootTrackerItem(entry.getId(), entry.getName(), newQuantity, pricePerItem * newQuantity, entry.isIgnored())); + items.add(new LootTrackerItem(entry.getId(), entry.getName(), newQuantity, gePricePerItem * newQuantity, haPricePerItem * newQuantity, entry.isIgnored())); } else { @@ -306,7 +319,14 @@ class LootTrackerBox extends JPanel } } - items.sort((i1, i2) -> Long.compare(i2.getPrice(), i1.getPrice())); + if (priceType == LootTrackerPriceType.HIGH_ALCHEMY) + { + items.sort((i1, i2) -> Long.compare(i2.getHaPrice(), i1.getHaPrice())); + } + else + { + items.sort((i1, i2) -> Long.compare(i2.getGePrice(), i1.getGePrice())); + } // Calculates how many rows need to be display to fit all items final int rowSize = ((items.size() % ITEMS_PER_ROW == 0) ? 0 : 1) + items.size() / ITEMS_PER_ROW; @@ -371,8 +391,11 @@ class LootTrackerBox extends JPanel { final String name = item.getName(); final int quantity = item.getQuantity(); - final long price = item.getPrice(); + final long gePrice = item.getGePrice(); + final long haPrice = item.getHaPrice(); final String ignoredLabel = item.isIgnored() ? " - Ignored" : ""; - return name + " x " + quantity + " (" + QuantityFormatter.quantityToStackSize(price) + ") " + ignoredLabel; + return "" + name + " x " + quantity + ignoredLabel + + "
GE: " + QuantityFormatter.quantityToStackSize(gePrice) + + "
HA: " + QuantityFormatter.quantityToStackSize(haPrice) + ""; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java index 5825a227f9..5577ed3ea2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java @@ -220,4 +220,23 @@ public interface LootTrackerConfig extends Config return true; } + @ConfigItem( + keyName = "priceType", + name = "Price Type", + description = "What type of price to use for calculating value." + ) + default LootTrackerPriceType priceType() + { + return LootTrackerPriceType.GRAND_EXCHANGE; + } + + @ConfigItem( + keyName = "showPriceType", + name = "Show Price Type", + description = "Whether to show a GE: or HA: next to the total values in the tracker" + ) + default boolean showPriceType() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerItem.java index b676924c8e..3a0e53d846 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerItem.java @@ -39,7 +39,9 @@ class LootTrackerItem @Getter(AccessLevel.PACKAGE) private final int quantity; @Getter(AccessLevel.PACKAGE) - private final long price; + private final long gePrice; + @Getter + private final long haPrice; @Getter(AccessLevel.PACKAGE) @Setter(AccessLevel.PACKAGE) private boolean ignored; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java index 1b69fc4da2..3989e39b21 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java @@ -684,7 +684,7 @@ class LootTrackerPanel extends PluginPanel // Create box final LootTrackerBox box = new LootTrackerBox(record.getTimestamp().toEpochMilli(), itemManager, record.getTitle(), record.getSubTitle(), - hideIgnoredItems, config.displayDate(), plugin::toggleItem); + hideIgnoredItems, config.priceType(), config.showPriceType(), config.displayDate(), plugin::toggleItem); box.combine(record); // Create popup menu @@ -780,7 +780,8 @@ class LootTrackerPanel extends PluginPanel private void updateOverall() { long overallKills = 0; - long overallGp = 0; + long overallGe = 0; + long overallHa = 0; for (LootTrackerRecord record : records) { @@ -824,7 +825,8 @@ class LootTrackerPanel extends PluginPanel continue; } - overallGp += item.getPrice(); + overallGe += item.getGePrice(); + overallHa += item.getHaPrice(); } if (present > 0) @@ -833,8 +835,16 @@ class LootTrackerPanel extends PluginPanel } } + String priceType = ""; + if (config.showPriceType()) + { + priceType = config.priceType() == LootTrackerPriceType.HIGH_ALCHEMY ? "HA " : "GE "; + } + overallKillsLabel.setText(htmlLabel("Total count: ", overallKills)); - overallGpLabel.setText(htmlLabel("Total value: ", overallGp)); + overallGpLabel.setText(htmlLabel("Total " + priceType + "value: ", config.priceType() == LootTrackerPriceType.HIGH_ALCHEMY ? overallHa : overallGe)); + overallGpLabel.setToolTipText("Total GE price: " + QuantityFormatter.formatNumber(overallGe) + + "
Total HA price: " + QuantityFormatter.formatNumber(overallHa) + ""); updateCollapseText(); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 04e766674f..6da1f94b35 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -66,6 +66,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; +import net.runelite.api.Constants; import net.runelite.api.GameState; import net.runelite.api.InventoryID; import net.runelite.api.Item; @@ -1213,15 +1214,18 @@ public class LootTrackerPlugin extends Plugin { final ItemDefinition itemDefinition = itemManager.getItemDefinition(itemId); final int realItemId = itemDefinition.getNote() != -1 ? itemDefinition.getLinkedNoteId() : itemId; - final long price; + final long gePrice ; + final long haPrice ; // If it's a death we want to get a coin value for untradeables lost if (!itemDefinition.isTradeable() && quantity < 0) { - price = (long) itemDefinition.getPrice() * (long) quantity; + gePrice = (long) itemDefinition.getPrice() * (long) quantity; + haPrice = (long) Math.round(itemDefinition.getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER) * (long) quantity; } else { - price = (long) itemManager.getItemPrice(realItemId) * (long) quantity; + gePrice = (long) itemManager.getItemPrice(realItemId) * (long) quantity; + haPrice = (long) Math.round(itemManager.getItemPrice(realItemId) * Constants.HIGH_ALCHEMY_MULTIPLIER) * (long) quantity; } final boolean ignored = ignoredItems.contains(itemDefinition.getName()); @@ -1229,7 +1233,8 @@ public class LootTrackerPlugin extends Plugin itemId, itemDefinition.getName(), quantity, - price, + gePrice, + haPrice, ignored); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPriceType.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPriceType.java new file mode 100644 index 0000000000..c83c8c0c07 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPriceType.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019 Hydrox6 + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.loottracker; + +public enum LootTrackerPriceType +{ + GRAND_EXCHANGE, + HIGH_ALCHEMY +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java index 94f30fd07c..33f3623fe5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java @@ -31,16 +31,6 @@ import net.runelite.client.config.ConfigItem; @ConfigGroup("music") public interface MusicConfig extends Config { - @ConfigItem( - keyName = "muteOtherAreaSounds", - name = "Mute others' area sounds", - description = "Mute area sounds caused from other players" - ) - default boolean muteOtherAreaSounds() - { - return false; - } - @ConfigItem( keyName = "musicVolume", name = "", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 5c1b2d5b87..b21e29bfd6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -37,16 +37,13 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.GameState; -import net.runelite.api.Player; import net.runelite.api.ScriptID; import net.runelite.api.SoundEffectID; import net.runelite.api.SpriteID; import net.runelite.api.VarClientInt; import net.runelite.api.VarPlayer; -import net.runelite.api.events.AreaSoundEffectPlayed; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.ScriptCallbackEvent; @@ -139,7 +136,6 @@ public class MusicPlugin extends Plugin eventBus.subscribe(VarClientIntChanged.class, this, this::onVarClientIntChanged); eventBus.subscribe(VolumeChanged.class, this, this::onVolumeChanged); eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent); - eventBus.subscribe(AreaSoundEffectPlayed.class, this, this::onAreaSoundEffectPlayed); } private void onGameStateChanged(GameStateChanged gameStateChanged) @@ -562,15 +558,4 @@ public class MusicPlugin extends Plugin client.getIntStack()[client.getIntStackSize() - 1] = -1; } } - - private void onAreaSoundEffectPlayed(AreaSoundEffectPlayed areaSoundEffectPlayed) - { - Actor source = areaSoundEffectPlayed.getSource(); - if (source != client.getLocalPlayer() - && source instanceof Player - && musicConfig.muteOtherAreaSounds()) - { - areaSoundEffectPlayed.consume(); - } - } } \ No newline at end of file diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/SoundEffectMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/SoundEffectMixin.java index 827b67e537..6181dd87f4 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/SoundEffectMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/SoundEffectMixin.java @@ -31,11 +31,11 @@ import net.runelite.api.mixins.FieldHook; import net.runelite.api.mixins.Inject; import net.runelite.api.mixins.Mixin; import net.runelite.api.mixins.Shadow; -import net.runelite.rs.api.RSRawPcmStream; import net.runelite.rs.api.RSClient; +import net.runelite.rs.api.RSPcmStream; +import net.runelite.rs.api.RSRawPcmStream; import net.runelite.rs.api.RSRawSound; import net.runelite.rs.api.RSSoundEffect; -import net.runelite.rs.api.RSPcmStream; @Mixin(RSClient.class) public abstract class SoundEffectMixin implements RSClient @@ -120,7 +120,7 @@ public abstract class SoundEffectMixin implements RSClient { // Regular sound effect - SoundEffectPlayed event = new SoundEffectPlayed(null); + SoundEffectPlayed event = new SoundEffectPlayed(); event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]); event.setDelay(client.getQueuedSoundEffectDelays()[soundIndex]); client.getCallbacks().post(SoundEffectPlayed.class, event); @@ -133,7 +133,7 @@ public abstract class SoundEffectMixin implements RSClient int y = (packedLocation >> 8) & 0xFF; int range = (packedLocation) & 0xFF; - AreaSoundEffectPlayed event = new AreaSoundEffectPlayed(null); + AreaSoundEffectPlayed event = new AreaSoundEffectPlayed(); event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]); event.setSceneX(x); event.setSceneY(y);