Skip to content

Commit

Permalink
Merge branch 'master' into banktag-layouts-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jun 26, 2024
2 parents 034f0cd + 3a92282 commit 1f59cd8
Show file tree
Hide file tree
Showing 65 changed files with 358 additions and 194 deletions.
2 changes: 1 addition & 1 deletion cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.33-SNAPSHOT</version>
<version>1.10.34-SNAPSHOT</version>
</parent>

<artifactId>cache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ public class NpcDefinition
public boolean lowPriorityFollowerOps;
public Map<Integer, Object> params;
public int category;
public int height = -1;
public int[] stats = {1, 1, 1, 1, 1, 1};
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,30 @@ else if (opcode == 60)
{
def.chatheadModels[index] = stream.readUnsignedShort();
}

}
else if (opcode == 74)
{
def.stats[0] = stream.readUnsignedShort();
}
else if (opcode == 75)
{
def.stats[1] = stream.readUnsignedShort();
}
else if (opcode == 76)
{
def.stats[2] = stream.readUnsignedShort();
}
else if (opcode == 77)
{
def.stats[3] = stream.readUnsignedShort();
}
else if (opcode == 78)
{
def.stats[4] = stream.readUnsignedShort();
}
else if (opcode == 79)
{
def.stats[5] = stream.readUnsignedShort();
}
else if (opcode == 93)
{
Expand Down Expand Up @@ -333,6 +356,10 @@ else if (opcode == 123)
{
def.lowPriorityFollowerOps = true;
}
else if (opcode == 124)
{
def.height = stream.readUnsignedShort();
}
else if (opcode == 249)
{
length = stream.readUnsignedByte();
Expand Down
21 changes: 19 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.33-SNAPSHOT</version>
<version>1.10.34-SNAPSHOT</version>
<packaging>pom</packaging>

<name>RuneLite</name>
Expand All @@ -47,7 +47,7 @@
<checkstyle.skip>true</checkstyle.skip>
<glslang.path></glslang.path>

<rs.version>222</rs.version>
<rs.version>223</rs.version>
</properties>

<licenses>
Expand Down Expand Up @@ -309,6 +309,23 @@
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.22.0</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
2 changes: 1 addition & 1 deletion runelite-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.33-SNAPSHOT</version>
<version>1.10.34-SNAPSHOT</version>
</parent>

<artifactId>runelite-api</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions runelite-api/src/main/java/net/runelite/api/ItemID.java
Original file line number Diff line number Diff line change
Expand Up @@ -3715,10 +3715,10 @@ public final class ItemID
public static final int LEDERHOSEN_SHORTS = 6181;
public static final int LEDERHOSEN_HAT = 6182;
public static final int FROG_TOKEN = 6183;
public static final int PRINCE_TUNIC = 6184;
public static final int PRINCE_LEGGINGS = 6185;
public static final int PRINCESS_BLOUSE = 6186;
public static final int PRINCESS_SKIRT = 6187;
public static final int ROYAL_FROG_TUNIC = 6184;
public static final int ROYAL_FROG_LEGGINGS = 6185;
public static final int ROYAL_FROG_BLOUSE = 6186;
public static final int ROYAL_FROG_SKIRT = 6187;
public static final int FROG_MASK = 6188;
public static final int MYSTERY_BOX = 6199;
public static final int RAW_FISHLIKE_THING = 6200;
Expand Down
11 changes: 7 additions & 4 deletions runelite-api/src/main/java/net/runelite/api/NpcID.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ public final class NpcID
public static final int REACHER_389 = 389;
public static final int EVIL_BOB = 390;
public static final int EVIL_BOB_391 = 391;
public static final int TROTTERS = 392;
public static final int SERVANT = 393;
public static final int ROD_FISHING_SPOT = 394;
public static final int CAT = 395;
Expand Down Expand Up @@ -749,8 +750,8 @@ public final class NpcID
public static final int SKRAELING_774 = 774;
public static final int FISHMONGER = 775;
public static final int GREENGROCER = 776;
public static final int ETHEREAL_MAN = 777;
public static final int ETHEREAL_LADY = 778;
public static final int ETHEREAL_BEING = 777;
public static final int ETHEREAL_BEING_778 = 778;
public static final int ETHEREAL_NUMERATOR = 779;
public static final int ETHEREAL_EXPERT = 780;
public static final int ETHEREAL_PERCEPTIVE = 781;
Expand Down Expand Up @@ -5038,8 +5039,6 @@ public final class NpcID
public static final int FROG_5431 = 5431;
public static final int FROG_5432 = 5432;
public static final int CALEB_5433 = 5433;
public static final int FROG_PRINCE = 5434;
public static final int FROG_PRINCESS = 5435;
public static final int NILES = 5436;
public static final int MILES = 5437;
public static final int GILES = 5438;
Expand Down Expand Up @@ -11294,6 +11293,10 @@ public final class NpcID
public static final int KIT_BREAKER_13436 = 13436;
public static final int SIR_KIT_BREAKER = 13437;
public static final int SIR_KIT_BREAKER_13438 = 13438;
public static final int FROG_PRIN = 13443;
public static final int FROG_PRIN_13444 = 13444;
public static final int FROG_PRINCE = 13445;
public static final int FROG_PRINCESS = 13446;
public static final int ENRAGED_BLOOD_MOON = 13485;
public static final int ENRAGED_BLUE_MOON = 13486;
public static final int ENRAGED_ECLIPSE_MOON = 13487;
Expand Down
23 changes: 10 additions & 13 deletions runelite-client/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod">
<properties>
<property name="ignoredAnnotations"
value="net.runelite.client.eventbus.Subscribe|com.google.inject.Provides"/>
value="net.runelite.client.eventbus.Subscribe,com.google.inject.Provides"/>
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/UseTryWithResources"/>
Expand All @@ -53,13 +53,20 @@
<!-- code style -->
<rule ref="category/java/codestyle.xml/AvoidProtectedFieldInFinalClass"/>
<rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending"/>
<rule ref="category/java/codestyle.xml/EmptyControlStatement"/>
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop"/>
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
<rule ref="category/java/codestyle.xml/PackageCase"/>
<rule ref="category/java/codestyle.xml/UnnecessaryBoxing"/>
<rule ref="category/java/codestyle.xml/UnnecessaryCast"/>
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor"/>
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName">
<properties>
<property name="reportStaticMethods" value="false" />
<property name="reportStaticFields" value="false" />
</properties>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
<rule ref="category/java/codestyle.xml/UnnecessaryModifier"/>
<rule ref="category/java/codestyle.xml/UseDiamondOperator"/>
Expand All @@ -68,23 +75,14 @@
<!-- design -->
<rule ref="category/java/design.xml/AvoidThrowingNewInstanceOfSameException"/>
<rule ref="category/java/design.xml/FinalFieldCouldBeStatic"/>
<rule ref="category/java/design.xml/ImmutableField">
<properties>
<property name="ignoredAnnotations"
value="lombok.Setter|lombok.Getter|lombok.Builder|lombok.Data|lombok.RequiredArgsConstructor|lombok.AllArgsConstructor|lombok.Value|lombok.NoArgsConstructor|javax.inject.Inject|com.google.inject.Inject"/>
</properties>
</rule>
<rule ref="category/java/design.xml/ImmutableField"/>
<rule ref="category/java/design.xml/SimplifyBooleanExpressions"/>
<rule ref="category/java/design.xml/SimplifyConditional"/>
<rule ref="category/java/design.xml/UselessOverridingMethod"/>

<!-- error prone -->
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
<rule ref="category/java/errorprone.xml/DontImportSun"/>
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock"/>
<rule ref="category/java/errorprone.xml/EmptyIfStmt"/>
<rule ref="category/java/errorprone.xml/EmptyInitializer"/>
<rule ref="category/java/errorprone.xml/EmptyStatementBlock"/>
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat"/>
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
Expand All @@ -100,5 +98,4 @@
</properties>
</rule>
<rule ref="category/java/performance.xml/InefficientStringBuffering"/>
<rule ref="category/java/performance.xml/UnnecessaryWrapperObjectCreation"/>
</ruleset>
15 changes: 1 addition & 14 deletions runelite-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>net.runelite</groupId>
<artifactId>runelite-parent</artifactId>
<version>1.10.33-SNAPSHOT</version>
<version>1.10.34-SNAPSHOT</version>
</parent>

<artifactId>client</artifactId>
Expand Down Expand Up @@ -448,19 +448,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.16.0</version>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>6.44.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>6.44.0</version>
</dependency>
</dependencies>
<configuration>
<failOnViolation>true</failOnViolation>
<printFailingErrors>true</printFailingErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static void main(String[] args) throws Exception
.withRequiredArg()
.ofType(ClientUpdateCheckMode.class)
.defaultsTo(ClientUpdateCheckMode.AUTO)
.withValuesConvertedBy(new EnumConverter<ClientUpdateCheckMode>(ClientUpdateCheckMode.class)
.withValuesConvertedBy(new EnumConverter<>(ClientUpdateCheckMode.class)
{
@Override
public ClientUpdateCheckMode convert(String v)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void onFailure(Call call, IOException e)
@Override
public void onResponse(Call call, Response response)
{
try // NOPMD: UseTryWithResources
try (response)
{
RuntimeConfig config = RuneLiteAPI.GSON.fromJson(response.body().charStream(), RuntimeConfig.class);
future.complete(config);
Expand All @@ -127,10 +127,6 @@ public void onResponse(Call call, Response response)
{
future.completeExceptionally(ex);
}
finally
{
response.close();
}
}
});
return future;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ private static double installRollout()
}
}
HashCode hash = hasher.hash();
return (double) (hash.asInt() & 0x7fffffff) / (double) Integer.MAX_VALUE;
return (hash.asInt() & 0x7fffffff) / (double) Integer.MAX_VALUE;
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void logout() throws IOException
.url(url)
.build();

try (Response response = client.newCall(request).execute())
try (Response ignored = client.newCall(request).execute())
{
log.debug("Sent logout request");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void onFailure(Call call, IOException e)
@Override
public void onResponse(Call call, Response response)
{
try // NOPMD: UseTryWithResources
try (response)
{
if (response.code() != 200)
{
Expand Down Expand Up @@ -188,10 +188,6 @@ public void onResponse(Call call, Response response)
{
future.completeExceptionally(ex);
}
finally
{
response.close();
}
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ private static class OutlineKey

@Inject(optional = true)
@Named("activePriceThreshold")
@SuppressWarnings("PMD.ImmutableField")
private double activePriceThreshold = 5;

@Inject(optional = true)
@Named("lowPriceThreshold")
@SuppressWarnings("PMD.ImmutableField")
private int lowPriceThreshold = 1000;

private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap();
Expand Down Expand Up @@ -194,7 +196,7 @@ public ItemManager(Client client, ScheduledExecutorService scheduledExecutorServ
itemImages = CacheBuilder.newBuilder()
.maximumSize(128L)
.expireAfterAccess(1, TimeUnit.HOURS)
.build(new CacheLoader<ImageKey, AsyncBufferedImage>()
.build(new CacheLoader<>()
{
@Override
public AsyncBufferedImage load(ImageKey key) throws Exception
Expand All @@ -206,7 +208,7 @@ public AsyncBufferedImage load(ImageKey key) throws Exception
itemOutlines = CacheBuilder.newBuilder()
.maximumSize(128L)
.expireAfterAccess(1, TimeUnit.HOURS)
.build(new CacheLoader<OutlineKey, BufferedImage>()
.build(new CacheLoader<>()
{
@Override
public BufferedImage load(OutlineKey key) throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ItemVariationMapping
{
final Gson gson = new Gson();
// CHECKSTYLE:OFF
final TypeToken<Map<String, Collection<Integer>>> typeToken = new TypeToken<Map<String, Collection<Integer>>>(){};
final TypeToken<Map<String, Collection<Integer>>> typeToken = new TypeToken<>(){};
// CHECKSTYLE:ON

final Map<String, Collection<Integer>> itemVariations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static final class Entry
private String title;

@Getter
private List<Entry> options = new ArrayList<>();
private final List<Entry> options = new ArrayList<>();

@Getter
private Runnable onClose;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,10 @@ public void onFailure(Call call, IOException e)
@Override
public void onResponse(Call call, Response response) throws IOException
{
try // NOPMD: UseTryWithResources
try (response)
{
future.complete(processResponse(username, response));
}
finally
{
response.close();
}
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public abstract class GenericDiaryRequirement
{
@Getter
private Set<DiaryRequirement> requirements = new HashSet<>();
private final Set<DiaryRequirement> requirements = new HashSet<>();

protected void add(String task, Requirement... requirements)
{
Expand Down
Loading

0 comments on commit 1f59cd8

Please sign in to comment.