Merge branch 'master' of https://github.com/runelite-extended/runelite
This commit is contained in:
@@ -83,7 +83,7 @@ import org.slf4j.LoggerFactory;
|
||||
@Slf4j
|
||||
public class RuneLite
|
||||
{
|
||||
public static final String RUNELIT_VERSION = "0.1.2";
|
||||
public static final String RUNELIT_VERSION = "2.0.0";
|
||||
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
||||
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
|
||||
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
|
||||
@@ -243,7 +243,7 @@ public class RuneLite
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
final boolean developerMode = true;
|
||||
final boolean developerMode = options.has("developer-mode");
|
||||
|
||||
if (developerMode)
|
||||
{
|
||||
@@ -290,7 +290,7 @@ public class RuneLite
|
||||
|
||||
injector = Guice.createInjector(new RuneLiteModule(
|
||||
options.valueOf(updateMode),
|
||||
developerMode));
|
||||
true));
|
||||
|
||||
injector.getInstance(RuneLite.class).start();
|
||||
splashScreen.setProgress(1, 5);
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SessionManager
|
||||
|
||||
// Check if session is still valid
|
||||
AccountClient accountClient = new AccountClient(session.getUuid());
|
||||
if (!accountClient.sesssionCheck())
|
||||
if (!accountClient.sessionCheck())
|
||||
{
|
||||
log.debug("Loaded session {} is invalid", session.getUuid());
|
||||
return;
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Multimap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -93,6 +92,7 @@ public class MenuManager
|
||||
|
||||
private final Set<ComparableEntry> priorityEntries = new HashSet<>();
|
||||
private final Set<MenuEntry> currentPriorityEntries = new HashSet<>();
|
||||
private final Set<ComparableEntry> hiddenEntries = new HashSet<>();
|
||||
|
||||
private final Map<ComparableEntry, ComparableEntry> swaps = new HashMap<>();
|
||||
private final Set<MenuEntry> originalTypes = new HashSet<>();
|
||||
@@ -192,7 +192,7 @@ public class MenuManager
|
||||
}
|
||||
|
||||
// Make a copy of the menu entries, cause you can't remove from Arrays.asList()
|
||||
List<MenuEntry> copy = new ArrayList<>(Arrays.asList(menuEntries));
|
||||
List<MenuEntry> copy = Lists.newArrayList(menuEntries);
|
||||
|
||||
// If there are entries we want to prioritize, we have to remove the rest
|
||||
if (!currentPriorityEntries.isEmpty())
|
||||
@@ -253,6 +253,21 @@ public class MenuManager
|
||||
}
|
||||
}
|
||||
|
||||
boolean isHidden = false;
|
||||
for (ComparableEntry p : hiddenEntries)
|
||||
{
|
||||
if (p.matches(newestEntry))
|
||||
{
|
||||
isHidden = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isHidden)
|
||||
{
|
||||
copy.remove(newestEntry);
|
||||
}
|
||||
|
||||
client.setMenuEntries(copy.toArray(new MenuEntry[0]));
|
||||
}
|
||||
|
||||
@@ -599,19 +614,7 @@ public class MenuManager
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, target);
|
||||
|
||||
Set<ComparableEntry> toRemove = new HashSet<>();
|
||||
for (ComparableEntry priorityEntry : priorityEntries)
|
||||
{
|
||||
if (entry.equals(priorityEntry))
|
||||
{
|
||||
toRemove.add(entry);
|
||||
}
|
||||
}
|
||||
|
||||
for (ComparableEntry e : toRemove)
|
||||
{
|
||||
priorityEntries.remove(e);
|
||||
}
|
||||
priorityEntries.removeIf(entry::equals);
|
||||
}
|
||||
|
||||
|
||||
@@ -634,19 +637,7 @@ public class MenuManager
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, "", false);
|
||||
|
||||
Set<ComparableEntry> toRemove = new HashSet<>();
|
||||
for (ComparableEntry priorityEntry : priorityEntries)
|
||||
{
|
||||
if (entry.equals(priorityEntry))
|
||||
{
|
||||
toRemove.add(entry);
|
||||
}
|
||||
}
|
||||
|
||||
for (ComparableEntry e : toRemove)
|
||||
{
|
||||
priorityEntries.remove(e);
|
||||
}
|
||||
priorityEntries.removeIf(entry::equals);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -757,36 +748,12 @@ public class MenuManager
|
||||
ComparableEntry swapFrom = new ComparableEntry(option, target, id, type, false, false);
|
||||
ComparableEntry swapTo = new ComparableEntry(option2, target2, id2, type2, false, false);
|
||||
|
||||
Set<ComparableEntry> toRemove = new HashSet<>();
|
||||
for (Map.Entry<ComparableEntry, ComparableEntry> e : swaps.entrySet())
|
||||
{
|
||||
if (e.getKey().equals(swapFrom) && e.getValue().equals(swapTo))
|
||||
{
|
||||
toRemove.add(e.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
for (ComparableEntry entry : toRemove)
|
||||
{
|
||||
swaps.remove(entry);
|
||||
}
|
||||
swaps.entrySet().removeIf(e -> e.getKey().equals(swapFrom) && e.getValue().equals(swapTo));
|
||||
}
|
||||
|
||||
public void removeSwap(ComparableEntry swapFrom, ComparableEntry swapTo)
|
||||
{
|
||||
Set<ComparableEntry> toRemove = new HashSet<>();
|
||||
for (Map.Entry<ComparableEntry, ComparableEntry> e : swaps.entrySet())
|
||||
{
|
||||
if (e.getKey().equals(swapFrom) && e.getValue().equals(swapTo))
|
||||
{
|
||||
toRemove.add(e.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
for (ComparableEntry entry : toRemove)
|
||||
{
|
||||
swaps.remove(entry);
|
||||
}
|
||||
swaps.entrySet().removeIf(e -> e.getKey().equals(swapFrom) && e.getValue().equals(swapTo));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -794,21 +761,89 @@ public class MenuManager
|
||||
*/
|
||||
public void removeSwaps(String withTarget)
|
||||
{
|
||||
withTarget = Text.standardize(withTarget);
|
||||
final String target = Text.standardize(withTarget);
|
||||
|
||||
Set<ComparableEntry> toRemove = new HashSet<>();
|
||||
swaps.keySet().removeIf(e -> e.getTarget().equals(target));
|
||||
}
|
||||
|
||||
for (ComparableEntry e : swaps.keySet())
|
||||
{
|
||||
if (e.getTarget().equals(withTarget))
|
||||
{
|
||||
toRemove.add(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Adds to the set of menu entries which when present, will be hidden from the menu
|
||||
*/
|
||||
public void addHiddenEntry(String option, String target)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
target = Text.standardize(target);
|
||||
|
||||
for (ComparableEntry entry : toRemove)
|
||||
{
|
||||
swaps.remove(entry);
|
||||
}
|
||||
ComparableEntry entry = new ComparableEntry(option, target);
|
||||
|
||||
hiddenEntries.add(entry);
|
||||
}
|
||||
|
||||
public void removeHiddenEntry(String option, String target)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
target = Text.standardize(target);
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, target);
|
||||
|
||||
hiddenEntries.removeIf(entry::equals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds to the set of menu entries which when present, will be hidden from the menu
|
||||
* This method will add one with strict option, but not-strict target (contains for target, equals for option)
|
||||
*/
|
||||
public void addHiddenEntry(String option)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, "", false);
|
||||
|
||||
hiddenEntries.add(entry);
|
||||
}
|
||||
|
||||
public void removeHiddenEntry(String option)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, "", false);
|
||||
|
||||
hiddenEntries.removeIf(entry::equals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds to the set of hidden entries.
|
||||
*/
|
||||
public void addHiddenEntry(String option, String target, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
target = Text.standardize(target);
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, target, -1, -1, strictOption, strictTarget);
|
||||
|
||||
hiddenEntries.add(entry);
|
||||
}
|
||||
|
||||
public void removeHiddenEntry(String option, String target, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
target = Text.standardize(target);
|
||||
|
||||
ComparableEntry entry = new ComparableEntry(option, target, -1, -1, strictOption, strictTarget);
|
||||
|
||||
hiddenEntries.remove(entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds to the set of hidden entries - Pre-baked Abstract entry
|
||||
*/
|
||||
public void addHiddenEntry(ComparableEntry entry)
|
||||
{
|
||||
hiddenEntries.add(entry);
|
||||
}
|
||||
|
||||
public void removeHiddenEntry(ComparableEntry entry)
|
||||
{
|
||||
hiddenEntries.remove(entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,12 @@ public enum AoeProjectileInfo
|
||||
LIZARDMAN_SHAMAN_AOE(ProjectileID.LIZARDMAN_SHAMAN_AOE, 5),
|
||||
CRAZY_ARCHAEOLOGIST_AOE(ProjectileID.CRAZY_ARCHAEOLOGIST_AOE, 3),
|
||||
ICE_DEMON_RANGED_AOE(ProjectileID.ICE_DEMON_RANGED_AOE, 3),
|
||||
|
||||
/**
|
||||
* When you don't have pray range on ice demon does an ice barrage
|
||||
*/
|
||||
ICE_DEMON_ICE_BARRAGE_AOE(ProjectileID.ICE_DEMON_ICE_BARRAGE_AOE, 3),
|
||||
|
||||
/**
|
||||
* The AOE when vasa first starts
|
||||
*/
|
||||
@@ -61,7 +63,10 @@ public enum AoeProjectileInfo
|
||||
*/
|
||||
GALVEK_MINE(ProjectileID.GALVEK_MINE, 3),
|
||||
GALVEK_BOMB(ProjectileID.GALVEK_BOMB, 3),
|
||||
|
||||
|
||||
/**
|
||||
* the AOEs of Grotesque Guardians
|
||||
*/
|
||||
DAWN_FREEZE(ProjectileID.DAWN_FREEZE, 3),
|
||||
DUSK_CEILING(ProjectileID.DUSK_CEILING, 3),
|
||||
|
||||
@@ -78,7 +83,6 @@ public enum AoeProjectileInfo
|
||||
/**
|
||||
* the AOE of the Corporeal Beast
|
||||
*/
|
||||
|
||||
CORPOREAL_BEAST(ProjectileID.CORPOREAL_BEAST_AOE, 1),
|
||||
CORPOREAL_BEAST_DARK_CORE(ProjectileID.CORPOREAL_BEAST_DARK_CORE_AOE, 3),
|
||||
|
||||
@@ -114,7 +118,12 @@ public enum AoeProjectileInfo
|
||||
/**
|
||||
* Cerbs fire
|
||||
*/
|
||||
CERB_FIRE(ProjectileID.CERB_FIRE, 2);
|
||||
CERB_FIRE(ProjectileID.CERB_FIRE, 2),
|
||||
|
||||
/**
|
||||
* Demonic gorilla
|
||||
*/
|
||||
DEMONIC_GORILLA_BOULDER(ProjectileID.DEMONIC_GORILLA_BOULDER, 1);
|
||||
|
||||
private static final Map<Integer, AoeProjectileInfo> map = new HashMap<>();
|
||||
|
||||
|
||||
@@ -818,4 +818,41 @@ public interface AoeWarningConfig extends Config
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "demonicGorillaStub",
|
||||
name = "Demonic Gorilla",
|
||||
description = "",
|
||||
position = 64,
|
||||
parent = "npcStub"
|
||||
)
|
||||
default Stub demonicGorillaStub()
|
||||
{
|
||||
return new Stub();
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "demonicGorilla",
|
||||
name = "Demonic Gorilla",
|
||||
description = "Configures if Demonic Gorilla boulder tile markers are displayed",
|
||||
parent = "demonicGorillaStub",
|
||||
position = 65
|
||||
)
|
||||
default boolean isDemonicGorillaEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "demonicGorillaNotify",
|
||||
name = "Demonic Gorilla Notify",
|
||||
description = "Configures whether or not AoE Projectile Warnings for Demonic Gorilla boulders should trigger a notification",
|
||||
parent = "demonicGorillaStub",
|
||||
position = 66,
|
||||
hide = "aoeNotifyAll"
|
||||
)
|
||||
default boolean isDemonicGorillaNotifyEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -330,6 +330,8 @@ public class AoeWarningPlugin extends Plugin
|
||||
return notify ? config.isDrakeNotifyEnabled() : config.isDrakeEnabled();
|
||||
case CERB_FIRE:
|
||||
return notify ? config.isCerbFireNotifyEnabled() : config.isCerbFireEnabled();
|
||||
case DEMONIC_GORILLA_BOULDER:
|
||||
return notify ? config.isDemonicGorillaNotifyEnabled() : config.isDemonicGorillaEnabled();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
|
||||
new AnagramClue("HE DO POSE. IT IS CULTRRL, MK?", "Riki the sculptor's model", new WorldPoint(2904, 10206, 0), "East Keldagrim, south of kebab seller."),
|
||||
new AnagramClue("HEORIC", "Eohric", new WorldPoint(2900, 3565, 0), "Top floor of Burthorpe Castle", "36"),
|
||||
new AnagramClue("HIS PHOR", "Horphis", new WorldPoint(1639, 3812, 0), "Arceuus Library, Zeah", "1"),
|
||||
new AnagramClue("I AM SIR", "Marisi", new WorldPoint(1813, 3488, 0), "Allotment patch, South coast Zeah", "5"),
|
||||
new AnagramClue("I AM SIR", "Marisi", new WorldPoint(1737, 3557, 0), "Allotment patch, South of Hosidius chapel", "5"),
|
||||
new AnagramClue("ICY FE", "Fycie", new WorldPoint(2630, 2997, 0), "East Feldip Hills"),
|
||||
new AnagramClue("I DOOM ICON INN", "Dominic Onion", new WorldPoint(2609, 3116, 0), "Nightmare Zone", "9,500"),
|
||||
new AnagramClue("I EAT ITS CHART HINTS DO U", "Shiratti the Custodian", new WorldPoint(3427, 2927, 0), "North of fountain, Nardah"),
|
||||
|
||||
@@ -166,6 +166,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
.put(new WorldPoint(3380, 3963, 0), "Wilderness. North of Volcano.")
|
||||
.put(new WorldPoint(3051, 3736, 0), "East of the Wilderness Obelisk in 28 Wilderness.")
|
||||
.put(new WorldPoint(2316, 3814, 0), "West of Neitiznot, near the bridge.")
|
||||
.put(new WorldPoint(2872, 3937, 0), "Weiss.")
|
||||
// Master
|
||||
.put(new WorldPoint(2178, 3209, 0), "South of Elf Camp.")
|
||||
.put(new WorldPoint(2155, 3100, 0), "South of Port Tyras (BJS).")
|
||||
@@ -181,7 +182,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
.put(new WorldPoint(3085, 3569, 0), "Wilderness. Obelisk of Air.")
|
||||
.put(new WorldPoint(2934, 2727, 0), "Eastern shore of Crash Island.")
|
||||
.put(new WorldPoint(1451, 3695, 0), "West side of Lizardman Canyon with Lizardman shaman.")
|
||||
.put(new WorldPoint(2538, 3739, 0), "Waterbirth Island.")
|
||||
.put(new WorldPoint(2538, 3739, 0), "Waterbirth Island. Bring a pet rock and rune thrownaxe.")
|
||||
.put(new WorldPoint(1698, 3792, 0), "Arceuus church.")
|
||||
.put(new WorldPoint(2951, 3820, 0), "Wilderness. Chaos Temple (level 38).")
|
||||
.put(new WorldPoint(2202, 3825, 0), "Pirates' Cove, between Lunar Isle and Rellekka.")
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SceneOverlay extends Overlay
|
||||
private static final int MAP_SQUARE_SIZE = CHUNK_SIZE * CHUNK_SIZE; // 64
|
||||
private static final int CULL_CHUNK_BORDERS_RANGE = 16;
|
||||
private static final int STROKE_WIDTH = 4;
|
||||
private static final int CULL_LINE_OF_SIGHT_RANGE = 10;
|
||||
private static final int CULL_LINE_OF_SIGHT_RANGE = 20;
|
||||
private static final int INTERACTING_SHIFT = -16;
|
||||
|
||||
private static final Polygon ARROW_HEAD = new Polygon(
|
||||
|
||||
@@ -53,7 +53,7 @@ enum DiscordGameEventType
|
||||
TRAINING_COOKING(Skill.COOKING),
|
||||
TRAINING_WOODCUTTING(Skill.WOODCUTTING),
|
||||
TRAINING_FLETCHING(Skill.FLETCHING),
|
||||
TRAINING_FISHING(Skill.FISHING),
|
||||
TRAINING_FISHING(Skill.FISHING, 1),
|
||||
TRAINING_FIREMAKING(Skill.FIREMAKING),
|
||||
TRAINING_CRAFTING(Skill.CRAFTING),
|
||||
TRAINING_SMITHING(Skill.SMITHING),
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package net.runelite.client.plugins.implings;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
public class ImplingCounterOverlay extends Overlay
|
||||
{
|
||||
private final Client client;
|
||||
private final ImplingsPlugin plugin;
|
||||
private final ImplingsConfig config;
|
||||
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
public ImplingCounterOverlay(Client client, ImplingsConfig config, ImplingsPlugin plugin)
|
||||
{
|
||||
this.client = client;
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.TOP_LEFT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.showCounter() || plugin.getImplings().isEmpty())
|
||||
return null;
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
for (Map.Entry<ImplingType, Integer> entry : plugin.getImplingCounterMap().entrySet())
|
||||
{
|
||||
if (plugin.showImplingType(entry.getKey()) && entry.getValue() != 0)
|
||||
{
|
||||
tableComponent.addRow(entry.getKey().getName(), entry.getValue().toString());
|
||||
}
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
@@ -320,4 +320,15 @@ public interface ImplingsConfig extends Config
|
||||
{
|
||||
return Color.WHITE;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 26,
|
||||
keyName = "showCounter",
|
||||
name = "Show impling counter overlay",
|
||||
description = "Shows how many of each impling there is nearby"
|
||||
)
|
||||
default boolean showCounter()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,13 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
@@ -58,6 +60,9 @@ public class ImplingsPlugin extends Plugin
|
||||
private static final int DYNAMIC_SPAWN_ECLECTIC = 1633;
|
||||
private static final int DYNAMIC_SPAWN_BABY_ESSENCE = 1634;
|
||||
|
||||
@Getter
|
||||
private Map<ImplingType, Integer> implingCounterMap = new HashMap<>();
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final List<NPC> implings = new ArrayList<>();
|
||||
|
||||
@@ -67,6 +72,10 @@ public class ImplingsPlugin extends Plugin
|
||||
@Inject
|
||||
private ImplingsOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private ImplingCounterOverlay implingCounterOverlay;
|
||||
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@@ -91,6 +100,7 @@ public class ImplingsPlugin extends Plugin
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(minimapOverlay);
|
||||
overlayManager.add(implingCounterOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,6 +108,27 @@ public class ImplingsPlugin extends Plugin
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(minimapOverlay);
|
||||
overlayManager.remove(implingCounterOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
implingCounterMap.clear();
|
||||
for (NPC npc : implings)
|
||||
{
|
||||
Impling impling = Impling.findImpling(npc.getId());
|
||||
|
||||
ImplingType type = impling.getImplingType();
|
||||
if (implingCounterMap.containsKey(type))
|
||||
{
|
||||
implingCounterMap.put(type, implingCounterMap.get(type) + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
implingCounterMap.put(type, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -118,6 +149,7 @@ public class ImplingsPlugin extends Plugin
|
||||
if (event.getGameState() == GameState.LOGIN_SCREEN || event.getGameState() == GameState.HOPPING)
|
||||
{
|
||||
implings.clear();
|
||||
implingCounterMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +163,7 @@ public class ImplingsPlugin extends Plugin
|
||||
|
||||
NPC npc = npcDespawned.getNpc();
|
||||
implings.remove(npc);
|
||||
|
||||
}
|
||||
|
||||
boolean showNpc(NPC npc)
|
||||
@@ -183,7 +216,12 @@ public class ImplingsPlugin extends Plugin
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (impling.getImplingType())
|
||||
return typeToColor(impling.getImplingType());
|
||||
}
|
||||
|
||||
Color typeToColor(ImplingType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
||||
case BABY:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, https://runelitepl.us
|
||||
* Copyright (c) 2019, Jacky <liangj97@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -22,18 +22,34 @@
|
||||
* (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.vorkath;
|
||||
package net.runelite.client.plugins.inferno;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
|
||||
class ZombifiedSpawn
|
||||
@ConfigGroup("inferno")
|
||||
public interface InfernoConfig extends Config
|
||||
{
|
||||
@Getter
|
||||
private NPC npc;
|
||||
|
||||
ZombifiedSpawn(NPC npc)
|
||||
@ConfigItem(
|
||||
position = 0,
|
||||
keyName = "Nibbler Overlay",
|
||||
name = "Nibbler Overlay",
|
||||
description = "Shows if there are any Nibblers left"
|
||||
)
|
||||
default boolean displayNibblerOverlay()
|
||||
{
|
||||
this.npc = npc;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "Prayer Helper",
|
||||
name = "Prayer Helper",
|
||||
description = "Tells you what to flick in how many ticks"
|
||||
)
|
||||
default boolean showPrayerHelp()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Jacky <liangj97@gmail.com>
|
||||
* 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.inferno;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
public class InfernoInfobox extends Overlay
|
||||
{
|
||||
private final Client client;
|
||||
private final InfernoPlugin plugin;
|
||||
private final InfernoConfig config;
|
||||
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
public InfernoInfobox(Client client, InfernoConfig config, InfernoPlugin plugin)
|
||||
{
|
||||
this.client = client;
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.TOP_LEFT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.showPrayerHelp() || client.getMapRegions()[0] != 9043) return null;
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
for (int i = plugin.getPriorityNPC().length; i > 0; i--)
|
||||
{
|
||||
if (plugin.getPriorityNPC()[i - 1] == null)
|
||||
{
|
||||
tableComponent.addRow(Integer.toString(i), "-");
|
||||
}
|
||||
else
|
||||
{
|
||||
tableComponent.addRow(plugin.getPriorityNPC()[i - 1].getName(), plugin.getPriorityNPC()[i - 1 ].getAttackstyle().getName());
|
||||
}
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Jacky <liangj97@gmail.com>
|
||||
* 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.inferno;
|
||||
|
||||
import java.awt.Color;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
|
||||
public class InfernoNPC
|
||||
{
|
||||
public enum Attackstyle
|
||||
{
|
||||
MAGE("Mage", Color.CYAN),
|
||||
RANGE("Range", Color.GREEN),
|
||||
MELEE("Melee", Color.WHITE),
|
||||
RANDOM("Random", Color.ORANGE);
|
||||
|
||||
@Getter
|
||||
private String name = "";
|
||||
|
||||
@Getter
|
||||
private Color color;
|
||||
|
||||
Attackstyle(String s, Color c)
|
||||
{
|
||||
this.name = s;
|
||||
this.color = c;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
private NPC npc;
|
||||
|
||||
@Getter
|
||||
private String name;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private Attackstyle attackstyle;
|
||||
|
||||
@Getter
|
||||
private int attackTicks;
|
||||
|
||||
@Getter
|
||||
private int priority;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int ticksTillAttack = -1;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean attacking = false;
|
||||
|
||||
@Getter
|
||||
private int attackAnimation;
|
||||
|
||||
@Getter
|
||||
private boolean isMidAttack = false;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int distanceToPlayer = 0;
|
||||
|
||||
@Getter
|
||||
int textLocHeight;
|
||||
|
||||
public InfernoNPC(NPC npc)
|
||||
{
|
||||
this.npc = npc;
|
||||
textLocHeight = npc.getLogicalHeight() + 40;
|
||||
switch (npc.getId())
|
||||
{
|
||||
case NpcID.JALAKREKKET:
|
||||
attackTicks = 4;
|
||||
name = "lil mel";
|
||||
attackAnimation = 7582;
|
||||
attackstyle = Attackstyle.MELEE;
|
||||
priority = 7;
|
||||
break;
|
||||
|
||||
case NpcID.JALAKREKXIL:
|
||||
attackTicks = 4;
|
||||
name = "lil range";
|
||||
attackAnimation = 7583;
|
||||
attackstyle = Attackstyle.RANGE;
|
||||
priority = 6;
|
||||
break;
|
||||
|
||||
case NpcID.JALAKREKMEJ:
|
||||
attackTicks = 4;
|
||||
name = "lil mage";
|
||||
attackAnimation = 7581;
|
||||
attackstyle = Attackstyle.MAGE;
|
||||
priority = 5;
|
||||
break;
|
||||
|
||||
case NpcID.JALMEJRAH:
|
||||
attackTicks = 3;
|
||||
name = "bat";
|
||||
attackAnimation = 7578;
|
||||
attackstyle = Attackstyle.RANGE;
|
||||
priority = 4;
|
||||
break;
|
||||
|
||||
case NpcID.JALAK:
|
||||
attackTicks = 6;
|
||||
name = "blob";
|
||||
attackAnimation = 7583; // also 7581
|
||||
attackstyle = Attackstyle.RANDOM;
|
||||
priority = 3;
|
||||
break;
|
||||
|
||||
case NpcID.JALIMKOT:
|
||||
attackTicks = 4;
|
||||
name = "meleer";
|
||||
attackAnimation = 7597;
|
||||
attackstyle = Attackstyle.MELEE;
|
||||
priority = 2;
|
||||
break;
|
||||
|
||||
case NpcID.JALXIL:
|
||||
attackTicks = 4;
|
||||
name = "ranger";
|
||||
attackAnimation = 7605;
|
||||
attackstyle = Attackstyle.RANGE;
|
||||
priority = 1;
|
||||
break;
|
||||
|
||||
case NpcID.JALZEK:
|
||||
attackTicks = 4;
|
||||
name = "mager";
|
||||
attackAnimation = 7610;
|
||||
attackstyle = Attackstyle.MAGE;
|
||||
priority = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
attackTicks = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String info()
|
||||
{
|
||||
String info = "";
|
||||
|
||||
if (attacking)
|
||||
{
|
||||
info += ticksTillAttack;
|
||||
}
|
||||
//info += " D: " + distanceToPlayer;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public void attacked()
|
||||
{
|
||||
ticksTillAttack = attackTicks;
|
||||
attacking = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Jacky <liangj97@gmail.com>
|
||||
* 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.inferno;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class InfernoNibblerOverlay extends Overlay
|
||||
{
|
||||
private final Client client;
|
||||
private final InfernoPlugin plugin;
|
||||
private final InfernoConfig config;
|
||||
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
public InfernoNibblerOverlay(Client client, InfernoConfig config, InfernoPlugin plugin)
|
||||
{
|
||||
this.client = client;
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setPosition(OverlayPosition.TOP_LEFT);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.displayNibblerOverlay() || plugin.getNibblers().size() == 0 || client.getMapRegions()[0] != 9043)
|
||||
return null;
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
tableComponent.addRow("Nibblers Left: ", Integer.toString(plugin.getNibblers().size()));
|
||||
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Jacky <liangj97@gmail.com>
|
||||
* 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.inferno;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
public class InfernoOverlay extends Overlay
|
||||
{
|
||||
private final Client client;
|
||||
private final InfernoPlugin plugin;
|
||||
private final InfernoConfig config;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
public InfernoOverlay(Client client, InfernoConfig config, InfernoPlugin plugin)
|
||||
{
|
||||
setPosition(OverlayPosition.DYNAMIC);
|
||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||
this.client = client;
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!client.isInInstancedRegion() || client.getMapRegions()[0] != 9043) return null;
|
||||
|
||||
for (InfernoNPC monster : plugin.getMonsters().values())
|
||||
{
|
||||
NPC npc = monster.getNpc();
|
||||
//if (npc == null || !config.showPrayer()) return;
|
||||
LocalPoint lp = npc.getLocalLocation();
|
||||
if (lp != null)
|
||||
{
|
||||
Point point = Perspective.localToCanvas(client, lp, client.getPlane(), npc.getLogicalHeight());
|
||||
if (point != null)
|
||||
{
|
||||
if (monster.getTicksTillAttack() == 1 || (monster.getName().equals("blob") && monster.getTicksTillAttack() <= 3))
|
||||
{
|
||||
renderTextLocation(graphics, monster, monster.info(), Color.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderTextLocation(graphics, monster, monster.info(), Color.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// renders text location
|
||||
public static void renderTextLocation(Graphics2D graphics, InfernoNPC actor, String text, Color color)
|
||||
{
|
||||
graphics.setFont(new Font("Arial", Font.BOLD, 15));
|
||||
Point textLocation = actor.getNpc().getCanvasTextLocation(graphics, text, actor.textLocHeight + 40);
|
||||
if (Strings.isNullOrEmpty(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int x = textLocation.getX();
|
||||
int y = textLocation.getY();
|
||||
|
||||
graphics.setColor(Color.BLACK);
|
||||
graphics.drawString(text, x + 1, y + 1);
|
||||
|
||||
graphics.setColor(color);
|
||||
graphics.drawString(text, x, y);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Jacky <liangj97@gmail.com>
|
||||
* 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.inferno;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.HeadIcon;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Inferno",
|
||||
description = "Inferno helper",
|
||||
tags = {"combat", "overlay", "pve", "pvm"},
|
||||
type = PluginType.PVM
|
||||
)
|
||||
public class InfernoPlugin extends Plugin
|
||||
{
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private InfernoOverlay infernoOverlay;
|
||||
|
||||
@Inject
|
||||
private InfernoInfobox infernoInfobox;
|
||||
|
||||
@Inject
|
||||
private InfernoNibblerOverlay nibblerOverlay;
|
||||
|
||||
@Inject
|
||||
private InfernoConfig config;
|
||||
|
||||
@Getter
|
||||
private Map<NPC, InfernoNPC> monsters;
|
||||
|
||||
@Getter
|
||||
private Map<Integer, ArrayList<InfernoNPC>> monsterCurrentAttackMap;
|
||||
|
||||
@Getter
|
||||
private List<NPC> nibblers;
|
||||
|
||||
@Getter
|
||||
private InfernoNPC[] priorityNPC;
|
||||
|
||||
@Provides
|
||||
InfernoConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(InfernoConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(infernoOverlay);
|
||||
overlayManager.add(infernoInfobox);
|
||||
overlayManager.add(nibblerOverlay);
|
||||
monsters = new HashMap<>();
|
||||
monsterCurrentAttackMap = new HashMap<>(6);
|
||||
for (int i = 1; i <= 6; i++)
|
||||
{
|
||||
monsterCurrentAttackMap.put(i, new ArrayList<>());
|
||||
}
|
||||
nibblers = new ArrayList<>();
|
||||
priorityNPC = new InfernoNPC[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(infernoInfobox);
|
||||
overlayManager.remove(infernoOverlay);
|
||||
overlayManager.remove(nibblerOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
if (client.getMapRegions()[0] != 9043) return;
|
||||
|
||||
NPC npc = event.getNpc();
|
||||
if (isValidInfernoMob(npc))
|
||||
{
|
||||
monsters.put(npc, new InfernoNPC(npc));
|
||||
System.out.println(monsters.size());
|
||||
}
|
||||
if (npc.getId() == NpcID.JALNIB)
|
||||
{
|
||||
nibblers.add(npc);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (client.getMapRegions()[0] != 9043) return;
|
||||
|
||||
NPC npc = event.getNpc();
|
||||
if (monsters.containsKey(npc))
|
||||
{
|
||||
monsters.remove(npc);
|
||||
System.out.println(monsters.size());
|
||||
}
|
||||
|
||||
if (npc.getId() == NpcID.JALNIB)
|
||||
{
|
||||
nibblers.remove(npc);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
if (client.getMapRegions()[0] != 9043) return;
|
||||
|
||||
clearMapAndPriority();
|
||||
|
||||
for (InfernoNPC monster : monsters.values())
|
||||
{
|
||||
calculateDistanceToPlayer(monster);
|
||||
|
||||
NPC npc = monster.getNpc();
|
||||
|
||||
// if they are not attacking but are still attacking
|
||||
if (monster.isAttacking())
|
||||
{
|
||||
monster.setTicksTillAttack(monster.getTicksTillAttack() - 1);
|
||||
|
||||
// sets the blobs attack style
|
||||
if (monster.getName().equals("blob") && monster.getTicksTillAttack() == 3 && monster.getDistanceToPlayer() <= 15)
|
||||
{
|
||||
if (client.getLocalPlayer().getOverheadIcon() == null)
|
||||
{
|
||||
monster.setAttackstyle(InfernoNPC.Attackstyle.RANDOM);
|
||||
}
|
||||
else if (client.getLocalPlayer().getOverheadIcon().equals(HeadIcon.MAGIC))
|
||||
{
|
||||
monster.setAttackstyle(InfernoNPC.Attackstyle.RANGE);
|
||||
}
|
||||
else if (client.getLocalPlayer().getOverheadIcon().equals(HeadIcon.RANGED))
|
||||
{
|
||||
monster.setAttackstyle(InfernoNPC.Attackstyle.MAGE);
|
||||
}
|
||||
}
|
||||
|
||||
// we know the monster is not attacking because it should have attacked and is idling
|
||||
if (monster.getTicksTillAttack() == 0)
|
||||
{
|
||||
if (npc.getAnimation() == -1)
|
||||
{
|
||||
monster.setAttacking(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// want to reset the monsters attack back to attacking
|
||||
monster.attacked();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// they've just attacked
|
||||
if (npc.getAnimation() == monster.getAttackAnimation() || npc.getAnimation() == 7581) // special case for blob
|
||||
{
|
||||
monster.attacked();
|
||||
}
|
||||
}
|
||||
|
||||
if (monster.getTicksTillAttack() >= 1)
|
||||
{
|
||||
monsterCurrentAttackMap.get(monster.getTicksTillAttack()).add(monster);
|
||||
}
|
||||
}
|
||||
|
||||
calculatePriorityNPC();
|
||||
}
|
||||
|
||||
private void calculatePriorityNPC()
|
||||
{
|
||||
for (int i = 0; i < priorityNPC.length; i++)
|
||||
{
|
||||
ArrayList<InfernoNPC> monsters = monsterCurrentAttackMap.get(i + 1);
|
||||
|
||||
if ( monsters.size() == 0) continue;
|
||||
|
||||
int priority = monsters.get(0).getPriority();
|
||||
|
||||
InfernoNPC infernoNPC = monsters.get(0);
|
||||
|
||||
for (InfernoNPC npc : monsters)
|
||||
{
|
||||
if (npc.getPriority() < priority)
|
||||
{
|
||||
priority = npc.getPriority();
|
||||
infernoNPC = npc;
|
||||
}
|
||||
}
|
||||
priorityNPC[i] = infernoNPC;
|
||||
System.out.println("i: " + i + " " + infernoNPC.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: blob calculator
|
||||
private void calculateDistanceToPlayer(InfernoNPC monster)
|
||||
{
|
||||
monster.setDistanceToPlayer(client.getLocalPlayer().getWorldLocation().distanceTo(monster.getNpc().getWorldArea()));
|
||||
}
|
||||
|
||||
private void clearMapAndPriority()
|
||||
{
|
||||
for (List<InfernoNPC> l : monsterCurrentAttackMap.values())
|
||||
{
|
||||
l.clear();
|
||||
}
|
||||
|
||||
for (int i = 0; i < priorityNPC.length; i++)
|
||||
{
|
||||
priorityNPC[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isValidInfernoMob(NPC npc)
|
||||
{
|
||||
// we only want the bat, blob, melee, ranger and mager
|
||||
if (npc.getId() == NpcID.JALMEJRAH ||
|
||||
npc.getId() == NpcID.JALAK ||
|
||||
npc.getId() == NpcID.JALIMKOT ||
|
||||
npc.getId() == NpcID.JALXIL ||
|
||||
npc.getId() == NpcID.JALZEK) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -107,7 +107,10 @@ class KeyRemappingListener extends MouseAdapter implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
if (config.fkeyRemap())
|
||||
// In addition to the above checks, the F-key remapping shouldn't
|
||||
// activate when dialogs are open which listen for number keys
|
||||
// to select options
|
||||
if (config.fkeyRemap() && !plugin.isDialogOpen())
|
||||
{
|
||||
if (ONE.matches(e))
|
||||
{
|
||||
@@ -188,23 +191,18 @@ class KeyRemappingListener extends MouseAdapter implements KeyListener
|
||||
switch (e.getKeyCode())
|
||||
{
|
||||
case KeyEvent.VK_ENTER:
|
||||
case KeyEvent.VK_ESCAPE:
|
||||
plugin.setTyping(false);
|
||||
clientThread.invoke(plugin::lockChat);
|
||||
break;
|
||||
case KeyEvent.VK_ESCAPE:
|
||||
plugin.setTyping(false);
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, "");
|
||||
plugin.lockChat();
|
||||
});
|
||||
break;
|
||||
case KeyEvent.VK_BACK_SPACE:
|
||||
// Only lock chat on backspace when the typed text is now empty
|
||||
if (Strings.isNullOrEmpty(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT)))
|
||||
{
|
||||
plugin.setTyping(false);
|
||||
clientThread.invoke(plugin::lockChat);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,26 @@ public class KeyRemappingPlugin extends Plugin
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a dialog is open that will grab numerical input, to prevent F-key remapping
|
||||
* from triggering.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isDialogOpen()
|
||||
{
|
||||
// Most chat dialogs with numerical input are added without the chatbox or its key listener being removed,
|
||||
// so chatboxFocused() is true. The chatbox onkey script uses the following logic to ignore key presses,
|
||||
// so we will use it too to not remap F-keys.
|
||||
return isHidden(WidgetInfo.CHATBOX_MESSAGES) || isHidden(WidgetInfo.CHATBOX_TRANSPARENT_LINES);
|
||||
}
|
||||
|
||||
private boolean isHidden(WidgetInfo widgetInfo)
|
||||
{
|
||||
Widget w = client.getWidget(widgetInfo);
|
||||
return w == null || w.isSelfHidden();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
|
||||
{
|
||||
@@ -163,31 +183,25 @@ public class KeyRemappingPlugin extends Plugin
|
||||
|
||||
void lockChat()
|
||||
{
|
||||
Widget chatboxParent = client.getWidget(WidgetInfo.CHATBOX_PARENT);
|
||||
if (chatboxParent != null && chatboxParent.getOnKeyListener() != null)
|
||||
Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT);
|
||||
if (chatboxInput != null)
|
||||
{
|
||||
Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT);
|
||||
if (chatboxInput != null)
|
||||
{
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT);
|
||||
}
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + PRESS_ENTER_TO_CHAT);
|
||||
// Typed text can be non-empty on plugin start, so clear it now
|
||||
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, "");
|
||||
}
|
||||
}
|
||||
|
||||
void unlockChat()
|
||||
{
|
||||
Widget chatboxParent = client.getWidget(WidgetInfo.CHATBOX_PARENT);
|
||||
if (chatboxParent != null)
|
||||
Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT);
|
||||
if (chatboxInput != null)
|
||||
{
|
||||
Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT);
|
||||
if (chatboxInput != null)
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||
final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND;
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor));
|
||||
}
|
||||
final boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
|
||||
final Color textColor = isChatboxTransparent ? JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND : JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND;
|
||||
chatboxInput.setText(getPlayerNameWithIcon() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", textColor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ import static net.runelite.api.ObjectID.ROCKS_11374;
|
||||
import static net.runelite.api.ObjectID.ROCKS_11375;
|
||||
import static net.runelite.api.ObjectID.ROCKS_11376;
|
||||
import static net.runelite.api.ObjectID.ROCKS_11377;
|
||||
import static net.runelite.api.ObjectID.ROCKS_11386;
|
||||
import static net.runelite.api.ObjectID.ROCKS_11387;
|
||||
|
||||
enum Rock
|
||||
{
|
||||
@@ -65,7 +67,9 @@ enum Rock
|
||||
}
|
||||
},
|
||||
SILVER(Duration.ofMinutes(1), ROCKS_11369),
|
||||
SANDSTONE(Duration.ofMillis(5400), ROCKS_11386),
|
||||
GOLD(Duration.ofMinutes(1), ROCKS_11370, ROCKS_11371),
|
||||
GRANITE(Duration.ofMillis(5400), ROCKS_11387),
|
||||
MITHRIL(Duration.ofMinutes(2), ROCKS_11372, ROCKS_11373)
|
||||
{
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,7 @@ import javax.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
@@ -46,7 +46,6 @@ import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
@PluginDescriptor(
|
||||
loadWhenOutdated = true, // prevent users from disabling
|
||||
@@ -66,7 +65,7 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
@Override
|
||||
public void keyTyped(KeyEvent keyEvent)
|
||||
{
|
||||
if (!isNumber(keyEvent))
|
||||
if (!Character.isDigit(keyEvent.getKeyChar()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -92,12 +91,6 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
public void keyReleased(KeyEvent keyEvent)
|
||||
{
|
||||
}
|
||||
|
||||
private boolean isNumber(KeyEvent keyEvent)
|
||||
{
|
||||
char character = keyEvent.getKeyChar();
|
||||
return ArrayUtils.contains(numbers, character);
|
||||
}
|
||||
}
|
||||
|
||||
/* Can't feed this as args to runscript?
|
||||
@@ -126,7 +119,6 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
public static boolean customPresenceEnabled = false;
|
||||
public static final String rlPlusDiscordApp = "560644885250572289";
|
||||
public static final String rlDiscordApp = "409416265891971072";
|
||||
private static final char[] numbers = "0123456789".toCharArray();
|
||||
|
||||
@Inject
|
||||
public RuneLitePlusConfig config;
|
||||
@@ -155,6 +147,7 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
private RuneLitePlusKeyListener keyListener = new RuneLitePlusKeyListener();
|
||||
private int entered = -1;
|
||||
private int enterIdx;
|
||||
private boolean expectInput;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
@@ -170,6 +163,7 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
|
||||
entered = -1;
|
||||
enterIdx = 0;
|
||||
expectInput = false;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -202,8 +196,9 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
|
||||
else if (!config.keyboardPin())
|
||||
{
|
||||
entered = -1;
|
||||
entered = 0;
|
||||
enterIdx = 0;
|
||||
expectInput = false;
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
}
|
||||
}
|
||||
@@ -211,33 +206,41 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
entered = -1;
|
||||
entered = 0;
|
||||
enterIdx = 0;
|
||||
expectInput = false;
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent e)
|
||||
{
|
||||
if (!config.keyboardPin())
|
||||
if (e.getEventName().equals("bankpin"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
int[] intStack = client.getIntStack();
|
||||
int intStackSize = client.getIntStackSize();
|
||||
|
||||
if (event.getGroupId() == WidgetID.BANK_GROUP_ID)
|
||||
{
|
||||
// log.debug("Bank opened, removing key listener");
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
return;
|
||||
}
|
||||
else if (event.getGroupId() != WidgetID.BANK_PIN_GROUP_ID)
|
||||
//|| !Text.standardize(client.getWidget(WidgetInfo.BANK_PIN_TOP_LEFT_TEXT).getText()).equals("bank of gielinor"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// This'll be anywhere from -1 to 3
|
||||
// 0 = first number, 1 second, etc
|
||||
// Anything other than 0123 means the bankpin interface closes
|
||||
int enterIdx = intStack[intStackSize - 1];
|
||||
|
||||
// log.debug("Registering key listener");
|
||||
keyManager.registerKeyListener(keyListener);
|
||||
if (enterIdx < 0 || enterIdx > 3)
|
||||
{
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
this.enterIdx = 0;
|
||||
this.entered = 0;
|
||||
expectInput = false;
|
||||
return;
|
||||
}
|
||||
else if (enterIdx == 0)
|
||||
{
|
||||
keyManager.registerKeyListener(keyListener);
|
||||
}
|
||||
|
||||
this.enterIdx = enterIdx;
|
||||
expectInput = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleKey(char c)
|
||||
@@ -245,37 +248,38 @@ public class RuneLitePlusPlugin extends Plugin
|
||||
if (client.getWidget(WidgetID.BANK_PIN_GROUP_ID, 0) == null
|
||||
|| !client.getWidget(WidgetInfo.BANK_PIN_TOP_LEFT_TEXT).getText().equals("Bank of Gielinor"))
|
||||
{
|
||||
// log.debug("Key was pressed, but widget wasn't open");
|
||||
entered = -1;
|
||||
entered = 0;
|
||||
enterIdx = 0;
|
||||
expectInput = false;
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!expectInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int num = Character.getNumericValue(c);
|
||||
|
||||
client.runScript(685, num, enterIdx, entered, 13959181, 13959183, 13959184, 13959186, 13959188, 13959190, 13959192, 13959194, 13959196, 13959198, 13959200, 13959202, 13959171, 13959172, 13959173, 13959174, 13959178);
|
||||
// We gotta copy this cause enteridx changes while the script is executing
|
||||
int oldEnterIdx = enterIdx;
|
||||
|
||||
if (enterIdx == 0)
|
||||
// Script 685 will call 653, which in turn will set expectInput to true
|
||||
expectInput = false;
|
||||
client.runScript(685, num, enterIdx, entered, 13959181, 13959183, 13959184, 13959186, 13959188, 13959190, 13959192, 13959194, 13959196, 13959198, 13959200, 13959202, 13959171, 13959172, 13959173, 13959174, 13959178);
|
||||
|
||||
if (oldEnterIdx == 0)
|
||||
{
|
||||
entered = num * 1000;
|
||||
enterIdx++;
|
||||
}
|
||||
else if (enterIdx == 1)
|
||||
else if (oldEnterIdx == 1)
|
||||
{
|
||||
entered += num * 100;
|
||||
enterIdx++;
|
||||
}
|
||||
else if (enterIdx == 2)
|
||||
else if (oldEnterIdx == 2)
|
||||
{
|
||||
entered += num * 10;
|
||||
enterIdx++;
|
||||
}
|
||||
else if (enterIdx == 3)
|
||||
{
|
||||
entered = -1;
|
||||
enterIdx = 0;
|
||||
keyManager.unregisterKeyListener(keyListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,9 +448,7 @@ public class SpellbookPlugin extends Plugin
|
||||
}
|
||||
|
||||
// CHECKSTYLE:OFF
|
||||
Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>()
|
||||
{
|
||||
}.getType());
|
||||
Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>() {}.getType());
|
||||
// CHECKSTYLE:ON
|
||||
gson.stream().filter(Objects::nonNull).forEach(s -> spells.put(s.getWidget(), s));
|
||||
|
||||
@@ -465,7 +463,7 @@ public class SpellbookPlugin extends Plugin
|
||||
|
||||
private void saveSpells()
|
||||
{
|
||||
if (spells.isEmpty())
|
||||
if (spells.isEmpty() || tmp == null || tmp.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2018, https://runelitepl.us
|
||||
* Copyright (c) 2019, Infinitay <https://github.com/Infinitay>
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,45 +26,85 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.vorkath;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.NPC;
|
||||
|
||||
@Data
|
||||
@Slf4j
|
||||
public class Vorkath
|
||||
{
|
||||
static final int ATTACKS_PER_SWITCH = 6;
|
||||
static final int FIRE_BALL_ATTACKS = 25;
|
||||
|
||||
enum AttackStyle
|
||||
private NPC vorkath;
|
||||
|
||||
private VorkathAttack lastAttack;
|
||||
|
||||
private Phase currentPhase;
|
||||
private Phase nextPhase;
|
||||
private Phase lastPhase;
|
||||
|
||||
private int attacksLeft;
|
||||
|
||||
enum Phase
|
||||
{
|
||||
MAGERANGE,
|
||||
ICE,
|
||||
UNKNOWN,
|
||||
ACID,
|
||||
SPECIAL
|
||||
FIRE_BALL,
|
||||
SPAWN
|
||||
}
|
||||
|
||||
@Getter
|
||||
private NPC npc;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int phase;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int attacksUntilSwitch;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private int lastTickAnimation;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean icePhaseAttack;
|
||||
|
||||
public Vorkath(NPC npc)
|
||||
public Vorkath(NPC vorkath)
|
||||
{
|
||||
this.npc = npc;
|
||||
this.attacksUntilSwitch = ATTACKS_PER_SWITCH;
|
||||
this.phase = 0;
|
||||
this.vorkath = vorkath;
|
||||
this.attacksLeft = ATTACKS_PER_SWITCH;
|
||||
this.currentPhase = Phase.UNKNOWN;
|
||||
this.nextPhase = Phase.UNKNOWN;
|
||||
this.lastPhase = Phase.UNKNOWN;
|
||||
log.debug("[Vorkath] Created Vorkath: {}", this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the existing Vorkath object depending on the new phase it is currently on
|
||||
*
|
||||
* @param newPhase the new phase Vorkath is current on
|
||||
*/
|
||||
public void updatePhase(Phase newPhase)
|
||||
{
|
||||
Phase oldLastPhase = this.lastPhase;
|
||||
Phase oldCurrentPhase = this.currentPhase;
|
||||
Phase oldNextPhase = this.currentPhase;
|
||||
int oldAttacksLeft = this.attacksLeft;
|
||||
|
||||
this.lastPhase = this.currentPhase;
|
||||
this.currentPhase = newPhase;
|
||||
switch (newPhase)
|
||||
{
|
||||
case ACID:
|
||||
this.nextPhase = Phase.FIRE_BALL;
|
||||
break;
|
||||
case FIRE_BALL:
|
||||
this.nextPhase = Phase.SPAWN;
|
||||
break;
|
||||
case SPAWN:
|
||||
this.nextPhase = Phase.ACID;
|
||||
break;
|
||||
default:
|
||||
this.nextPhase = Phase.UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.currentPhase == Phase.FIRE_BALL)
|
||||
{
|
||||
this.attacksLeft = FIRE_BALL_ATTACKS;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.attacksLeft = ATTACKS_PER_SWITCH;
|
||||
}
|
||||
|
||||
log.debug("[Vorkath] Update! Last Phase: {}->{}, Current Phase: {}->{}, Next Phase: {}->{}, Attacks: {}->{}",
|
||||
oldLastPhase, this.lastPhase, oldCurrentPhase, this.currentPhase, oldNextPhase, this.nextPhase, oldAttacksLeft, this.attacksLeft);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Infinitay <https://github.com/Infinitay>
|
||||
*
|
||||
* 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.vorkath;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.AnimationID;
|
||||
import net.runelite.api.ProjectileID;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum VorkathAttack
|
||||
{
|
||||
/**
|
||||
* Vorkath's melee attack (see VorkathPlugin#onAnimationChanged)
|
||||
*/
|
||||
SLASH_ATTACK(AnimationID.VORKATH_SLASH_ATTACK, -1),
|
||||
/**
|
||||
* Vorkath's dragon breath attack
|
||||
*/
|
||||
FIRE_BREATH(AnimationID.VORKATH_ATTACK, ProjectileID.VORKATH_DRAGONBREATH),
|
||||
/**
|
||||
* Vorkath's dragon breath attack causing the player's active prayers to be deactivated
|
||||
*/
|
||||
PRAYER_BREATH(AnimationID.VORKATH_ATTACK, ProjectileID.VORKATH_PRAYER_DISABLE),
|
||||
/**
|
||||
* Vorkath's dragon breath attack causing the player to become poisoned with venom
|
||||
*/
|
||||
VENOM_BREATH(AnimationID.VORKATH_ATTACK, ProjectileID.VORKATH_VENOM),
|
||||
/**
|
||||
* Vorkath's ranged attack
|
||||
*/
|
||||
SPIKE(AnimationID.VORKATH_ATTACK, ProjectileID.VORKATH_RANGED),
|
||||
/**
|
||||
* Vorkath's magic attack
|
||||
*/
|
||||
ICE(AnimationID.VORKATH_ATTACK, ProjectileID.VORKATH_MAGIC),
|
||||
/**
|
||||
* Vorkath's aoe fire bomb attack (3x3 from where player was originally standing)
|
||||
*/
|
||||
FIRE_BOMB(AnimationID.VORKATH_FIRE_BOMB_OR_SPAWN_ATTACK, ProjectileID.VORKATH_BOMB_AOE),
|
||||
/**
|
||||
* Vorkath's aoe acid attacking, spewing acid across the instance
|
||||
*/
|
||||
ACID(AnimationID.VORKATH_ACID_ATTACK, ProjectileID.VORKATH_POISON_POOL_AOE),
|
||||
/**
|
||||
* Vorkath's fire ball attack that is fired during the acid phase, almost every tick for 25(?) attacks total
|
||||
*/
|
||||
FIRE_BALL(AnimationID.VORKATH_ACID_ATTACK, ProjectileID.VORKATH_TICK_FIRE_AOE),
|
||||
/**
|
||||
* Vorkath's dragon breath attack causing the player to be frozen during Zombified Spawn phase
|
||||
*/
|
||||
FREEZE_BREATH(AnimationID.VORKATH_ATTACK, ProjectileID.VORKATH_ICE),
|
||||
/**
|
||||
* Vorkath's spawning of a Zombified Spawn
|
||||
*/
|
||||
ZOMBIFIED_SPAWN(AnimationID.VORKATH_FIRE_BOMB_OR_SPAWN_ATTACK, ProjectileID.VORKATH_SPAWN_AOE);
|
||||
|
||||
private final int vorkathAnimationID;
|
||||
private final int projectileID;
|
||||
|
||||
private static final Map<Integer, VorkathAttack> VORKATH_ATTACKS;
|
||||
private static final Map<Integer, VorkathAttack> VORKATH_BASIC_ATTACKS;
|
||||
|
||||
static
|
||||
{
|
||||
ImmutableMap.Builder<Integer, VorkathAttack> builder = new ImmutableMap.Builder<>();
|
||||
for (VorkathAttack vorkathAttack : values())
|
||||
{
|
||||
builder.put(vorkathAttack.getProjectileID(), vorkathAttack);
|
||||
}
|
||||
VORKATH_ATTACKS = builder.build();
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
ImmutableMap.Builder<Integer, VorkathAttack> builder = new ImmutableMap.Builder<>();
|
||||
builder.put(FIRE_BREATH.getProjectileID(), FIRE_BREATH)
|
||||
.put(PRAYER_BREATH.getProjectileID(), PRAYER_BREATH)
|
||||
.put(VENOM_BREATH.getProjectileID(), VENOM_BREATH)
|
||||
.put(SPIKE.getProjectileID(), SPIKE)
|
||||
.put(ICE.getProjectileID(), ICE)
|
||||
.put(FIRE_BOMB.getProjectileID(), FIRE_BOMB)
|
||||
.put(FIRE_BALL.getProjectileID(), FIRE_BALL);
|
||||
// FIRE_BOMB and FIRE_BALL are also basic attacks
|
||||
// Although SLASH_ATTACK is a basic attack, we're going to handle it differently
|
||||
VORKATH_BASIC_ATTACKS = builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param projectileID id of projectile
|
||||
* @return {@link VorkathAttack} associated with the specified projectile
|
||||
*/
|
||||
public static VorkathAttack getVorkathAttack(int projectileID)
|
||||
{
|
||||
return VORKATH_ATTACKS.get(projectileID);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param projectileID
|
||||
* @return true if the projectile id matches a {@link VorkathAttack#getProjectileID()} within {@link VorkathAttack#VORKATH_BASIC_ATTACKS},
|
||||
* false otherwise
|
||||
*/
|
||||
public static boolean isBasicAttack(int projectileID)
|
||||
{
|
||||
return VORKATH_BASIC_ATTACKS.get(projectileID) != null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2018, https://runelitepl.us
|
||||
* Copyright (c) 2019, Infinitay <https://github.com/Infinitay>
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -59,20 +61,6 @@ public class VorkathOverlay extends Overlay
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
private BufferedImage getIcon(Vorkath.AttackStyle attackStyle)
|
||||
{
|
||||
switch (attackStyle)
|
||||
{
|
||||
case MAGERANGE:
|
||||
return VorkathPlugin.MAGERANGE;
|
||||
case ICE:
|
||||
return VorkathPlugin.ICE;
|
||||
case ACID:
|
||||
return VorkathPlugin.ACID;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
@@ -80,29 +68,17 @@ public class VorkathOverlay extends Overlay
|
||||
{
|
||||
Vorkath vorkath = plugin.getVorkath();
|
||||
|
||||
LocalPoint localLocation = vorkath.getNpc().getLocalLocation();
|
||||
LocalPoint localLocation = vorkath.getVorkath().getLocalLocation();
|
||||
if (localLocation != null)
|
||||
{
|
||||
Point point = Perspective.localToCanvas(client, localLocation, client.getPlane(), vorkath.getNpc().getLogicalHeight() + 16);
|
||||
Point point = Perspective.localToCanvas(client, localLocation, client.getPlane(), vorkath.getVorkath().getLogicalHeight() + 16);
|
||||
if (point != null)
|
||||
{
|
||||
point = new Point(point.getX(), point.getY());
|
||||
|
||||
BufferedImage icon = null;
|
||||
if (vorkath.getPhase() == 0)
|
||||
{
|
||||
icon = getIcon(Vorkath.AttackStyle.MAGERANGE);
|
||||
}
|
||||
else if (vorkath.getPhase() == 1)
|
||||
{
|
||||
icon = getIcon(Vorkath.AttackStyle.ACID);
|
||||
}
|
||||
else if (vorkath.getPhase() == 2)
|
||||
{
|
||||
icon = getIcon(Vorkath.AttackStyle.ICE);
|
||||
}
|
||||
BufferedImage currentPhaseIcon = getIcon(vorkath);
|
||||
|
||||
int totalWidth = icon.getWidth() * OVERLAY_ICON_MARGIN;
|
||||
int totalWidth = currentPhaseIcon.getWidth() * OVERLAY_ICON_MARGIN;
|
||||
int bgPadding = 8;
|
||||
int currentPosX = 0;
|
||||
|
||||
@@ -110,32 +86,31 @@ public class VorkathOverlay extends Overlay
|
||||
graphics.setColor(COLOR_ICON_BACKGROUND);
|
||||
graphics.fillOval(
|
||||
point.getX() - totalWidth / 2 + currentPosX - bgPadding,
|
||||
point.getY() - icon.getHeight() / 2 - OVERLAY_ICON_DISTANCE - bgPadding,
|
||||
icon.getWidth() + bgPadding * 2,
|
||||
icon.getHeight() + bgPadding * 2);
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - OVERLAY_ICON_DISTANCE - bgPadding,
|
||||
currentPhaseIcon.getWidth() + bgPadding * 2,
|
||||
currentPhaseIcon.getHeight() + bgPadding * 2);
|
||||
|
||||
graphics.setColor(COLOR_ICON_BORDER);
|
||||
graphics.drawOval(
|
||||
point.getX() - totalWidth / 2 + currentPosX - bgPadding,
|
||||
point.getY() - icon.getHeight() / 2 - OVERLAY_ICON_DISTANCE - bgPadding,
|
||||
icon.getWidth() + bgPadding * 2,
|
||||
icon.getHeight() + bgPadding * 2);
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - OVERLAY_ICON_DISTANCE - bgPadding,
|
||||
currentPhaseIcon.getWidth() + bgPadding * 2,
|
||||
currentPhaseIcon.getHeight() + bgPadding * 2);
|
||||
|
||||
graphics.drawImage(
|
||||
icon,
|
||||
currentPhaseIcon,
|
||||
point.getX() - totalWidth / 2 + currentPosX,
|
||||
point.getY() - icon.getHeight() / 2 - OVERLAY_ICON_DISTANCE,
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - OVERLAY_ICON_DISTANCE,
|
||||
null);
|
||||
|
||||
graphics.setColor(COLOR_ICON_BORDER_FILL);
|
||||
Arc2D.Double arc = new Arc2D.Double(
|
||||
point.getX() - totalWidth / 2 + currentPosX - bgPadding,
|
||||
point.getY() - icon.getHeight() / 2 - OVERLAY_ICON_DISTANCE - bgPadding,
|
||||
icon.getWidth() + bgPadding * 2,
|
||||
icon.getHeight() + bgPadding * 2,
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - OVERLAY_ICON_DISTANCE - bgPadding,
|
||||
currentPhaseIcon.getWidth() + bgPadding * 2,
|
||||
currentPhaseIcon.getHeight() + bgPadding * 2,
|
||||
90.0,
|
||||
-360.0 * (Vorkath.ATTACKS_PER_SWITCH -
|
||||
vorkath.getAttacksUntilSwitch()) / Vorkath.ATTACKS_PER_SWITCH,
|
||||
-360.0 * getAttacksLeftProgress(),
|
||||
Arc2D.OPEN);
|
||||
graphics.draw(arc);
|
||||
}
|
||||
@@ -144,4 +119,39 @@ public class VorkathOverlay extends Overlay
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param vorkath Vorkath object
|
||||
* @return image of the current phase Vorkath is on
|
||||
*/
|
||||
private BufferedImage getIcon(Vorkath vorkath)
|
||||
{
|
||||
switch (vorkath.getCurrentPhase())
|
||||
{
|
||||
case UNKNOWN:
|
||||
return VorkathPlugin.UNKNOWN;
|
||||
case ACID:
|
||||
return VorkathPlugin.ACID;
|
||||
case FIRE_BALL:
|
||||
return VorkathPlugin.FIRE_BALL;
|
||||
case SPAWN:
|
||||
return VorkathPlugin.SPAWN;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return number of attacks Vorkath has left in the current phase
|
||||
*/
|
||||
private double getAttacksLeftProgress()
|
||||
{
|
||||
if (plugin.getVorkath().getCurrentPhase() != Vorkath.Phase.FIRE_BALL)
|
||||
{
|
||||
return (double) (Vorkath.ATTACKS_PER_SWITCH - plugin.getVorkath().getAttacksLeft()) / Vorkath.ATTACKS_PER_SWITCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (double) (Vorkath.FIRE_BALL_ATTACKS - plugin.getVorkath().getAttacksLeft()) / Vorkath.FIRE_BALL_ATTACKS;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2018, https://runelitepl.us
|
||||
* Copyright (c) 2019, Infinitay <https://github.com/Infinitay>
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -24,25 +26,24 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.vorkath;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.inject.Inject;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.AnimationID;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Vorkath Helper",
|
||||
@@ -51,9 +52,11 @@ import net.runelite.client.util.ImageUtil;
|
||||
type = PluginType.PVM,
|
||||
enabledByDefault = false
|
||||
)
|
||||
|
||||
@Slf4j
|
||||
public class VorkathPlugin extends Plugin
|
||||
{
|
||||
private static final int VORKATH_REGION = 9023;
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@@ -66,156 +69,177 @@ public class VorkathPlugin extends Plugin
|
||||
@Inject
|
||||
private ZombifiedSpawnOverlay SpawnOverlay;
|
||||
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Getter
|
||||
private Vorkath vorkath;
|
||||
|
||||
@Getter
|
||||
private ZombifiedSpawn spawn;
|
||||
private NPC zombifiedSpawn;
|
||||
|
||||
/**
|
||||
* The last projectile's starting movement cycle
|
||||
*/
|
||||
private int lastProjectileCycle;
|
||||
|
||||
static final BufferedImage UNKNOWN;
|
||||
static final BufferedImage ACID;
|
||||
static final BufferedImage ICE;
|
||||
static final BufferedImage MAGERANGE;
|
||||
static final BufferedImage FIRE_BALL;
|
||||
static final BufferedImage SPAWN;
|
||||
|
||||
static
|
||||
{
|
||||
UNKNOWN = ImageUtil.getResourceStreamFromClass(VorkathPlugin.class, "magerange.png");
|
||||
ACID = ImageUtil.getResourceStreamFromClass(VorkathPlugin.class, "acid.png");
|
||||
ICE = ImageUtil.getResourceStreamFromClass(VorkathPlugin.class, "ice.png");
|
||||
MAGERANGE = ImageUtil.getResourceStreamFromClass(VorkathPlugin.class, "magerange.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(SpawnOverlay);
|
||||
clientThread.invoke(this::reset);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(SpawnOverlay);
|
||||
}
|
||||
|
||||
private void reset()
|
||||
{
|
||||
this.vorkath = null;
|
||||
for (NPC npc : client.getNpcs())
|
||||
{
|
||||
if (isNpcVorkath(npc.getId()))
|
||||
{
|
||||
this.vorkath = new Vorkath(npc);
|
||||
}
|
||||
else if (isNpcZombifiedSpawn(npc.getId()))
|
||||
{
|
||||
this.spawn = new ZombifiedSpawn(npc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isNpcVorkath(int npcId)
|
||||
{
|
||||
return npcId == NpcID.VORKATH ||
|
||||
npcId == NpcID.VORKATH_8058 ||
|
||||
npcId == NpcID.VORKATH_8059 ||
|
||||
npcId == NpcID.VORKATH_8060 ||
|
||||
npcId == NpcID.VORKATH_8061;
|
||||
}
|
||||
|
||||
private static boolean isNpcZombifiedSpawn(int id)
|
||||
{
|
||||
return id == NpcID.ZOMBIFIED_SPAWN ||
|
||||
id == NpcID.ZOMBIFIED_SPAWN_8063;
|
||||
FIRE_BALL = ImageUtil.getResourceStreamFromClass(VorkathPlugin.class, "fire_strike.png");
|
||||
SPAWN = ImageUtil.getResourceStreamFromClass(VorkathPlugin.class, "ice.png");
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
NPC npc = event.getNpc();
|
||||
if (isNpcVorkath(npc.getId()))
|
||||
if (isAtVorkath())
|
||||
{
|
||||
this.vorkath = new Vorkath(npc);
|
||||
}
|
||||
else if (isNpcZombifiedSpawn(npc.getId()))
|
||||
{
|
||||
this.spawn = new ZombifiedSpawn(npc);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
{
|
||||
final NPC npc = npcDespawned.getNpc();
|
||||
if (this.vorkath != null)
|
||||
{
|
||||
if (npc.getId() == this.vorkath.getNpc().getId())
|
||||
if (isVorkath(event.getNpc().getId()))
|
||||
{
|
||||
this.vorkath = null;
|
||||
reset();
|
||||
vorkath = new Vorkath(event.getNpc());
|
||||
lastProjectileCycle = -1;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.spawn != null)
|
||||
{
|
||||
if (npc.getId() == this.spawn.getNpc().getId())
|
||||
else if (isZombifiedSpawn(event.getNpc().getId()))
|
||||
{
|
||||
this.spawn = null;
|
||||
zombifiedSpawn = event.getNpc();
|
||||
overlayManager.add(SpawnOverlay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
GameState gs = event.getGameState();
|
||||
if (gs == GameState.LOGGING_IN ||
|
||||
gs == GameState.CONNECTION_LOST ||
|
||||
gs == GameState.HOPPING)
|
||||
if (isAtVorkath())
|
||||
{
|
||||
reset();
|
||||
if (isVorkath(event.getNpc().getId()))
|
||||
{
|
||||
vorkath = null;
|
||||
lastProjectileCycle = -1;
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
else if (isZombifiedSpawn(event.getNpc().getId()))
|
||||
{
|
||||
zombifiedSpawn = null;
|
||||
overlayManager.remove(SpawnOverlay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
public void onProjectileMoved(ProjectileMoved event)
|
||||
{
|
||||
if (vorkath != null)
|
||||
// Only capture initial projectile
|
||||
if (!isAtVorkath() || event.getProjectile().getStartMovementCycle() == lastProjectileCycle)
|
||||
{
|
||||
int animationId = vorkath.getNpc().getAnimation();
|
||||
return;
|
||||
}
|
||||
|
||||
if (animationId != vorkath.getLastTickAnimation())
|
||||
VorkathAttack vorkathAttack = VorkathAttack.getVorkathAttack(event.getProjectile().getId());
|
||||
if (vorkathAttack != null)
|
||||
{
|
||||
/*log.debug("[Projectile ({})] Game Tick: {}, Game Cycle: {}, Starting Cyle: {} Last Cycle: {}, Initial Projectile?: {}",
|
||||
vorkathAttack, client.getTickCount(), client.getGameCycle(), event.getProjectile().getStartMovementCycle(),
|
||||
lastProjectileCycle, event.getProjectile().getStartMovementCycle() == client.getGameCycle());*/
|
||||
if (VorkathAttack.isBasicAttack(vorkathAttack.getProjectileID()) && vorkath.getAttacksLeft() > 0)
|
||||
{
|
||||
if (animationId == AnimationID.VORKATH_ACID_ATTACK)
|
||||
{
|
||||
vorkath.setPhase(2);
|
||||
vorkath.setAttacksUntilSwitch(Vorkath.ATTACKS_PER_SWITCH);
|
||||
}
|
||||
else if (animationId == AnimationID.VORKATH_ATTACK && vorkath.getAttacksUntilSwitch() == 0)
|
||||
{
|
||||
vorkath.setPhase(1);
|
||||
vorkath.setAttacksUntilSwitch(Vorkath.ATTACKS_PER_SWITCH);
|
||||
//Vorkath does a bomb animation after the ice dragon breathe, we need to account for it
|
||||
vorkath.setIcePhaseAttack(true);
|
||||
}
|
||||
else if (animationId == AnimationID.VORKATH_ATTACK || animationId == AnimationID.VORKATH_FIRE_BOMB_ATTACK)
|
||||
{
|
||||
if (vorkath.isIcePhaseAttack())
|
||||
{
|
||||
vorkath.setIcePhaseAttack(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
vorkath.setAttacksUntilSwitch(vorkath.getAttacksUntilSwitch() - 1);
|
||||
}
|
||||
}
|
||||
vorkath.setAttacksLeft(vorkath.getAttacksLeft() - 1);
|
||||
}
|
||||
else if (vorkathAttack == VorkathAttack.ACID)
|
||||
{
|
||||
vorkath.updatePhase(Vorkath.Phase.ACID);
|
||||
// Sets the phase's progress indicator to done
|
||||
vorkath.setAttacksLeft(0);
|
||||
}
|
||||
else if (vorkathAttack == VorkathAttack.FIRE_BALL)
|
||||
{
|
||||
vorkath.updatePhase(Vorkath.Phase.FIRE_BALL);
|
||||
// Decrement to account for this fire ball
|
||||
vorkath.setAttacksLeft(vorkath.getAttacksLeft() - 1);
|
||||
}
|
||||
else if (vorkathAttack == VorkathAttack.FREEZE_BREATH && vorkath.getLastAttack() != VorkathAttack.ZOMBIFIED_SPAWN)
|
||||
{
|
||||
// Filters out second invisible freeze attack that is immediately after the Zombified Spawn
|
||||
vorkath.updatePhase(Vorkath.Phase.SPAWN);
|
||||
// Sets progress of the phase to half
|
||||
vorkath.setAttacksLeft(vorkath.getAttacksLeft() - (vorkath.getAttacksLeft() / 2));
|
||||
}
|
||||
else if (vorkathAttack == VorkathAttack.ZOMBIFIED_SPAWN || (vorkath.getLastAttack() == VorkathAttack.ZOMBIFIED_SPAWN))
|
||||
{
|
||||
// Also consumes the second invisible freeze attack that is immediately after the Zombified Spawn
|
||||
// Sets progress of the phase to done as there are no more attacks within this phase
|
||||
vorkath.setAttacksLeft(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Vorkath fired a basic attack AND there are no more attacks left, typically after phases are over
|
||||
vorkath.updatePhase(vorkath.getNextPhase());
|
||||
// Decrement to account for this basic attack
|
||||
vorkath.setAttacksLeft(vorkath.getAttacksLeft() - 1);
|
||||
}
|
||||
|
||||
vorkath.setLastTickAnimation(animationId);
|
||||
log.debug("[Vorkath ({})] {}", vorkathAttack, vorkath);
|
||||
vorkath.setLastAttack(vorkathAttack);
|
||||
lastProjectileCycle = event.getProjectile().getStartMovementCycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
if (isAtVorkath() && vorkath != null && event.getActor().equals(vorkath.getVorkath())
|
||||
&& event.getActor().getAnimation() == VorkathAttack.SLASH_ATTACK.getVorkathAnimationID())
|
||||
{
|
||||
if (vorkath.getAttacksLeft() > 0)
|
||||
{
|
||||
vorkath.setAttacksLeft(vorkath.getAttacksLeft() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No more attacks left, typically after phases are over
|
||||
vorkath.updatePhase(vorkath.getNextPhase());
|
||||
// Decrement to account for this basic attack
|
||||
vorkath.setAttacksLeft(vorkath.getAttacksLeft() - 1);
|
||||
}
|
||||
log.debug("[Vorkath (SLASH_ATTACK)] {}", vorkath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the player is in the Vorkath region, false otherwise
|
||||
*/
|
||||
private boolean isAtVorkath()
|
||||
{
|
||||
return ArrayUtils.contains(client.getMapRegions(), VORKATH_REGION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param npcID
|
||||
* @return true if the npc is Vorkath, false otherwise
|
||||
*/
|
||||
private boolean isVorkath(int npcID)
|
||||
{
|
||||
// Could be done with a a simple name check instead...
|
||||
return npcID == NpcID.VORKATH ||
|
||||
npcID == NpcID.VORKATH_8058 ||
|
||||
npcID == NpcID.VORKATH_8059 ||
|
||||
npcID == NpcID.VORKATH_8060 ||
|
||||
npcID == NpcID.VORKATH_8061;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param npcID
|
||||
* @return true if the npc is a Zombified Spawn, otherwise false
|
||||
*/
|
||||
private boolean isZombifiedSpawn(int npcID)
|
||||
{
|
||||
// Could be done with a a simple name check instead...
|
||||
return npcID == NpcID.ZOMBIFIED_SPAWN ||
|
||||
npcID == NpcID.ZOMBIFIED_SPAWN_8063;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,10 +48,9 @@ public class ZombifiedSpawnOverlay extends Overlay
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (plugin.getSpawn() != null)
|
||||
if (plugin.getZombifiedSpawn() != null)
|
||||
{
|
||||
ZombifiedSpawn spawn = plugin.getSpawn();
|
||||
OverlayUtil.renderActorOverlayImage(graphics, spawn.getNpc(), VorkathPlugin.ICE, Color.green, 10);
|
||||
OverlayUtil.renderActorOverlayImage(graphics, plugin.getZombifiedSpawn(), VorkathPlugin.SPAWN, Color.green, 10);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -54,7 +54,9 @@ import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import static net.runelite.client.RuneLite.RUNELITE_DIR;
|
||||
import static net.runelite.client.rs.ClientUpdateCheckMode.AUTO;
|
||||
import static net.runelite.client.rs.ClientUpdateCheckMode.CUSTOM;
|
||||
import static net.runelite.client.rs.ClientUpdateCheckMode.VANILLA;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -63,7 +65,8 @@ import okhttp3.Response;
|
||||
@Singleton
|
||||
public class ClientLoader
|
||||
{
|
||||
private static final File CUSTOMFILE = new File("./injected-client/target/injected-client-1.0-SNAPSHOT.jar");
|
||||
private static final File LOCAL_INJECTED_CLIENT = new File("./injected-client/target/injected-client-" + RuneLiteAPI.getVersion() + ".jar");
|
||||
private static final File INJECTED_CLIENT = new File(RUNELITE_DIR + "/injected-client.jar");
|
||||
private final ClientConfigLoader clientConfigLoader;
|
||||
private ClientUpdateCheckMode updateCheckMode;
|
||||
public static boolean useLocalInjected = false;
|
||||
@@ -79,7 +82,6 @@ public class ClientLoader
|
||||
|
||||
public Applet load()
|
||||
{
|
||||
updateCheckMode = CUSTOM;
|
||||
try
|
||||
{
|
||||
Manifest manifest = new Manifest();
|
||||
@@ -87,6 +89,8 @@ public class ClientLoader
|
||||
RSConfig config = clientConfigLoader.fetch();
|
||||
|
||||
Map<String, byte[]> zipFile = new HashMap<>();
|
||||
|
||||
if (updateCheckMode == VANILLA)
|
||||
{
|
||||
Certificate[] jagexCertificateChain = getJagexCertificateChain();
|
||||
String codebase = config.getCodeBase();
|
||||
@@ -140,61 +144,27 @@ public class ClientLoader
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (updateCheckMode == CUSTOM)
|
||||
else if (updateCheckMode == CUSTOM || useLocalInjected)
|
||||
{
|
||||
log.info("Loading injected client from {}", LOCAL_INJECTED_CLIENT.getAbsolutePath());
|
||||
loadJar(zipFile, LOCAL_INJECTED_CLIENT);
|
||||
}
|
||||
else if (updateCheckMode == AUTO)
|
||||
{
|
||||
URL url = new URL("https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/injected-client.jar");
|
||||
ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream());
|
||||
File LOCAL_INJECTED_CLIENT = new File("./injected-client/target/injected-client-" + RuneLiteAPI.getVersion() + ".jar");
|
||||
File INJECTED_CLIENT = new File(RUNELITE_DIR + "/injected-client.jar");
|
||||
INJECTED_CLIENT.mkdirs();
|
||||
if (INJECTED_CLIENT.exists())
|
||||
{
|
||||
if (getFileSize(INJECTED_CLIENT.toURI().toURL()) != getFileSize(url))
|
||||
{
|
||||
INJECTED_CLIENT.delete();
|
||||
INJECTED_CLIENT.createNewFile();
|
||||
System.out.println("Updating Injected Client");
|
||||
updateInjectedClient(readableByteChannel);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!INJECTED_CLIENT.exists() || getFileSize(INJECTED_CLIENT.toURI().toURL()) != getFileSize(url))
|
||||
{
|
||||
log.info("{} injected client", INJECTED_CLIENT.exists() ? "Updating" : "Initializing");
|
||||
INJECTED_CLIENT.delete();
|
||||
INJECTED_CLIENT.createNewFile();
|
||||
System.out.println("Initializing Inject Client");
|
||||
updateInjectedClient(readableByteChannel);
|
||||
}
|
||||
JarInputStream fis;
|
||||
if (useLocalInjected)
|
||||
{
|
||||
fis = new JarInputStream(new FileInputStream(LOCAL_INJECTED_CLIENT));
|
||||
}
|
||||
else
|
||||
{
|
||||
fis = new JarInputStream(new FileInputStream(INJECTED_CLIENT));
|
||||
}
|
||||
byte[] tmp = new byte[4096];
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream(756 * 1024);
|
||||
for (; ; )
|
||||
{
|
||||
JarEntry metadata = fis.getNextJarEntry();
|
||||
if (metadata == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
buffer.reset();
|
||||
for (; ; )
|
||||
{
|
||||
int n = fis.read(tmp);
|
||||
if (n <= -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
buffer.write(tmp, 0, n);
|
||||
}
|
||||
zipFile.replace(metadata.getName(), buffer.toByteArray());
|
||||
}
|
||||
log.info("Loading injected client from {}", INJECTED_CLIENT.getAbsolutePath());
|
||||
loadJar(zipFile, INJECTED_CLIENT);
|
||||
}
|
||||
|
||||
String initialClass = config.getInitialClass();
|
||||
@@ -222,7 +192,7 @@ public class ClientLoader
|
||||
|
||||
if (rs instanceof Client)
|
||||
{
|
||||
log.info("client-patch {}", "420 blaze it RL pricks");
|
||||
log.info("client-patch 420 blaze it RL pricks");
|
||||
}
|
||||
|
||||
return rs;
|
||||
@@ -241,7 +211,7 @@ public class ClientLoader
|
||||
}
|
||||
}
|
||||
|
||||
private static int getFileSize(URL url)
|
||||
private static int getFileSize(URL url) throws IOException
|
||||
{
|
||||
URLConnection conn = null;
|
||||
try
|
||||
@@ -254,10 +224,6 @@ public class ClientLoader
|
||||
conn.getInputStream();
|
||||
return conn.getContentLength();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (conn instanceof HttpURLConnection)
|
||||
@@ -267,19 +233,11 @@ public class ClientLoader
|
||||
}
|
||||
}
|
||||
|
||||
private void updateInjectedClient(ReadableByteChannel readableByteChannel)
|
||||
private void updateInjectedClient(ReadableByteChannel readableByteChannel) throws IOException
|
||||
{
|
||||
File INJECTED_CLIENT = new File(RUNELITE_DIR, "injected-client.jar");
|
||||
try
|
||||
{
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(INJECTED_CLIENT);
|
||||
fileOutputStream.getChannel()
|
||||
.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(INJECTED_CLIENT);
|
||||
fileOutputStream.getChannel()
|
||||
.transferFrom(readableByteChannel, 0, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
private static Certificate[] getJagexCertificateChain() throws CertificateException
|
||||
@@ -288,4 +246,31 @@ public class ClientLoader
|
||||
Collection<? extends Certificate> certificates = certificateFactory.generateCertificates(ClientLoader.class.getResourceAsStream("jagex.crt"));
|
||||
return certificates.toArray(new Certificate[0]);
|
||||
}
|
||||
|
||||
private static void loadJar(Map<String, byte[]> toMap, File fromFile) throws IOException
|
||||
{
|
||||
JarInputStream fis = new JarInputStream(new FileInputStream(fromFile));
|
||||
byte[] tmp = new byte[4096];
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream(756 * 1024);
|
||||
for (; ; )
|
||||
{
|
||||
JarEntry metadata = fis.getNextJarEntry();
|
||||
if (metadata == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
buffer.reset();
|
||||
for (; ; )
|
||||
{
|
||||
int n = fis.read(tmp);
|
||||
if (n <= -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
buffer.write(tmp, 0, n);
|
||||
}
|
||||
toMap.put(metadata.getName(), buffer.toByteArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class RuneLiteSplashScreen
|
||||
panel.add(version, versionConstraints);
|
||||
|
||||
// version
|
||||
final JLabel litVersion = new JLabel("Plus Version : PRE-" + RuneLite.RUNELIT_VERSION);
|
||||
final JLabel litVersion = new JLabel("Plus Version : " + RuneLite.RUNELIT_VERSION);
|
||||
litVersion.setForeground(Color.GREEN);
|
||||
litVersion.setFont(FontManager.getRunescapeSmallFont());
|
||||
litVersion.setForeground(litVersion.getForeground().darker());
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
public class Artifact {
|
||||
|
||||
String hash;
|
||||
String name;
|
||||
String path;
|
||||
String size;
|
||||
|
||||
public class Artifact
|
||||
{
|
||||
String hash;
|
||||
String name;
|
||||
String path;
|
||||
String size;
|
||||
}
|
||||
|
||||
@@ -1,328 +1,345 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
|
||||
public class Bootstrap {
|
||||
public class Bootstrap
|
||||
{
|
||||
Artifact[] artifacts = getArtifacts();
|
||||
Client client = new Client();
|
||||
String[] clientJvm9Arguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Djna.nosys=true"
|
||||
};
|
||||
String[] clientJvmArguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Xincgc",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+UseParNewGC",
|
||||
"-Djna.nosys=true"};
|
||||
String[] dependencyHashes;
|
||||
String[] launcherArguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Drunelite.launcher.nojvm=true",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Xincgc",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+UseParNewGC",
|
||||
"-Djna.nosys=true"};
|
||||
|
||||
Artifact[] artifacts = getArtifacts();
|
||||
Client client = new Client();
|
||||
String[] clientJvm9Arguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Djna.nosys=true"
|
||||
};
|
||||
String[] clientJvmArguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Xincgc",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+UseParNewGC",
|
||||
"-Djna.nosys=true"};
|
||||
String[] dependencyHashes;
|
||||
String[] launcherArguments = new String[]{
|
||||
"-XX:+DisableAttachMechanism",
|
||||
"-Drunelite.launcher.nojvm=true",
|
||||
"-Xmx512m",
|
||||
"-Xss2m",
|
||||
"-XX:CompileThreshold=1500",
|
||||
"-Xincgc",
|
||||
"-XX:+UseConcMarkSweepGC",
|
||||
"-XX:+UseParNewGC",
|
||||
"-Djna.nosys=true"};
|
||||
public Bootstrap()
|
||||
{
|
||||
}
|
||||
|
||||
public Bootstrap(){}
|
||||
public static String getChecksumObject(Serializable object) throws IOException, NoSuchAlgorithmException
|
||||
{
|
||||
ByteArrayOutputStream baos = null;
|
||||
ObjectOutputStream oos = null;
|
||||
try
|
||||
{
|
||||
baos = new ByteArrayOutputStream();
|
||||
oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(object);
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] thedigest = md.digest(baos.toByteArray());
|
||||
return DatatypeConverter.printHexBinary(thedigest);
|
||||
}
|
||||
finally
|
||||
{
|
||||
oos.close();
|
||||
baos.close();
|
||||
}
|
||||
}
|
||||
|
||||
public Artifact[] getArtifacts() {
|
||||
try {
|
||||
artifacts = new Artifact[42];
|
||||
private static String getChecksumFile(String filepath) throws IOException
|
||||
{
|
||||
System.out.println("Generating Hash for " + filepath);
|
||||
MessageDigest md = null;
|
||||
try
|
||||
{
|
||||
md = MessageDigest.getInstance("SHA-256");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
try (DigestInputStream dis = new DigestInputStream(new FileInputStream(filepath), md))
|
||||
{
|
||||
while (dis.read() != -1)
|
||||
{
|
||||
//empty loop to clear the data
|
||||
}
|
||||
md = dis.getMessageDigest();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Static artifacts
|
||||
artifacts[0] = new Artifact();
|
||||
artifacts[0].hash = "b12331da8683e5f107d294adeebb83ecf9124abc1db533554d2a8d3c62832d75";
|
||||
artifacts[0].name = "asm-all-6.0_BETA.jar";
|
||||
artifacts[0].path = "https://mvn.runelite.net/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA.jar";
|
||||
artifacts[0].size = "265176";
|
||||
artifacts[1] = new Artifact();
|
||||
artifacts[1].hash = "37abf0103ce5318bfda004fabc004c75ed0dc6d392a8459175692ab7eac97083";
|
||||
artifacts[1].name = "naturalmouse-2.0.0.jar";
|
||||
artifacts[1].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/naturalmouse-2.0.0.jar";
|
||||
artifacts[1].size = "3168921";
|
||||
artifacts[2] = new Artifact();
|
||||
artifacts[2].hash = "50d1e07f11827672249dee9ce8a23691fc59f663deed084bb7b52a4f778d5fbc";
|
||||
artifacts[2].name = "jcl-core-2.9-SNAPSHOT.jar";
|
||||
artifacts[2].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/jcl-core-2.9-SNAPSHOT.jar";
|
||||
artifacts[2].size = "3168921";
|
||||
artifacts[4] = new Artifact();
|
||||
artifacts[4].hash = "18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79";
|
||||
artifacts[4].name = "slf4j-api-1.7.25.jar";
|
||||
artifacts[4].path = "https://mvn.runelite.net/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar";
|
||||
artifacts[4].size = "41203";
|
||||
artifacts[5] = new Artifact();
|
||||
artifacts[5].hash = "fb53f8539e7fcb8f093a56e138112056ec1dc809ebb020b59d8a36a5ebac37e0";
|
||||
artifacts[5].name = "logback-classic-1.2.3.jar";
|
||||
artifacts[5].path = "https://mvn.runelite.net/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar";
|
||||
artifacts[5].size = "290339";
|
||||
artifacts[6] = new Artifact();
|
||||
artifacts[6].hash = "5946d837fe6f960c02a53eda7a6926ecc3c758bbdd69aa453ee429f858217f22";
|
||||
artifacts[6].name = "logback-core-1.2.3.jar";
|
||||
artifacts[6].path = "https://mvn.runelite.net/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar";
|
||||
artifacts[6].size = "471901";
|
||||
artifacts[7] = new Artifact();
|
||||
artifacts[7].hash = "9f0c8d50fa4b79b6ff1502dbec8502179d6b9497cacbe17a13074001aed537ec";
|
||||
artifacts[7].name = "jopt-simple-5.0.1.jar";
|
||||
artifacts[7].path = "https://mvn.runelite.net/net/sf/jopt-simple/jopt-simple/5.0.1/jopt-simple-5.0.1.jar";
|
||||
artifacts[7].size = "78826";
|
||||
artifacts[8] = new Artifact();
|
||||
artifacts[8].hash = "5be9a7d05ba0ccd74708bc8018ae412255f85843c0b92302e9b9befa6ed52564";
|
||||
artifacts[8].name = "guava-23.2-jre.jar";
|
||||
artifacts[8].path = "https://mvn.runelite.net/com/google/guava/guava/23.2-jre/guava-23.2-jre.jar";
|
||||
artifacts[8].size = "2649860";
|
||||
artifacts[9] = new Artifact();
|
||||
artifacts[9].hash = "905721a0eea90a81534abb7ee6ef4ea2e5e645fa1def0a5cd88402df1b46c9ed";
|
||||
artifacts[9].name = "jsr305-1.3.9.jar";
|
||||
artifacts[9].path = "https://mvn.runelite.net/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar";
|
||||
artifacts[9].size = "33015";
|
||||
artifacts[10] = new Artifact();
|
||||
artifacts[10].hash = "cb4cfad870bf563a07199f3ebea5763f0dec440fcda0b318640b1feaa788656b";
|
||||
artifacts[10].name = "error_prone_annotations-2.0.18.jar";
|
||||
artifacts[10].path = "https://mvn.runelite.net/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar";
|
||||
artifacts[10].size = "12078";
|
||||
artifacts[11] = new Artifact();
|
||||
artifacts[11].hash = "2994a7eb78f2710bd3d3bfb639b2c94e219cedac0d4d084d516e78c16dddecf6";
|
||||
artifacts[11].name = "j2objc-annotations-1.1.jar";
|
||||
artifacts[11].path = "https://mvn.runelite.net/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar";
|
||||
artifacts[11].size = "8782";
|
||||
artifacts[12] = new Artifact();
|
||||
artifacts[12].hash = "2068320bd6bad744c3673ab048f67e30bef8f518996fa380033556600669905d";
|
||||
artifacts[12].name = "animal-sniffer-annotations-1.14.jar";
|
||||
artifacts[12].path = "https://mvn.runelite.net/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar";
|
||||
artifacts[12].size = "3482";
|
||||
artifacts[13] = new Artifact();
|
||||
artifacts[13].hash = "9264c6931c431e928dc64adc842584d5f57d17b2f3aff29221f2b3fdea673dad";
|
||||
artifacts[13].name = "guice-4.1.0-no_aop.jar";
|
||||
artifacts[13].path = "https://mvn.runelite.net/com/google/inject/guice/4.1.0/guice-4.1.0-no_aop.jar";
|
||||
artifacts[13].size = "428603";
|
||||
artifacts[14] = new Artifact();
|
||||
artifacts[14].hash = "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff";
|
||||
artifacts[14].name = "javax.inject-1.jar";
|
||||
artifacts[14].path = "https://mvn.runelite.net/javax/inject/javax.inject/1/javax.inject-1.jar";
|
||||
artifacts[14].size = "2497";
|
||||
artifacts[15] = new Artifact();
|
||||
artifacts[15].hash = "0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08";
|
||||
artifacts[15].name = "aopalliance-1.0.jar";
|
||||
artifacts[15].path = "https://mvn.runelite.net/aopalliance/aopalliance/1.0/aopalliance-1.0.jar";
|
||||
artifacts[15].size = "4467";
|
||||
artifacts[16] = new Artifact();
|
||||
artifacts[16].hash = "233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81";
|
||||
artifacts[16].name = "gson-2.8.5.jar";
|
||||
artifacts[16].path = "https://mvn.runelite.net/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar";
|
||||
artifacts[16].size = "241622";
|
||||
artifacts[17] = new Artifact();
|
||||
artifacts[17].hash = "0467d25f408428824d5c9c09ec60ee1f0bc341d9bf48971a77fd14939a826c83";
|
||||
artifacts[17].name = "substance-8.0.02.jar";
|
||||
artifacts[17].path = "https://repo.runelite.net/net/runelite/pushingpixels/substance/8.0.02/substance-8.0.02.jar";
|
||||
artifacts[17].size = "1589195";
|
||||
artifacts[18] = new Artifact();
|
||||
artifacts[18].hash = "3214e1c23d549d5d67c91da4da1ef33c5248470bb824f91cbe8f9e0beea59eef";
|
||||
artifacts[18].name = "trident-1.5.00.jar";
|
||||
artifacts[18].path = "https://repo.runelite.net/net/runelite/pushingpixels/trident/1.5.00/trident-1.5.00.jar";
|
||||
artifacts[18].size = "79726";
|
||||
artifacts[19] = new Artifact();
|
||||
artifacts[19].hash = "d4a57bbc1627da7c391308fd0fe910b83170fb66afd117236a5b111d2db1590b";
|
||||
artifacts[19].name = "commons-text-1.2.jar";
|
||||
artifacts[19].path = "https://mvn.runelite.net/org/apache/commons/commons-text/1.2/commons-text-1.2.jar";
|
||||
artifacts[19].size = "136544";
|
||||
artifacts[20] = new Artifact();
|
||||
artifacts[20].hash = "6e8dc31e046508d9953c96534edf0c2e0bfe6f468966b5b842b3f87e43b6a847";
|
||||
artifacts[20].name = "commons-lang3-3.7.jar";
|
||||
artifacts[20].path = "https://mvn.runelite.net/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar";
|
||||
artifacts[20].size = "499634";
|
||||
artifacts[21] = new Artifact();
|
||||
artifacts[21].hash = "e74603dc77b4183f108480279dbbf7fed3ac206069478636406c1fb45e83b31a";
|
||||
artifacts[21].name = "jogl-all-2.3.2.jar";
|
||||
artifacts[21].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2.jar";
|
||||
artifacts[21].size = "3414448";
|
||||
artifacts[22] = new Artifact();
|
||||
artifacts[22].hash = "8c53b1884cef19309d34fd10a94b010136d9d6de9a88c386f46006fb47acab5d";
|
||||
artifacts[22].name = "jogl-all-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[22].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[22].size = "240721";
|
||||
artifacts[23] = new Artifact();
|
||||
artifacts[23].hash = "507a0e6bd1ee4e81c3dfb287783af93775864eec742988d4162f98ce0cbac9d6";
|
||||
artifacts[23].name = "jogl-all-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[23].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[23].size = "209445";
|
||||
artifacts[24] = new Artifact();
|
||||
artifacts[24].hash = "82637302ae9effdf7d6f302e1050ad6aee3b13019914ddda5b502b9faa980216";
|
||||
artifacts[24].name = "jogl-all-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[24].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[24].size = "224010";
|
||||
artifacts[25] = new Artifact();
|
||||
artifacts[25].hash = "f474ef2ef01be24ec811d3858b0f4bc5659076975f4a58ddd79abd787e9305c7";
|
||||
artifacts[25].name = "jogl-all-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[25].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[25].size = "217274";
|
||||
artifacts[26] = new Artifact();
|
||||
artifacts[26].hash = "084844543b18f7ff71b4c0437852bd22f0cb68d7e44c2c611c1bbea76f8c6fdf";
|
||||
artifacts[26].name = "gluegen-rt-2.3.2.jar";
|
||||
artifacts[26].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2.jar";
|
||||
artifacts[26].size = "345605";
|
||||
artifacts[27] = new Artifact();
|
||||
artifacts[27].hash = "3474017422eff384db466bdb56c96c61220c43133a9da6329cf1781bea16c6b6";
|
||||
artifacts[27].name = "gluegen-rt-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[27].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[27].size = "8159";
|
||||
artifacts[28] = new Artifact();
|
||||
artifacts[28].hash = "4eeed9fc2ebea5b9dc48a342b9478d127e989a2e1aa7129b512a98ec75cde338";
|
||||
artifacts[28].name = "gluegen-rt-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[28].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[28].size = "7577";
|
||||
artifacts[29] = new Artifact();
|
||||
artifacts[29].hash = "f2dfd1800202059cf7e0294db5d57755147304e6eb220a9277526dbe6842bde2";
|
||||
artifacts[29].name = "gluegen-rt-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[29].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[29].size = "4149";
|
||||
artifacts[30] = new Artifact();
|
||||
artifacts[30].hash = "1365d463f98c0abec92f3ad6b35aa4b53a9599a517800cf99fdabea6712ca7ec";
|
||||
artifacts[30].name = "gluegen-rt-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[30].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[30].size = "4130";
|
||||
artifacts[31] = new Artifact();
|
||||
artifacts[31].hash = "7b7ae00e2aa98c3b2b5ac76e793e2c9b752bf51c86c54654dbd473843a25f1aa";
|
||||
artifacts[31].name = "jbsdiff-1.0.jar";
|
||||
artifacts[31].path = "https://mvn.runelite.net/io/sigpipe/jbsdiff/1.0/jbsdiff-1.0.jar";
|
||||
artifacts[31].size = "24589";
|
||||
artifacts[32] = new Artifact();
|
||||
artifacts[32].hash = "55bbfe26cee9296fd5b7c0d47ce6a00ea4dd572e235b63e9bb4eaf6f802315e4";
|
||||
artifacts[32].name = "commons-compress-1.5.jar";
|
||||
artifacts[32].path = "https://mvn.runelite.net/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar";
|
||||
artifacts[32].size = "256241";
|
||||
artifacts[33] = new Artifact();
|
||||
artifacts[33].hash = "fbc9de96a0cc193a125b4008dbc348e9ed54e5e13fc67b8ed40e645d303cc51b";
|
||||
artifacts[33].name = "jna-4.5.1.jar";
|
||||
artifacts[33].path = "https://mvn.runelite.net/net/java/dev/jna/jna/4.5.1/jna-4.5.1.jar";
|
||||
artifacts[33].size = "1440662";
|
||||
artifacts[34] = new Artifact();
|
||||
artifacts[34].hash = "84c8667555ee8dd91fef44b451419f6f16f71f727d5fc475a10c2663eba83abb";
|
||||
artifacts[34].name = "jna-platform-4.5.1.jar";
|
||||
artifacts[34].path = "https://mvn.runelite.net/net/java/dev/jna/jna-platform/4.5.1/jna-platform-4.5.1.jar";
|
||||
artifacts[34].size = "2327547";
|
||||
artifacts[38] = new Artifact();
|
||||
artifacts[38].hash = "f55abda036da75e1af45bd43b9dfa79b2a3d90905be9cb38687c6621597a8165";
|
||||
artifacts[38].name = "okhttp-3.7.0.jar";
|
||||
artifacts[38].path = "https://mvn.runelite.net/com/squareup/okhttp3/okhttp/3.7.0/okhttp-3.7.0.jar";
|
||||
artifacts[38].size = "394987";
|
||||
artifacts[39] = new Artifact();
|
||||
artifacts[39].hash = "bfe7dfe483c37137966a1690f0c7d0b448ba217902c1fed202aaffdbba3291ae";
|
||||
artifacts[39].name = "okio-1.12.0.jar";
|
||||
artifacts[39].path = "https://mvn.runelite.net/com/squareup/okio/okio/1.12.0/okio-1.12.0.jar";
|
||||
artifacts[39].size = "81088";
|
||||
artifacts[40] = new Artifact();
|
||||
artifacts[40].hash = "9d4924588d6280c7516db3a4b7298306db5b6f0d1cdf568ce738309b5660f008";
|
||||
artifacts[40].name = "commons-csv-1.4.jar";
|
||||
artifacts[40].path = "https://mvn.runelite.net/org/apache/commons/commons-csv/1.4/commons-csv-1.4.jar";
|
||||
artifacts[40].size = "39978";
|
||||
artifacts[41] = new Artifact();
|
||||
artifacts[41].hash = "7e26a8d043418f2f22d5f6a3083a9a131817009ee8cd72c004e83b50d1849a7c";
|
||||
artifacts[41].name = "discord-1.1.jar";
|
||||
artifacts[41].path = "https://repo.runelite.net/net/runelite/discord/1.1/discord-1.1.jar";
|
||||
artifacts[41].size = "617294";
|
||||
return bytesToHex(md.digest());
|
||||
|
||||
//Dynamic artifacts
|
||||
artifacts[3] = new Artifact();
|
||||
artifacts[3].name = "client-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[3].hash = getChecksumFile("./runelite-client/target/"+artifacts[3].name);
|
||||
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[3].name;
|
||||
artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/"+artifacts[3].name));
|
||||
artifacts[35] = new Artifact();
|
||||
artifacts[35].name = "runelite-api-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[35].hash = getChecksumFile("./runelite-api/target/"+artifacts[35].name);
|
||||
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[35].name;
|
||||
artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/"+artifacts[35].name));
|
||||
artifacts[36] = new Artifact();
|
||||
artifacts[36].name = "runescape-api-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[36].hash = getChecksumFile("./runescape-api/target/"+artifacts[36].name);
|
||||
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[36].name;
|
||||
artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/"+artifacts[36].name));
|
||||
artifacts[37] = new Artifact();
|
||||
artifacts[37].name = "http-api-"+ RuneLiteAPI.getVersion()+".jar";
|
||||
artifacts[37].hash = getChecksumFile("./http-api/target/"+artifacts[37].name);
|
||||
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/"+artifacts[37].name;
|
||||
artifacts[37].size = Long.toString(getFileSize("./http-api/target/"+artifacts[37].name));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return artifacts;
|
||||
}
|
||||
}
|
||||
|
||||
private static String bytesToHex(byte[] hashInBytes)
|
||||
{
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : hashInBytes)
|
||||
{
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
public static String getChecksumObject(Serializable object) throws IOException, NoSuchAlgorithmException {
|
||||
ByteArrayOutputStream baos = null;
|
||||
ObjectOutputStream oos = null;
|
||||
try {
|
||||
baos = new ByteArrayOutputStream();
|
||||
oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(object);
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] thedigest = md.digest(baos.toByteArray());
|
||||
return DatatypeConverter.printHexBinary(thedigest);
|
||||
} finally {
|
||||
oos.close();
|
||||
baos.close();
|
||||
}
|
||||
}
|
||||
private static String getChecksumFile(String filepath) throws IOException {
|
||||
System.out.println("Generating Hash for "+filepath);
|
||||
MessageDigest md = null;
|
||||
try {
|
||||
md = MessageDigest.getInstance("SHA-256");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try (DigestInputStream dis = new DigestInputStream(new FileInputStream(filepath), md)) {
|
||||
while (dis.read() != -1) ; //empty loop to clear the data
|
||||
md = dis.getMessageDigest();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return bytesToHex(md.digest());
|
||||
public Artifact[] getArtifacts()
|
||||
{
|
||||
try
|
||||
{
|
||||
artifacts = new Artifact[42];
|
||||
|
||||
}
|
||||
//Static artifacts
|
||||
artifacts[0] = new Artifact();
|
||||
artifacts[0].hash = "b12331da8683e5f107d294adeebb83ecf9124abc1db533554d2a8d3c62832d75";
|
||||
artifacts[0].name = "asm-all-6.0_BETA.jar";
|
||||
artifacts[0].path = "https://mvn.runelite.net/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA.jar";
|
||||
artifacts[0].size = "265176";
|
||||
artifacts[1] = new Artifact();
|
||||
artifacts[1].hash = "37abf0103ce5318bfda004fabc004c75ed0dc6d392a8459175692ab7eac97083";
|
||||
artifacts[1].name = "naturalmouse-2.0.0.jar";
|
||||
artifacts[1].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/naturalmouse-2.0.0.jar";
|
||||
artifacts[1].size = "3168921";
|
||||
artifacts[2] = new Artifact();
|
||||
artifacts[2].hash = "50d1e07f11827672249dee9ce8a23691fc59f663deed084bb7b52a4f778d5fbc";
|
||||
artifacts[2].name = "jcl-core-2.9-SNAPSHOT.jar";
|
||||
artifacts[2].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/jcl-core-2.9-SNAPSHOT.jar";
|
||||
artifacts[2].size = "3168921";
|
||||
artifacts[4] = new Artifact();
|
||||
artifacts[4].hash = "18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79";
|
||||
artifacts[4].name = "slf4j-api-1.7.25.jar";
|
||||
artifacts[4].path = "https://mvn.runelite.net/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar";
|
||||
artifacts[4].size = "41203";
|
||||
artifacts[5] = new Artifact();
|
||||
artifacts[5].hash = "fb53f8539e7fcb8f093a56e138112056ec1dc809ebb020b59d8a36a5ebac37e0";
|
||||
artifacts[5].name = "logback-classic-1.2.3.jar";
|
||||
artifacts[5].path = "https://mvn.runelite.net/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar";
|
||||
artifacts[5].size = "290339";
|
||||
artifacts[6] = new Artifact();
|
||||
artifacts[6].hash = "5946d837fe6f960c02a53eda7a6926ecc3c758bbdd69aa453ee429f858217f22";
|
||||
artifacts[6].name = "logback-core-1.2.3.jar";
|
||||
artifacts[6].path = "https://mvn.runelite.net/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar";
|
||||
artifacts[6].size = "471901";
|
||||
artifacts[7] = new Artifact();
|
||||
artifacts[7].hash = "9f0c8d50fa4b79b6ff1502dbec8502179d6b9497cacbe17a13074001aed537ec";
|
||||
artifacts[7].name = "jopt-simple-5.0.1.jar";
|
||||
artifacts[7].path = "https://mvn.runelite.net/net/sf/jopt-simple/jopt-simple/5.0.1/jopt-simple-5.0.1.jar";
|
||||
artifacts[7].size = "78826";
|
||||
artifacts[8] = new Artifact();
|
||||
artifacts[8].hash = "5be9a7d05ba0ccd74708bc8018ae412255f85843c0b92302e9b9befa6ed52564";
|
||||
artifacts[8].name = "guava-23.2-jre.jar";
|
||||
artifacts[8].path = "https://mvn.runelite.net/com/google/guava/guava/23.2-jre/guava-23.2-jre.jar";
|
||||
artifacts[8].size = "2649860";
|
||||
artifacts[9] = new Artifact();
|
||||
artifacts[9].hash = "905721a0eea90a81534abb7ee6ef4ea2e5e645fa1def0a5cd88402df1b46c9ed";
|
||||
artifacts[9].name = "jsr305-1.3.9.jar";
|
||||
artifacts[9].path = "https://mvn.runelite.net/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar";
|
||||
artifacts[9].size = "33015";
|
||||
artifacts[10] = new Artifact();
|
||||
artifacts[10].hash = "cb4cfad870bf563a07199f3ebea5763f0dec440fcda0b318640b1feaa788656b";
|
||||
artifacts[10].name = "error_prone_annotations-2.0.18.jar";
|
||||
artifacts[10].path = "https://mvn.runelite.net/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar";
|
||||
artifacts[10].size = "12078";
|
||||
artifacts[11] = new Artifact();
|
||||
artifacts[11].hash = "2994a7eb78f2710bd3d3bfb639b2c94e219cedac0d4d084d516e78c16dddecf6";
|
||||
artifacts[11].name = "j2objc-annotations-1.1.jar";
|
||||
artifacts[11].path = "https://mvn.runelite.net/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar";
|
||||
artifacts[11].size = "8782";
|
||||
artifacts[12] = new Artifact();
|
||||
artifacts[12].hash = "2068320bd6bad744c3673ab048f67e30bef8f518996fa380033556600669905d";
|
||||
artifacts[12].name = "animal-sniffer-annotations-1.14.jar";
|
||||
artifacts[12].path = "https://mvn.runelite.net/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar";
|
||||
artifacts[12].size = "3482";
|
||||
artifacts[13] = new Artifact();
|
||||
artifacts[13].hash = "9264c6931c431e928dc64adc842584d5f57d17b2f3aff29221f2b3fdea673dad";
|
||||
artifacts[13].name = "guice-4.1.0-no_aop.jar";
|
||||
artifacts[13].path = "https://mvn.runelite.net/com/google/inject/guice/4.1.0/guice-4.1.0-no_aop.jar";
|
||||
artifacts[13].size = "428603";
|
||||
artifacts[14] = new Artifact();
|
||||
artifacts[14].hash = "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff";
|
||||
artifacts[14].name = "javax.inject-1.jar";
|
||||
artifacts[14].path = "https://mvn.runelite.net/javax/inject/javax.inject/1/javax.inject-1.jar";
|
||||
artifacts[14].size = "2497";
|
||||
artifacts[15] = new Artifact();
|
||||
artifacts[15].hash = "0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08";
|
||||
artifacts[15].name = "aopalliance-1.0.jar";
|
||||
artifacts[15].path = "https://mvn.runelite.net/aopalliance/aopalliance/1.0/aopalliance-1.0.jar";
|
||||
artifacts[15].size = "4467";
|
||||
artifacts[16] = new Artifact();
|
||||
artifacts[16].hash = "233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81";
|
||||
artifacts[16].name = "gson-2.8.5.jar";
|
||||
artifacts[16].path = "https://mvn.runelite.net/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar";
|
||||
artifacts[16].size = "241622";
|
||||
artifacts[17] = new Artifact();
|
||||
artifacts[17].hash = "0467d25f408428824d5c9c09ec60ee1f0bc341d9bf48971a77fd14939a826c83";
|
||||
artifacts[17].name = "substance-8.0.02.jar";
|
||||
artifacts[17].path = "https://repo.runelite.net/net/runelite/pushingpixels/substance/8.0.02/substance-8.0.02.jar";
|
||||
artifacts[17].size = "1589195";
|
||||
artifacts[18] = new Artifact();
|
||||
artifacts[18].hash = "3214e1c23d549d5d67c91da4da1ef33c5248470bb824f91cbe8f9e0beea59eef";
|
||||
artifacts[18].name = "trident-1.5.00.jar";
|
||||
artifacts[18].path = "https://repo.runelite.net/net/runelite/pushingpixels/trident/1.5.00/trident-1.5.00.jar";
|
||||
artifacts[18].size = "79726";
|
||||
artifacts[19] = new Artifact();
|
||||
artifacts[19].hash = "d4a57bbc1627da7c391308fd0fe910b83170fb66afd117236a5b111d2db1590b";
|
||||
artifacts[19].name = "commons-text-1.2.jar";
|
||||
artifacts[19].path = "https://mvn.runelite.net/org/apache/commons/commons-text/1.2/commons-text-1.2.jar";
|
||||
artifacts[19].size = "136544";
|
||||
artifacts[20] = new Artifact();
|
||||
artifacts[20].hash = "6e8dc31e046508d9953c96534edf0c2e0bfe6f468966b5b842b3f87e43b6a847";
|
||||
artifacts[20].name = "commons-lang3-3.7.jar";
|
||||
artifacts[20].path = "https://mvn.runelite.net/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar";
|
||||
artifacts[20].size = "499634";
|
||||
artifacts[21] = new Artifact();
|
||||
artifacts[21].hash = "e74603dc77b4183f108480279dbbf7fed3ac206069478636406c1fb45e83b31a";
|
||||
artifacts[21].name = "jogl-all-2.3.2.jar";
|
||||
artifacts[21].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2.jar";
|
||||
artifacts[21].size = "3414448";
|
||||
artifacts[22] = new Artifact();
|
||||
artifacts[22].hash = "8c53b1884cef19309d34fd10a94b010136d9d6de9a88c386f46006fb47acab5d";
|
||||
artifacts[22].name = "jogl-all-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[22].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[22].size = "240721";
|
||||
artifacts[23] = new Artifact();
|
||||
artifacts[23].hash = "507a0e6bd1ee4e81c3dfb287783af93775864eec742988d4162f98ce0cbac9d6";
|
||||
artifacts[23].name = "jogl-all-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[23].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[23].size = "209445";
|
||||
artifacts[24] = new Artifact();
|
||||
artifacts[24].hash = "82637302ae9effdf7d6f302e1050ad6aee3b13019914ddda5b502b9faa980216";
|
||||
artifacts[24].name = "jogl-all-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[24].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[24].size = "224010";
|
||||
artifacts[25] = new Artifact();
|
||||
artifacts[25].hash = "f474ef2ef01be24ec811d3858b0f4bc5659076975f4a58ddd79abd787e9305c7";
|
||||
artifacts[25].name = "jogl-all-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[25].path = "https://mvn.runelite.net/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[25].size = "217274";
|
||||
artifacts[26] = new Artifact();
|
||||
artifacts[26].hash = "084844543b18f7ff71b4c0437852bd22f0cb68d7e44c2c611c1bbea76f8c6fdf";
|
||||
artifacts[26].name = "gluegen-rt-2.3.2.jar";
|
||||
artifacts[26].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2.jar";
|
||||
artifacts[26].size = "345605";
|
||||
artifacts[27] = new Artifact();
|
||||
artifacts[27].hash = "3474017422eff384db466bdb56c96c61220c43133a9da6329cf1781bea16c6b6";
|
||||
artifacts[27].name = "gluegen-rt-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[27].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-windows-amd64.jar";
|
||||
artifacts[27].size = "8159";
|
||||
artifacts[28] = new Artifact();
|
||||
artifacts[28].hash = "4eeed9fc2ebea5b9dc48a342b9478d127e989a2e1aa7129b512a98ec75cde338";
|
||||
artifacts[28].name = "gluegen-rt-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[28].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-windows-i586.jar";
|
||||
artifacts[28].size = "7577";
|
||||
artifacts[29] = new Artifact();
|
||||
artifacts[29].hash = "f2dfd1800202059cf7e0294db5d57755147304e6eb220a9277526dbe6842bde2";
|
||||
artifacts[29].name = "gluegen-rt-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[29].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-linux-amd64.jar";
|
||||
artifacts[29].size = "4149";
|
||||
artifacts[30] = new Artifact();
|
||||
artifacts[30].hash = "1365d463f98c0abec92f3ad6b35aa4b53a9599a517800cf99fdabea6712ca7ec";
|
||||
artifacts[30].name = "gluegen-rt-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[30].path = "https://mvn.runelite.net/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2-natives-linux-i586.jar";
|
||||
artifacts[30].size = "4130";
|
||||
artifacts[31] = new Artifact();
|
||||
artifacts[31].hash = "7b7ae00e2aa98c3b2b5ac76e793e2c9b752bf51c86c54654dbd473843a25f1aa";
|
||||
artifacts[31].name = "jbsdiff-1.0.jar";
|
||||
artifacts[31].path = "https://mvn.runelite.net/io/sigpipe/jbsdiff/1.0/jbsdiff-1.0.jar";
|
||||
artifacts[31].size = "24589";
|
||||
artifacts[32] = new Artifact();
|
||||
artifacts[32].hash = "55bbfe26cee9296fd5b7c0d47ce6a00ea4dd572e235b63e9bb4eaf6f802315e4";
|
||||
artifacts[32].name = "commons-compress-1.5.jar";
|
||||
artifacts[32].path = "https://mvn.runelite.net/org/apache/commons/commons-compress/1.5/commons-compress-1.5.jar";
|
||||
artifacts[32].size = "256241";
|
||||
artifacts[33] = new Artifact();
|
||||
artifacts[33].hash = "fbc9de96a0cc193a125b4008dbc348e9ed54e5e13fc67b8ed40e645d303cc51b";
|
||||
artifacts[33].name = "jna-4.5.1.jar";
|
||||
artifacts[33].path = "https://mvn.runelite.net/net/java/dev/jna/jna/4.5.1/jna-4.5.1.jar";
|
||||
artifacts[33].size = "1440662";
|
||||
artifacts[34] = new Artifact();
|
||||
artifacts[34].hash = "84c8667555ee8dd91fef44b451419f6f16f71f727d5fc475a10c2663eba83abb";
|
||||
artifacts[34].name = "jna-platform-4.5.1.jar";
|
||||
artifacts[34].path = "https://mvn.runelite.net/net/java/dev/jna/jna-platform/4.5.1/jna-platform-4.5.1.jar";
|
||||
artifacts[34].size = "2327547";
|
||||
artifacts[38] = new Artifact();
|
||||
artifacts[38].hash = "f55abda036da75e1af45bd43b9dfa79b2a3d90905be9cb38687c6621597a8165";
|
||||
artifacts[38].name = "okhttp-3.7.0.jar";
|
||||
artifacts[38].path = "https://mvn.runelite.net/com/squareup/okhttp3/okhttp/3.7.0/okhttp-3.7.0.jar";
|
||||
artifacts[38].size = "394987";
|
||||
artifacts[39] = new Artifact();
|
||||
artifacts[39].hash = "bfe7dfe483c37137966a1690f0c7d0b448ba217902c1fed202aaffdbba3291ae";
|
||||
artifacts[39].name = "okio-1.12.0.jar";
|
||||
artifacts[39].path = "https://mvn.runelite.net/com/squareup/okio/okio/1.12.0/okio-1.12.0.jar";
|
||||
artifacts[39].size = "81088";
|
||||
artifacts[40] = new Artifact();
|
||||
artifacts[40].hash = "9d4924588d6280c7516db3a4b7298306db5b6f0d1cdf568ce738309b5660f008";
|
||||
artifacts[40].name = "commons-csv-1.4.jar";
|
||||
artifacts[40].path = "https://mvn.runelite.net/org/apache/commons/commons-csv/1.4/commons-csv-1.4.jar";
|
||||
artifacts[40].size = "39978";
|
||||
artifacts[41] = new Artifact();
|
||||
artifacts[41].hash = "7e26a8d043418f2f22d5f6a3083a9a131817009ee8cd72c004e83b50d1849a7c";
|
||||
artifacts[41].name = "discord-1.1.jar";
|
||||
artifacts[41].path = "https://repo.runelite.net/net/runelite/discord/1.1/discord-1.1.jar";
|
||||
artifacts[41].size = "617294";
|
||||
|
||||
private static String bytesToHex(byte[] hashInBytes) {
|
||||
//Dynamic artifacts
|
||||
artifacts[3] = new Artifact();
|
||||
artifacts[3].name = "client-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[3].hash = getChecksumFile("./runelite-client/target/" + artifacts[3].name);
|
||||
artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[3].name;
|
||||
artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/" + artifacts[3].name));
|
||||
artifacts[35] = new Artifact();
|
||||
artifacts[35].name = "runelite-api-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[35].hash = getChecksumFile("./runelite-api/target/" + artifacts[35].name);
|
||||
artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[35].name;
|
||||
artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/" + artifacts[35].name));
|
||||
artifacts[36] = new Artifact();
|
||||
artifacts[36].name = "runescape-api-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[36].hash = getChecksumFile("./runescape-api/target/" + artifacts[36].name);
|
||||
artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[36].name;
|
||||
artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/" + artifacts[36].name));
|
||||
artifacts[37] = new Artifact();
|
||||
artifacts[37].name = "http-api-" + RuneLiteAPI.getVersion() + ".jar";
|
||||
artifacts[37].hash = getChecksumFile("./http-api/target/" + artifacts[37].name);
|
||||
artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/live/" + artifacts[37].name;
|
||||
artifacts[37].size = Long.toString(getFileSize("./http-api/target/" + artifacts[37].name));
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : hashInBytes) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
|
||||
private long getFileSize(String fileLocation) {
|
||||
File f = new File(fileLocation);
|
||||
return f.length();
|
||||
}
|
||||
private long getFileSize(String fileLocation)
|
||||
{
|
||||
File f = new File(fileLocation);
|
||||
return f.length();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,24 +2,24 @@ package net.runelite.client.util.bootstrap;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Bootstrapper {
|
||||
public class Bootstrapper
|
||||
{
|
||||
|
||||
public static void main(String[] args) {
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
|
||||
try {
|
||||
FileWriter fw = new FileWriter("./bootstrap.json");
|
||||
gson.toJson(new Bootstrap(), fw);
|
||||
fw.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
|
||||
try
|
||||
{
|
||||
FileWriter fw = new FileWriter("./bootstrap.json");
|
||||
gson.toJson(new Bootstrap(), fw);
|
||||
fw.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package net.runelite.client.util.bootstrap;
|
||||
|
||||
public class Client {
|
||||
public class Client
|
||||
{
|
||||
|
||||
String artifactId = "client";
|
||||
String classifier = "";
|
||||
String extension = "jar";
|
||||
String groupId = "net.runelite";
|
||||
String properties = "";
|
||||
String version = "1.5.27";
|
||||
String artifactId = "client";
|
||||
String classifier = "";
|
||||
String extension = "jar";
|
||||
String groupId = "net.runelite";
|
||||
String properties = "";
|
||||
String version = "1.5.27";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user