aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-03 18:42:42 +0100
committer zaaarf <zaaarf@proton.me>2023-03-03 18:42:51 +0100
commit52dbb847a4c152f3f2abca7804ba5df4caadd8e1 (patch)
treed7123caaed39770d71a5b97b1a05e1ca3a41075b
parent9ec77a95e02ad18811ea8ac246f7b4887275e8fd (diff)
chore: removed references to cube game from names and comments
-rw-r--r--src/main/java/ftbsc/lll/IInjector.java19
-rw-r--r--src/main/java/ftbsc/lll/proxies/AbstractProxy.java26
-rw-r--r--src/main/java/ftbsc/lll/proxies/FieldProxy.java20
-rw-r--r--src/main/java/ftbsc/lll/proxies/MethodProxy.java20
4 files changed, 42 insertions, 43 deletions
diff --git a/src/main/java/ftbsc/lll/IInjector.java b/src/main/java/ftbsc/lll/IInjector.java
index 7ef8144..cfb855a 100644
--- a/src/main/java/ftbsc/lll/IInjector.java
+++ b/src/main/java/ftbsc/lll/IInjector.java
@@ -22,18 +22,16 @@ public interface IInjector {
default String reason() { return "No reason specified"; }
/**
- * This is used by the Launch Plugin to identify which classes should be
- * altered, and on which classes should this injector operate.
+ * This is used to identify which classes should be altered, and on which class
+ * should this injector operate.
* Class name should be dot-separated, for example "net.minecraft.client.Minecraft".
* @return class to transform
*/
String targetClass();
/**
- * This is used by the Launch Plugin to identify the method to transform within
- * the class. It should return the Searge name of target.
- * Example: "func_71407_l", which is "tick()" on "Minecraft" class in 1.16.5
- *
+ * This is used to identify the method to transform within the class.
+ * It should return the name of target.
* @return method to transform
*/
String methodName();
@@ -55,10 +53,11 @@ public interface IInjector {
String methodDesc();
/**
- * This method will be called once the Launch Plugin has identified the right class and
- * method to patch. Override this for the actual patching.
- * @param clazz class node currently being patched
- * @param method node of method currently being patched
+ * This method is to be called by the launcher after identifying the right class and
+ * method to patch. The overriding method should contain the logic for actually
+ * pathing.
+ * @param clazz the {@link ClassNode} currently being patched
+ * @param method the {@link MethodNode} of method currently being patched
*/
void inject(ClassNode clazz, MethodNode method);
}
diff --git a/src/main/java/ftbsc/lll/proxies/AbstractProxy.java b/src/main/java/ftbsc/lll/proxies/AbstractProxy.java
index 01cc6fe..2b80b01 100644
--- a/src/main/java/ftbsc/lll/proxies/AbstractProxy.java
+++ b/src/main/java/ftbsc/lll/proxies/AbstractProxy.java
@@ -8,9 +8,9 @@ package ftbsc.lll.proxies;
public abstract class AbstractProxy {
/**
- * The SRG name of the corresponding class member.
+ * The name of the corresponding class member.
*/
- private final String srgName;
+ private final String name;
/**
* The fully qualified name (i.e. java.lang.String) of
@@ -25,10 +25,10 @@ public abstract class AbstractProxy {
private final int modifiers;
/**
- * @return the SRG name of the item
+ * @return the name of the item
*/
- public String getSrgName() {
- return this.srgName;
+ public String getname() {
+ return this.name;
}
/**
@@ -53,12 +53,12 @@ public abstract class AbstractProxy {
/**
* The private constructor, should be called by all classes extending this in theirs.
- * @param srgName the SRG name of the member
+ * @param name the name of the member
* @param modifiers the modifiers, as a packed int
* @param parent the FQN of the parent class
*/
- protected AbstractProxy(String srgName, int modifiers, String parent) {
- this.srgName = srgName;
+ protected AbstractProxy(String name, int modifiers, String parent) {
+ this.name = name;
this.modifiers = modifiers;
this.parent = parent;
}
@@ -70,9 +70,9 @@ public abstract class AbstractProxy {
public abstract static class Builder<T extends AbstractProxy> {
/**
- * The SRG name of the member.
+ * The name of the member.
*/
- protected final String srgName;
+ protected final String name;
/**
* The modifiers of the member, as a packed int.
@@ -86,10 +86,10 @@ public abstract class AbstractProxy {
/**
* The constructor.
- * @param srgName the SRG name of the member
+ * @param name the name of the member
*/
- protected Builder(String srgName) {
- this.srgName = srgName;
+ protected Builder(String name) {
+ this.name = name;
this.modifiers = 0;
}
diff --git a/src/main/java/ftbsc/lll/proxies/FieldProxy.java b/src/main/java/ftbsc/lll/proxies/FieldProxy.java
index 2bd0115..af6f8df 100644
--- a/src/main/java/ftbsc/lll/proxies/FieldProxy.java
+++ b/src/main/java/ftbsc/lll/proxies/FieldProxy.java
@@ -29,13 +29,13 @@ public class FieldProxy extends AbstractProxy {
/**
* A protected constructor, called only from the builder.
- * @param srgName the SRG name of the field
+ * @param name the name of the field
* @param modifiers the modifiers of the field
* @param parent the FQN of the parent class of the field
* @param typeDescriptor the type descriptor of the field
*/
- FieldProxy(String srgName, int modifiers, String parent, String typeDescriptor) {
- super(srgName, modifiers, parent);
+ FieldProxy(String name, int modifiers, String parent, String typeDescriptor) {
+ super(name, modifiers, parent);
this.typeDescriptor = typeDescriptor;
}
@@ -49,11 +49,11 @@ public class FieldProxy extends AbstractProxy {
/**
* Returns a new instance of {@link FieldProxy.Builder}.
- * @param srgName the SRG name of the field
+ * @param name the name of the field
* @return the builder object for field proxies
*/
- public static Builder builder(String srgName) {
- return new Builder(srgName);
+ public static Builder builder(String name) {
+ return new Builder(name);
}
public static class Builder extends AbstractProxy.Builder<FieldProxy> {
@@ -64,10 +64,10 @@ public class FieldProxy extends AbstractProxy {
/**
* The constructor of the builder, used only internally.
- * @param srgName the SRG name of the field
+ * @param name the name of the field
*/
- Builder(String srgName) {
- super(srgName);
+ Builder(String name) {
+ super(name);
}
/**
@@ -107,7 +107,7 @@ public class FieldProxy extends AbstractProxy {
*/
@Override
public FieldProxy build() {
- return new FieldProxy(this.srgName, this.modifiers, this.parent, this.typeDescriptor);
+ return new FieldProxy(this.name, this.modifiers, this.parent, this.typeDescriptor);
}
}
}
diff --git a/src/main/java/ftbsc/lll/proxies/MethodProxy.java b/src/main/java/ftbsc/lll/proxies/MethodProxy.java
index 1df4678..ff5e1f0 100644
--- a/src/main/java/ftbsc/lll/proxies/MethodProxy.java
+++ b/src/main/java/ftbsc/lll/proxies/MethodProxy.java
@@ -51,14 +51,14 @@ public class MethodProxy extends AbstractProxy {
/**
* A protected constructor, called only from the builder.
- * @param srgName the SRG name of the method
+ * @param name the name of the method
* @param modifiers the modifiers of the method
* @param parent the FQN of the parent class of the method
* @param parameters the parameters of the method
* @param returnType the return type of the method
*/
- protected MethodProxy(String srgName, int modifiers, String parent, Object[] parameters, Object returnType) {
- super(srgName, modifiers, parent);
+ protected MethodProxy(String name, int modifiers, String parent, Object[] parameters, Object returnType) {
+ super(name, modifiers, parent);
this.parameters = parameters;
this.returnType = returnType;
this.descriptorCache = null;
@@ -96,11 +96,11 @@ public class MethodProxy extends AbstractProxy {
/**
* Returns a new instance of {@link MethodProxy.Builder}.
- * @param srgName the SRG name of the method
+ * @param name the name of the method
* @return the builder object for method proxies
*/
- public static Builder builder(String srgName) {
- return new Builder(srgName);
+ public static Builder builder(String name) {
+ return new Builder(name);
}
/**
@@ -119,10 +119,10 @@ public class MethodProxy extends AbstractProxy {
/**
* The constructor of the builder, used only internally.
- * @param srgName the SRG name of the method
+ * @param name the name of the method
*/
- Builder(String srgName) {
- super(srgName);
+ Builder(String name) {
+ super(name);
this.parameters = new ArrayList<>();
this.returnType = void.class;
}
@@ -177,7 +177,7 @@ public class MethodProxy extends AbstractProxy {
*/
@Override
public MethodProxy build() {
- return new MethodProxy(srgName, modifiers, parent, parameters.toArray(), returnType);
+ return new MethodProxy(name, modifiers, parent, parameters.toArray(), returnType);
}
}