Skip to content

Commit

Permalink
Merge pull request open-osrs#3213 from open-osrs/bumpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Owain94 authored Jun 11, 2022
2 parents 5b455cb + a6763ba commit 7e72b43
Show file tree
Hide file tree
Showing 71 changed files with 2,059 additions and 970 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

object ProjectVersions {
const val launcherVersion = "3.0.0"
const val rlVersion = "1.8.21"
const val rlVersion = "1.8.22"

const val openosrsVersion = "4.28.0"
const val openosrsVersion = "4.29.0"

const val rsversion = 205
const val cacheversion = 165
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
import com.openosrs.injector.InjectUtil;
import com.openosrs.injector.injection.InjectData;
import com.openosrs.injector.injectors.AbstractInjector;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import net.runelite.asm.Method;
import net.runelite.asm.attributes.code.Instruction;
import net.runelite.asm.attributes.code.InstructionType;
import net.runelite.asm.attributes.code.Instructions;
import net.runelite.asm.attributes.code.Label;
import net.runelite.asm.attributes.code.instruction.types.ComparisonInstruction;
Expand All @@ -32,8 +29,6 @@
import net.runelite.asm.attributes.code.instructions.IfICmpNe;
import net.runelite.asm.attributes.code.instructions.IfNe;
import net.runelite.asm.attributes.code.instructions.InvokeStatic;
import net.runelite.asm.attributes.code.instructions.LDC;
import net.runelite.asm.attributes.code.instructions.Return;
import net.runelite.asm.pool.Field;

public class AddPlayerToMenu extends AbstractInjector
Expand All @@ -45,15 +40,15 @@ public AddPlayerToMenu(InjectData inject)

public void inject()
{
final Method addPlayerOptions = InjectUtil.findMethod(inject, "addPlayerToMenu");
final Method addPlayerOptions = inject.toVanilla(inject.getDeobfuscated().findClass("Scene")).findMethod("copy$addPlayerToMenu");
final net.runelite.asm.pool.Method shouldHideAttackOptionFor =
inject.getVanilla().findClass("client").findMethod("shouldHideAttackOptionFor").getPoolMethod();
final net.runelite.asm.pool.Method shouldDrawMethod =
inject.getVanilla().findStaticMethod("shouldDraw").getPoolMethod();
// final net.runelite.asm.pool.Method shouldDrawMethod =
// inject.getVanilla().findStaticMethod("shouldDraw").getPoolMethod();

try
{
injectSameTileFix(addPlayerOptions, shouldDrawMethod);
// injectSameTileFix(addPlayerOptions, shouldDrawMethod);
injectHideAttack(addPlayerOptions, shouldHideAttackOptionFor);
injectHideCast(addPlayerOptions, shouldHideAttackOptionFor);
}
Expand All @@ -63,32 +58,32 @@ public void inject()
}
}

private void injectSameTileFix(Method addPlayerOptions, net.runelite.asm.pool.Method shouldDrawMethod)
{
// ALOAD 0
// ICONST_0
// INVOKESTATIC Scene.shouldDraw
// IFNE CONTINUE_LABEL if returned true then jump to continue
// RETURN
// CONTINUE_LABEL
// REST OF METHOD GOES HERE
Instructions insns = addPlayerOptions.getCode().getInstructions();
Label CONTINUE_LABEL = new Label(insns);
List<Instruction> prependList = new ArrayList<>()
{{
add(new ALoad(insns, 0));
add(new LDC(insns, 0));
add(new InvokeStatic(insns, shouldDrawMethod));
add(new IfNe(insns, CONTINUE_LABEL));
add(new Return(insns, InstructionType.RETURN));
add(CONTINUE_LABEL);
}};
int i = 0;
for (Instruction instruction : prependList)
{
insns.addInstruction(i++, instruction);
}
}
// private void injectSameTileFix(Method addPlayerOptions, net.runelite.asm.pool.Method shouldDrawMethod)
// {
// // ALOAD 0
// // ICONST_0
// // INVOKESTATIC Scene.shouldDraw
// // IFNE CONTINUE_LABEL if returned true then jump to continue
// // RETURN
// // CONTINUE_LABEL
// // REST OF METHOD GOES HERE
// Instructions insns = addPlayerOptions.getCode().getInstructions();
// Label CONTINUE_LABEL = new Label(insns);
// List<Instruction> prependList = new ArrayList<>()
// {{
// add(new ALoad(insns, 0));
// add(new LDC(insns, 0));
// add(new InvokeStatic(insns, shouldDrawMethod));
// add(new IfNe(insns, CONTINUE_LABEL));
// add(new Return(insns, InstructionType.RETURN));
// add(CONTINUE_LABEL);
// }};
// int i = 0;
// for (Instruction instruction : prependList)
// {
// insns.addInstruction(i++, instruction);
// }
// }

private void injectHideAttack(Method addPlayerOptions, net.runelite.asm.pool.Method shouldHideAttackOptionFor)
{
Expand Down
163 changes: 7 additions & 156 deletions runelite-api/src/main/java/net/runelite/api/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,13 @@ public interface Client extends OAuthApi, GameEngine
@Nonnull
ItemComposition getItemComposition(int id);

/**
* Get the local player's follower, such as a pet
* @return
*/
@Nullable
NPC getFollower();

/**
* Gets the item composition corresponding to an items ID.
*
Expand Down Expand Up @@ -1748,162 +1755,6 @@ Projectile createProjectile(int id, int plane, int startX, int startY, int start
*/
int getItemPressedDuration();

/**
* Sets whether the client is hiding entities.
* <p>
* This method does not itself hide any entities. It behaves as a master
* switch for whether or not any of the related entities are hidden or
* shown. If this method is set to false, changing the configurations for
* specific entities will have no effect.
*
* @param state new entity hiding state
*/
void setIsHidingEntities(boolean state);

/**
* Sets whether or not other players are hidden.
*
* @param state the new player hidden state
*/
void setOthersHidden(boolean state);

/**
* Sets whether 2D sprites related to the other players are hidden.
* (ie. overhead prayers, PK skull)
*
* @param state the new player 2D hidden state
*/
void setOthersHidden2D(boolean state);

/**
* Sets whether or not friends are hidden.
*
* @param state the new friends hidden state
*/
void setFriendsHidden(boolean state);

/**
* Sets whether or not friends chat members are hidden.
*
* @param state the new friends chat member hidden state
*/
void setFriendsChatMembersHidden(boolean state);

/**
* Sets whether or not clan members are hidden.
*
* @param state the new clan chat member hidden state
*/
void setClanChatMembersHidden(boolean state);

/**
* Sets whether or not ignored players are hidden.
*
* @param state the new ignored player hidden state
*/
void setIgnoresHidden(boolean state);

/**
* Sets whether the local player is hidden.
*
* @param state new local player hidden state
*/
void setLocalPlayerHidden(boolean state);

/**
* Sets whether 2D sprites related to the local player are hidden.
* (ie. overhead prayers, PK skull)
*
* @param state new local player 2D hidden state
*/
void setLocalPlayerHidden2D(boolean state);

/**
* Sets whether NPCs are hidden.
*
* @param state new NPC hidden state
*/
void setNPCsHidden(boolean state);

/**
* Sets whether 2D sprites (ie. overhead prayers) related to
* the NPCs are hidden.
*
* @param state new NPC 2D hidden state
*/
void setNPCsHidden2D(boolean state);

/**
* Sets whether Pets from other players are hidden.
*
* @param state new pet hidden state
*/
void setPetsHidden(boolean state);

/**
* Sets whether attacking players or NPCs are hidden.
*
* @param state new attacker hidden state
*/
void setAttackersHidden(boolean state);

/**
* Hides players input here.
*
* @param names the names of the players
*/
void setHideSpecificPlayers(List<String> names);

/**
* Get the list of NPC indices that are currently hidden
*
* @return all of the current hidden NPC Indices
*/
List<Integer> getHiddenNpcIndices();

/**
* If an NPC index is in this List then do not render it
*
* @param npcIndices the npc indices to hide
*/
void setHiddenNpcIndices(List<Integer> npcIndices);

/**
* Increments the counter for how many times this npc has been selected to be hidden
*
* @param name npc name
*/
void addHiddenNpcName(String name);

/**
* Decrements the counter for how many times this npc has been selected to be hidden
*
* @param name npc name
*/
void removeHiddenNpcName(String name);

/**
* Sets whether projectiles are hidden.
*
* @param state new projectile hidden state
*/
void setProjectilesHidden(boolean state);

/**
* Sets whether dead NPCs are hidden.
*
* @param state new NPC hidden state
*/
void setDeadNPCsHidden(boolean state);

/**
* The provided ids will not be hidden when the
* entity-hider attempts to hide dead {@link NPC}'s.
*
* @param blacklist set of npc ids.
*/
void setBlacklistDeadNpcs(Set<Integer> blacklist);

/**
* Adds a custom clientscript to the list of available clientscripts.
*
Expand Down
12 changes: 12 additions & 0 deletions runelite-api/src/main/java/net/runelite/api/ItemID.java
Original file line number Diff line number Diff line change
Expand Up @@ -12677,5 +12677,17 @@ public final class ItemID
public static final int VOID_MELEE_HELM_LOR = 27007;
public static final int DRAGON_DEFENDER_LT = 27008;
public static final int RUNE_DEFENDER_LT = 27009;
public static final int PREFORM = 27010;
public static final int DOUBLE_AMMO_MOULD = 27012;
public static final int KOVACS_GROG = 27014;
public static final int SMITHING_CATALYST = 27017;
public static final int ORE_PACK = 27019;
public static final int COLOSSAL_BLADE = 27021;
public static final int SMITHS_TUNIC = 27023;
public static final int SMITHS_TROUSERS = 27025;
public static final int SMITHS_BOOTS = 27027;
public static final int SMITHS_GLOVES = 27029;
public static final int SMITHS_GLOVES_I = 27031;
public static final int GIANTS_FOUNDRY_TESTER = 27033;
/* This file is automatically generated. Do not edit. */
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ public interface NameableContainer<T extends Nameable>
*/
int getCount();

/**
* Get the maximum size of the container.
*
* @return
*/
int getSize();

/**
* Get the members in this container
*
Expand Down
6 changes: 6 additions & 0 deletions runelite-api/src/main/java/net/runelite/api/NpcID.java
Original file line number Diff line number Diff line change
Expand Up @@ -9650,6 +9650,12 @@ public final class NpcID
public static final int REANIMATED_HELLHOUND = 11463;
public static final int APPRENTICE_TAMARA_11464 = 11464;
public static final int APPRENTICE_TAMARA_11465 = 11465;
public static final int SMITHING_CATALYST = 11466;
public static final int HILL_GIANT_11467 = 11467;
public static final int KOVAC = 11468;
public static final int KOVAC_11469 = 11469;
public static final int KOVAC_11470 = 11470;
public static final int KOVAC_11472 = 11472;
public static final int TARIK_11473 = 11473;
public static final int MAISA_11474 = 11474;
public static final int MAISA_11475 = 11475;
Expand Down
13 changes: 13 additions & 0 deletions runelite-api/src/main/java/net/runelite/api/NullItemID.java
Original file line number Diff line number Diff line change
Expand Up @@ -14122,5 +14122,18 @@ public final class NullItemID
public static final int NULL_26995 = 26995;
public static final int NULL_26998 = 26998;
public static final int NULL_26999 = 26999;
public static final int NULL_27011 = 27011;
public static final int NULL_27013 = 27013;
public static final int NULL_27015 = 27015;
public static final int NULL_27016 = 27016;
public static final int NULL_27018 = 27018;
public static final int NULL_27020 = 27020;
public static final int NULL_27022 = 27022;
public static final int NULL_27024 = 27024;
public static final int NULL_27026 = 27026;
public static final int NULL_27028 = 27028;
public static final int NULL_27030 = 27030;
public static final int NULL_27032 = 27032;
public static final int NULL_27034 = 27034;
/* This file is automatically generated. Do not edit. */
}
2 changes: 2 additions & 0 deletions runelite-api/src/main/java/net/runelite/api/NullNpcID.java
Original file line number Diff line number Diff line change
Expand Up @@ -1801,8 +1801,10 @@ public final class NullNpcID
public static final int NULL_11461 = 11461;
public static final int NULL_11471 = 11471;
public static final int NULL_11488 = 11488;
public static final int NULL_11494 = 11494;
public static final int NULL_11512 = 11512;
public static final int NULL_11559 = 11559;
public static final int NULL_11560 = 11560;
public static final int NULL_11567 = 11567;
public static final int NULL_11568 = 11568;
public static final int NULL_11611 = 11611;
Expand Down
Loading

0 comments on commit 7e72b43

Please sign in to comment.