chore: removed references to cube game from names and comments

This commit is contained in:
zaaarf 2023-03-03 18:42:42 +01:00
parent 9ec77a95e0
commit 52dbb847a4
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C
4 changed files with 42 additions and 43 deletions

View file

@ -22,18 +22,16 @@ public interface IInjector {
default String reason() { return "No reason specified"; } default String reason() { return "No reason specified"; }
/** /**
* This is used by the Launch Plugin to identify which classes should be * This is used to identify which classes should be altered, and on which class
* altered, and on which classes should this injector operate. * should this injector operate.
* Class name should be dot-separated, for example "net.minecraft.client.Minecraft". * Class name should be dot-separated, for example "net.minecraft.client.Minecraft".
* @return class to transform * @return class to transform
*/ */
String targetClass(); String targetClass();
/** /**
* This is used by the Launch Plugin to identify the method to transform within * This is used to identify the method to transform within the class.
* the class. It should return the Searge name of target. * It should return the name of target.
* Example: "func_71407_l", which is "tick()" on "Minecraft" class in 1.16.5
*
* @return method to transform * @return method to transform
*/ */
String methodName(); String methodName();
@ -55,10 +53,11 @@ public interface IInjector {
String methodDesc(); String methodDesc();
/** /**
* This method will be called once the Launch Plugin has identified the right class and * This method is to be called by the launcher after identifying the right class and
* method to patch. Override this for the actual patching. * method to patch. The overriding method should contain the logic for actually
* @param clazz class node currently being patched * pathing.
* @param method node of method currently being patched * @param clazz the {@link ClassNode} currently being patched
* @param method the {@link MethodNode} of method currently being patched
*/ */
void inject(ClassNode clazz, MethodNode method); void inject(ClassNode clazz, MethodNode method);
} }

View file

@ -8,9 +8,9 @@ package ftbsc.lll.proxies;
public abstract class AbstractProxy { 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 * The fully qualified name (i.e. java.lang.String) of
@ -25,10 +25,10 @@ public abstract class AbstractProxy {
private final int modifiers; private final int modifiers;
/** /**
* @return the SRG name of the item * @return the name of the item
*/ */
public String getSrgName() { public String getname() {
return this.srgName; return this.name;
} }
/** /**
@ -53,12 +53,12 @@ public abstract class AbstractProxy {
/** /**
* The private constructor, should be called by all classes extending this in theirs. * 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 modifiers the modifiers, as a packed int
* @param parent the FQN of the parent class * @param parent the FQN of the parent class
*/ */
protected AbstractProxy(String srgName, int modifiers, String parent) { protected AbstractProxy(String name, int modifiers, String parent) {
this.srgName = srgName; this.name = name;
this.modifiers = modifiers; this.modifiers = modifiers;
this.parent = parent; this.parent = parent;
} }
@ -70,9 +70,9 @@ public abstract class AbstractProxy {
public abstract static class Builder<T extends 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. * The modifiers of the member, as a packed int.
@ -86,10 +86,10 @@ public abstract class AbstractProxy {
/** /**
* The constructor. * The constructor.
* @param srgName the SRG name of the member * @param name the name of the member
*/ */
protected Builder(String srgName) { protected Builder(String name) {
this.srgName = srgName; this.name = name;
this.modifiers = 0; this.modifiers = 0;
} }

View file

@ -29,13 +29,13 @@ public class FieldProxy extends AbstractProxy {
/** /**
* A protected constructor, called only from the builder. * 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 modifiers the modifiers of the field
* @param parent the FQN of the parent class of the field * @param parent the FQN of the parent class of the field
* @param typeDescriptor the type descriptor of the field * @param typeDescriptor the type descriptor of the field
*/ */
FieldProxy(String srgName, int modifiers, String parent, String typeDescriptor) { FieldProxy(String name, int modifiers, String parent, String typeDescriptor) {
super(srgName, modifiers, parent); super(name, modifiers, parent);
this.typeDescriptor = typeDescriptor; this.typeDescriptor = typeDescriptor;
} }
@ -49,11 +49,11 @@ public class FieldProxy extends AbstractProxy {
/** /**
* Returns a new instance of {@link FieldProxy.Builder}. * 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 * @return the builder object for field proxies
*/ */
public static Builder builder(String srgName) { public static Builder builder(String name) {
return new Builder(srgName); return new Builder(name);
} }
public static class Builder extends AbstractProxy.Builder<FieldProxy> { 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. * 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) { Builder(String name) {
super(srgName); super(name);
} }
/** /**
@ -107,7 +107,7 @@ public class FieldProxy extends AbstractProxy {
*/ */
@Override @Override
public FieldProxy build() { 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);
} }
} }
} }

View file

@ -51,14 +51,14 @@ public class MethodProxy extends AbstractProxy {
/** /**
* A protected constructor, called only from the builder. * 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 modifiers the modifiers of the method
* @param parent the FQN of the parent class of the method * @param parent the FQN of the parent class of the method
* @param parameters the parameters of the method * @param parameters the parameters of the method
* @param returnType the return type of the method * @param returnType the return type of the method
*/ */
protected MethodProxy(String srgName, int modifiers, String parent, Object[] parameters, Object returnType) { protected MethodProxy(String name, int modifiers, String parent, Object[] parameters, Object returnType) {
super(srgName, modifiers, parent); super(name, modifiers, parent);
this.parameters = parameters; this.parameters = parameters;
this.returnType = returnType; this.returnType = returnType;
this.descriptorCache = null; this.descriptorCache = null;
@ -96,11 +96,11 @@ public class MethodProxy extends AbstractProxy {
/** /**
* Returns a new instance of {@link MethodProxy.Builder}. * 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 * @return the builder object for method proxies
*/ */
public static Builder builder(String srgName) { public static Builder builder(String name) {
return new Builder(srgName); return new Builder(name);
} }
/** /**
@ -119,10 +119,10 @@ public class MethodProxy extends AbstractProxy {
/** /**
* The constructor of the builder, used only internally. * 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) { Builder(String name) {
super(srgName); super(name);
this.parameters = new ArrayList<>(); this.parameters = new ArrayList<>();
this.returnType = void.class; this.returnType = void.class;
} }
@ -177,7 +177,7 @@ public class MethodProxy extends AbstractProxy {
*/ */
@Override @Override
public MethodProxy build() { public MethodProxy build() {
return new MethodProxy(srgName, modifiers, parent, parameters.toArray(), returnType); return new MethodProxy(name, modifiers, parent, parameters.toArray(), returnType);
} }
} }