mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-19 11:49:05 +00:00
- Basic types can now be converted to the "any" type
- Changed OreDict 'contains' to respond to the 'in' operator
This commit is contained in:
1 parent
52f92dcfd4
commit
1b72abb2b4
59 files changed
+3595
-976
No files matched your search
@@ -393,6 +393,13 @@ public class MethodOutput {
|
||||
}
|
||||
|
||||
public void invokeStatic(String owner, String name, String descriptor) {
|
||||
if (owner == null)
|
||||
throw new IllegalArgumentException("owner cannot be null");
|
||||
if (name == null)
|
||||
throw new IllegalArgumentException("name cannot be null");
|
||||
if (descriptor == null)
|
||||
throw new IllegalArgumentException("descriptor cannot be null");
|
||||
|
||||
visitor.visitMethodInsn(INVOKESTATIC, owner, name, descriptor);
|
||||
}
|
||||
|
||||
@@ -561,6 +568,14 @@ public class MethodOutput {
|
||||
visitor.visitJumpInsn(IF_ICMPLT, lbl);
|
||||
}
|
||||
|
||||
public void ifACmpEq(Label lbl) {
|
||||
visitor.visitJumpInsn(IF_ACMPEQ, lbl);
|
||||
}
|
||||
|
||||
public void ifACmpNe(Label lbl) {
|
||||
visitor.visitJumpInsn(IF_ACMPNE, lbl);
|
||||
}
|
||||
|
||||
public void ifNull(Label lbl) {
|
||||
visitor.visitJumpInsn(IFNULL, lbl);
|
||||
}
|
||||
@@ -601,10 +616,18 @@ public class MethodOutput {
|
||||
visitor.visitFieldInsn(PUTFIELD, internal(owner), name, signature(descriptor));
|
||||
}
|
||||
|
||||
public void getStaticField(String owner, String name, String descriptor) {
|
||||
visitor.visitFieldInsn(GETSTATIC, owner, name, descriptor);
|
||||
}
|
||||
|
||||
public void getStaticField(Class owner, Field field) {
|
||||
visitor.visitFieldInsn(GETSTATIC, internal(owner), field.getName(), signature(field.getType()));
|
||||
}
|
||||
|
||||
public void putStaticField(String owner, String name, String descriptor) {
|
||||
visitor.visitFieldInsn(PUTSTATIC, owner, name, descriptor);
|
||||
}
|
||||
|
||||
public void putStaticField(Class owner, Field field) {
|
||||
visitor.visitFieldInsn(PUTSTATIC, internal(owner), field.getName(), signature(field.getType()));
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ public class ZenPosition {
|
||||
private final int offset;
|
||||
|
||||
public ZenPosition(ZenParsedFile file, int line, int offset) {
|
||||
if (file != null && line <= 0) throw new IllegalArgumentException("Line must be positive");
|
||||
|
||||
this.file = file;
|
||||
this.line = line;
|
||||
this.offset = offset;
|
||||
|
||||
@@ -9,12 +9,16 @@ package stanhebben.zenscript.util;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import stanhebben.zenscript.compiler.ITypeRegistry;
|
||||
import stanhebben.zenscript.compiler.TypeRegistry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stanneke
|
||||
*/
|
||||
public class ZenTypeUtil {
|
||||
public static final ITypeRegistry EMPTY_REGISTRY = new TypeRegistry();
|
||||
|
||||
private static final Map<String, String> SIGNATURE_MAP;
|
||||
|
||||
static {
|
||||
|
||||
Reference in new issue
Block a user