mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-12 16:27:40 +00:00
- Fixed some wrongs in data matching, causing crashes with onlyWithTag in some cases
- Fixed a variable check when resolving variables
This commit is contained in:
1 parent
f20af21fef
commit
59ef38877f
15 files changed
+119
-44
No files matched your search
+5
@@ -31,6 +31,11 @@ public class ParsedExpressionVariable extends ParsedExpression {
|
||||
public IPartialExpression compile(IEnvironmentMethod environment, ZenType predictedType) {
|
||||
IPartialExpression result = environment.getValue(name, getPosition());
|
||||
if (result == null) {
|
||||
if (predictedType == null) {
|
||||
environment.error(getPosition(), "could not find " + name);
|
||||
return new ExpressionInvalid(getPosition());
|
||||
}
|
||||
|
||||
// enable usage of static members of the same type as the predicted type (eg. enum values)
|
||||
IPartialExpression member = predictedType.getStaticMember(getPosition(), environment, name);
|
||||
if (member == null || member.getType().getCastingRule(predictedType, environment) == null) {
|
||||
|
||||
Reference in new issue
Block a user