mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-21 20:42:16 +00:00
format all the things!
This commit is contained in:
1 parent
54ec75fd3d
commit
b36c6dade6
377 files changed
+6833
-6772
No files matched your search
@@ -23,18 +23,19 @@ import stanhebben.zenscript.util.ZenPosition;
|
||||
public class ExpressionInt extends Expression {
|
||||
private final long value;
|
||||
private final ZenType type;
|
||||
|
||||
|
||||
public ExpressionInt(ZenPosition position, long value, ZenType type) {
|
||||
super(position);
|
||||
|
||||
|
||||
this.value = value;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression cast(ZenPosition position, IEnvironmentGlobal environment, ZenType type) {
|
||||
if (type == this.type) return this;
|
||||
|
||||
if (type == this.type)
|
||||
return this;
|
||||
|
||||
switch (type.getNumberType()) {
|
||||
case ZenType.NUM_BYTE:
|
||||
case ZenType.NUM_SHORT:
|
||||
@@ -45,7 +46,7 @@ public class ExpressionInt extends Expression {
|
||||
case ZenType.NUM_DOUBLE:
|
||||
return new ExpressionFloat(getPosition(), value, type);
|
||||
}
|
||||
|
||||
|
||||
return super.cast(position, environment, type);
|
||||
}
|
||||
|
||||
@@ -56,8 +57,9 @@ public class ExpressionInt extends Expression {
|
||||
|
||||
@Override
|
||||
public void compile(boolean result, IEnvironmentMethod environment) {
|
||||
if (!result) return;
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
MethodOutput output = environment.getOutput();
|
||||
if (type == ZenTypeByte.INSTANCE) {
|
||||
output.biPush((byte) value);
|
||||
|
||||
Reference in new issue
Block a user