Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
mavenCentral()
}

def runeLiteVersion = '1.10.8.3'
def runeLiteVersion = 'latest.release'

dependencies {
compileOnly group: 'net.runelite', name:'client', version: runeLiteVersion
Expand All @@ -26,7 +26,7 @@ dependencies {
}

group = 'io.hydrox.cratelimit'
version = '1.2'
version = '1.2.1'
sourceCompatibility = '1.8'

tasks.withType(JavaCompile) {
Expand Down
2 changes: 1 addition & 1 deletion runelite-plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ displayName=Crate Limiter
author=Enriath
support=https://github.com/Enriath/external-plugins/tree/crate-limiter
description=Slows down the opening of crates and jars
tags=crate,jar,eclectic,medium,mediums,rangers,ranger,clue,clues,open,loot
tags=crate,jar,eclectic,medium,mediums,rangers,ranger,clue,clues,open,loot,nest
plugins=io.hydrox.cratelimit.CrateLimiterPlugin
59 changes: 30 additions & 29 deletions src/main/java/io/hydrox/cratelimit/CrateLimiterPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.ItemComposition;
import net.runelite.api.ItemID;
import net.runelite.api.MenuAction;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.gameval.ItemID;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.chat.QueuedMessage;
import net.runelite.client.config.ConfigManager;
Expand All @@ -44,41 +44,42 @@
@PluginDescriptor(
name = "Crate Limiter",
description = "Slows down the opening of crates and jars",
tags = {"crate", "jar", "eclectic", "medium", "mediums", "rangers", "ranger", "clue", "clues", "open", "loot"}
tags = {"crate", "jar", "eclectic", "medium", "mediums", "rangers", "ranger", "clue", "clues", "open", "loot", "nest"}
)
public class CrateLimiterPlugin extends Plugin
{
// These items have an Open option, but shouldn't have a speed limit
private static final Set<Integer> OPEN_EXCEPTIONS = ImmutableSet.of(
ItemID.LOOTING_BAG,
ItemID.HERB_SACK,
ItemID.SLAYER_HERB_SACK,
ItemID.SEED_BOX,
ItemID.BOLT_POUCH,
ItemID.XBOWS_BOLT_POUCH,
ItemID.COAL_BAG,
ItemID.GEM_BAG,
ItemID.HUNTER_KIT,
ItemID.RUNE_POUCH,
ItemID.RUNE_POUCH_L,
ItemID.MASTER_SCROLL_BOOK,
ItemID.MASTER_SCROLL_BOOK_EMPTY
ItemID.DREAM_HUNTER_BOX,
ItemID.BH_RUNE_POUCH,
ItemID.BH_RUNE_POUCH_TROUVER,
ItemID.BOOKOFSCROLLS_CHARGED,
ItemID.BOOKOFSCROLLS_EMPTY
);

private static final Set<Integer> BIRD_NESTS = ImmutableSet.of(
// Eggs
ItemID.BIRD_NEST,
ItemID.BIRD_NEST_5071,
ItemID.BIRD_NEST_5072,
// Old seed nest
ItemID.BIRD_NEST_5073,
// Rings
ItemID.BIRD_NEST_5074,
// Old Wyson seed nest
ItemID.BIRD_NEST_7413,
// Slightly less old Wyson seed nest
ItemID.BIRD_NEST_13653,
// Modern seed nests
ItemID.BIRD_NEST_22798,
ItemID.BIRD_NEST_22800
// Bird nests with god eggs
ItemID.BIRD_NEST_EGG_RED,
ItemID.BIRD_NEST_EGG_GREEN,
ItemID.BIRD_NEST_EGG_BLUE,
// Old bird nest with seeds (Before farming guild update, still able to be found within banks/inv)
ItemID.BIRD_NEST_SEEDS,
// Bird nests with rings
ItemID.BIRD_NEST_RING,
// Old bird nests with seeds from Wyson (Before buff on 18 Feb 2016, still able to be found within banks/inv)
ItemID.BIRD_NEST_CHEAPSEEDS,
// Slightly less old bird nests with seeds from Wyson (After buff but before farming guild update, still able to be found within banks/inv)
ItemID.BIRD_NEST_DECENTSEEDS,
// Current bird nest with seeds
ItemID.BIRD_NEST_SEEDS_JAN2019,
// Current bird nest with seeds from Wyson
ItemID.BIRD_NEST_DECENTSEEDS_JAN2019
);

@Inject
Expand All @@ -101,33 +102,33 @@ CrateLimiterConfig getConfig(ConfigManager configManager)
@Subscribe
void onMenuOptionClicked(MenuOptionClicked event)
{
if (event.getMenuAction() != MenuAction.CC_OP)
if (event.getMenuAction() != MenuAction.CC_OP && !event.isItemOp())
{
return;
}
// Seed Pack
if (event.getMenuOption().equals("Take"))
{
if (event.getId() != ItemID.SEED_PACK)
if (event.getItemId() != ItemID.SEEDBOX)
{
return;
}
}
// Nests
else if (event.getMenuOption().equals("Search"))
{
if (!BIRD_NESTS.contains(event.getId()))
if (!BIRD_NESTS.contains(event.getItemId()))
{
return;
}
}
else if (event.getMenuOption().equals("Open"))
{
if (OPEN_EXCEPTIONS.contains(event.getId()))
if (OPEN_EXCEPTIONS.contains(event.getItemId()))
{
return;
}
ItemComposition comp = client.getItemDefinition(event.getId());
ItemComposition comp = client.getItemDefinition(event.getItemId());
// Bundle packs
if (comp.getName().endsWith(" pack"))
{
Expand Down