mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-12 16:27:40 +00:00
- Fixed isOp function in 1.7.10
- Added ModOnly at some places - Fixed number casting rules
This commit is contained in:
1 parent
55c3630bf3
commit
fc8bf619e1
21 files changed
+40
-33
No files matched your search
@@ -31,7 +31,7 @@ public class ZenTypeByte extends ZenType {
|
||||
@Override
|
||||
public boolean canCastImplicit(ZenType type, IEnvironmentGlobal environment) {
|
||||
int itype = type.getNumberType();
|
||||
return itype == NUM_BYTE
|
||||
return itype != 0
|
||||
|| type == STRING
|
||||
|| canCastExpansion(environment, type);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ZenTypeDouble extends ZenType {
|
||||
|
||||
@Override
|
||||
public boolean canCastImplicit(ZenType type, IEnvironmentGlobal environment) {
|
||||
return (type.getNumberType() != 0 && type.getNumberType() <= NUM_DOUBLE)
|
||||
return (type.getNumberType() != 0 && type.getNumberType() == NUM_DOUBLE)
|
||||
|| type == STRING
|
||||
|| canCastExpansion(environment, type);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ZenTypeFloat extends ZenType {
|
||||
|
||||
@Override
|
||||
public boolean canCastImplicit(ZenType type, IEnvironmentGlobal environment) {
|
||||
return (type.getNumberType() != 0 && type.getNumberType() <= NUM_FLOAT)
|
||||
return (type.getNumberType() != 0 && type.getNumberType() >= NUM_FLOAT)
|
||||
|| type == ZenTypeString.INSTANCE
|
||||
|| canCastExpansion(environment, type);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ZenTypeInt extends ZenType {
|
||||
|
||||
@Override
|
||||
public boolean canCastImplicit(ZenType type, IEnvironmentGlobal environment) {
|
||||
return (type.getNumberType() != 0 && type.getNumberType() <= NUM_INT)
|
||||
return (type.getNumberType() != 0 && type.getNumberType() >= NUM_INT)
|
||||
|| type == ZenTypeString.INSTANCE
|
||||
|| canCastExpansion(environment, type);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ZenTypeLong extends ZenType {
|
||||
|
||||
@Override
|
||||
public boolean canCastImplicit(ZenType type, IEnvironmentGlobal environment) {
|
||||
return (type.getNumberType() != 0 && type.getNumberType() <= NUM_LONG)
|
||||
return (type.getNumberType() != 0 && type.getNumberType() >= NUM_LONG)
|
||||
|| type == ZenTypeString.INSTANCE
|
||||
|| canCastExpansion(environment, type);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ZenTypeShort extends ZenType {
|
||||
|
||||
@Override
|
||||
public boolean canCastImplicit(ZenType type, IEnvironmentGlobal environment) {
|
||||
return (type.getNumberType() != 0 && type.getNumberType() <= NUM_SHORT)
|
||||
return (type.getNumberType() != 0 && type.getNumberType() >= NUM_SHORT)
|
||||
|| type == ZenTypeString.INSTANCE
|
||||
|| canCastExpansion(environment, type);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user