@@ -36,7 +36,7 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath("org.ajoberstar.grgit:grgit-core:4.1.0")
|
classpath("org.ajoberstar.grgit:grgit-core:4.1.0")
|
||||||
classpath("com.github.ben-manes:gradle-versions-plugin:0.36.0")
|
classpath("com.github.ben-manes:gradle-versions-plugin:0.36.0")
|
||||||
classpath("com.openosrs:openosrs-injector:1.0.1")
|
classpath("com.openosrs:openosrs-injector:1.0.2")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,6 @@ plugins {
|
|||||||
id("com.github.ben-manes.versions") version "0.36.0"
|
id("com.github.ben-manes.versions") version "0.36.0"
|
||||||
id("se.patrikerdes.use-latest-versions") version "0.2.15"
|
id("se.patrikerdes.use-latest-versions") version "0.2.15"
|
||||||
id("org.ajoberstar.grgit") version "4.1.0"
|
id("org.ajoberstar.grgit") version "4.1.0"
|
||||||
id("com.simonharrer.modernizer") version "2.1.0-1" apply false
|
|
||||||
|
|
||||||
application
|
application
|
||||||
}
|
}
|
||||||
@@ -140,9 +139,6 @@ subprojects {
|
|||||||
isIgnoreFailures = false
|
isIgnoreFailures = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.name == "runelite-client" || this.name == "runelite-api") {
|
|
||||||
apply(plugin = "com.simonharrer.modernizer")
|
|
||||||
}
|
|
||||||
|
|
||||||
configure<PublishingExtension> {
|
configure<PublishingExtension> {
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -44,9 +44,6 @@
|
|||||||
<property name="message" value="Indent must use tab characters"/>
|
<property name="message" value="Indent must use tab characters"/>
|
||||||
<property name="ignoreComments" value="true"/>
|
<property name="ignoreComments" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="AvoidStarImport">
|
|
||||||
<property name="allowStaticMemberImports" value="true"/>
|
|
||||||
</module>
|
|
||||||
<module name="RegexpSinglelineJava">
|
<module name="RegexpSinglelineJava">
|
||||||
<property name="format" value="[^\s]\s+$"/>
|
<property name="format" value="[^\s]\s+$"/>
|
||||||
<property name="message" value="No trailing whitespace"/>
|
<property name="message" value="No trailing whitespace"/>
|
||||||
@@ -64,11 +61,6 @@
|
|||||||
<property name="format" value="else[ \t]*[\r\n]+[ \t]*if"/>
|
<property name="format" value="else[ \t]*[\r\n]+[ \t]*if"/>
|
||||||
<property name="message" value="Newline should not be between else and if"/>
|
<property name="message" value="Newline should not be between else and if"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="RegexpMultiline">
|
|
||||||
<property name="format" value="^[\r\n\s]+import"/>
|
|
||||||
<property name="maximum" value="1"/>
|
|
||||||
<property name="message" value="There should not be empty lines in the imports list"/>
|
|
||||||
</module>
|
|
||||||
<module name="SuppressionFilter">
|
<module name="SuppressionFilter">
|
||||||
<property name="file" value="${config_loc}/suppressions.xml"/>
|
<property name="file" value="${config_loc}/suppressions.xml"/>
|
||||||
</module>
|
</module>
|
||||||
|
|||||||
@@ -43,12 +43,15 @@ public class Interfaces implements Iterable<Class>
|
|||||||
classFile = c;
|
classFile = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addInterface(Class clazz)
|
public boolean addInterface(Class clazz)
|
||||||
{
|
{
|
||||||
if (!interfaces.contains(clazz))
|
if (interfaces.stream().noneMatch((itf) -> itf.getName().equals(clazz.getName())))
|
||||||
{
|
{
|
||||||
interfaces.add(clazz);
|
interfaces.add(clazz);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Class> getInterfaces()
|
public List<Class> getInterfaces()
|
||||||
|
|||||||
@@ -15,10 +15,8 @@ plugins {
|
|||||||
id("se.patrikerdes.use-latest-versions")
|
id("se.patrikerdes.use-latest-versions")
|
||||||
}
|
}
|
||||||
|
|
||||||
val oprsver = "3.5.1"
|
|
||||||
|
|
||||||
group = "com.openosrs"
|
group = "com.openosrs"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import com.openosrs.injector.injectors.MixinInjector;
|
|||||||
import com.openosrs.injector.injectors.RSApiInjector;
|
import com.openosrs.injector.injectors.RSApiInjector;
|
||||||
import com.openosrs.injector.injectors.raw.AddPlayerToMenu;
|
import com.openosrs.injector.injectors.raw.AddPlayerToMenu;
|
||||||
import com.openosrs.injector.injectors.raw.ClearColorBuffer;
|
import com.openosrs.injector.injectors.raw.ClearColorBuffer;
|
||||||
import com.openosrs.injector.injectors.raw.DrawAfterWidgets;
|
|
||||||
import com.openosrs.injector.injectors.raw.DrawMenu;
|
import com.openosrs.injector.injectors.raw.DrawMenu;
|
||||||
import com.openosrs.injector.injectors.raw.Occluder;
|
import com.openosrs.injector.injectors.raw.Occluder;
|
||||||
import com.openosrs.injector.injectors.raw.RasterizerAlpha;
|
import com.openosrs.injector.injectors.raw.RasterizerAlpha;
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class MixinInjector extends AbstractInjector
|
|||||||
private static final String ASSERTION_FIELD = "$assertionsDisabled";
|
private static final String ASSERTION_FIELD = "$assertionsDisabled";
|
||||||
private static final String MIXIN_BASE = "net/runelite/mixins/";
|
private static final String MIXIN_BASE = "net/runelite/mixins/";
|
||||||
|
|
||||||
|
private int injectedInterfaces = 0;
|
||||||
private final Map<String, Field> injectedFields = new HashMap<>();
|
private final Map<String, Field> injectedFields = new HashMap<>();
|
||||||
private final Map<net.runelite.asm.pool.Field, ShadowField> shadowFields = new HashMap<>();
|
private final Map<net.runelite.asm.pool.Field, ShadowField> shadowFields = new HashMap<>();
|
||||||
private int copied = 0, replaced = 0, injected = 0;
|
private int copied = 0, replaced = 0, injected = 0;
|
||||||
@@ -106,6 +107,13 @@ public class MixinInjector extends AbstractInjector
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void inject(Map<Provider<ClassFile>, List<ClassFile>> mixinTargets)
|
void inject(Map<Provider<ClassFile>, List<ClassFile>> mixinTargets)
|
||||||
{
|
{
|
||||||
|
for (Map.Entry<Provider<ClassFile>, List<ClassFile>> entry : mixinTargets.entrySet())
|
||||||
|
{
|
||||||
|
injectInterfaces(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("[INFO] Injected {} interfaces", injectedInterfaces);
|
||||||
|
|
||||||
for (Map.Entry<Provider<ClassFile>, List<ClassFile>> entry : mixinTargets.entrySet())
|
for (Map.Entry<Provider<ClassFile>, List<ClassFile>> entry : mixinTargets.entrySet())
|
||||||
{
|
{
|
||||||
System.out.println(entry.getKey().get().getName());
|
System.out.println(entry.getKey().get().getName());
|
||||||
@@ -157,6 +165,29 @@ public class MixinInjector extends AbstractInjector
|
|||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void injectInterfaces(Provider<ClassFile> mixinProvider, List<ClassFile> targetClasses)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
final ClassFile mixinClass = mixinProvider.get();
|
||||||
|
|
||||||
|
for (final ClassFile targetClass : targetClasses)
|
||||||
|
{
|
||||||
|
mixinClass.getInterfaces().getInterfaces().forEach((itf) ->
|
||||||
|
{
|
||||||
|
if (targetClass.getInterfaces().addInterface(itf))
|
||||||
|
{
|
||||||
|
injectedInterfaces++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void injectFields(Provider<ClassFile> mixinProvider, List<ClassFile> targetClasses)
|
private void injectFields(Provider<ClassFile> mixinProvider, List<ClassFile> targetClasses)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
package net.runelite.api.widgets;
|
package net.runelite.api.widgets;
|
||||||
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.runelite.api.FontTypeFace;
|
import net.runelite.api.FontTypeFace;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ package net.runelite.client.config;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.client.ui.FontManager;
|
import net.runelite.client.ui.FontManager;
|
||||||
|
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.google.common.cache.Cache;
|
|||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ import net.runelite.rs.api.RSWidget;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import static net.runelite.api.widgets.WidgetInfo.TO_CHILD;
|
import static net.runelite.api.widgets.WidgetInfo.TO_CHILD;
|
||||||
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
|
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
|
||||||
|
|||||||
Reference in New Issue
Block a user