2 files changed
+8
-2
No files matched your search
@@ -1846,7 +1846,7 @@ public class Expression implements Cloneable
|
||||
addBinaryFunction("get", (v1, v2) ->
|
||||
{
|
||||
if (v1 instanceof LazyListValue || !(v1 instanceof ListValue))
|
||||
throw new InternalExpressionException("First argument of element should be a list");
|
||||
throw new InternalExpressionException("First argument of get should be a list");
|
||||
List<Value> items = ((ListValue)v1).getItems();
|
||||
long index = NumericValue.asNumber(v2).getLong();
|
||||
int numitems = items.size();
|
||||
@@ -1860,7 +1860,7 @@ public class Expression implements Cloneable
|
||||
addBinaryFunction("element", (v1, v2) ->
|
||||
{
|
||||
if (v1 instanceof LazyListValue || !(v1 instanceof ListValue))
|
||||
throw new InternalExpressionException("First argument of element should be a list");
|
||||
throw new InternalExpressionException("First argument of get should be a list");
|
||||
List<Value> items = ((ListValue)v1).getItems();
|
||||
long index = NumericValue.asNumber(v2).getLong();
|
||||
int numitems = items.size();
|
||||
|
||||
@@ -349,14 +349,17 @@ public class BlockValue extends Value
|
||||
this.sneakPlace = sneakPlace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getBlockPos() {
|
||||
return this.hit.getBlockPos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getPlayerLookDirection() {
|
||||
return facing.getOpposite();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction[] getPlacementDirections() {
|
||||
switch(this.facing) {
|
||||
case DOWN:
|
||||
@@ -375,14 +378,17 @@ public class BlockValue extends Value
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getPlayerFacing() {
|
||||
return this.facing.getAxis() == Direction.Axis.Y ? Direction.NORTH : this.facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayerSneaking() {
|
||||
return sneakPlace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPlayerYaw() {
|
||||
return (float)(this.facing.getHorizontal() * 90);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user