Merge pull request #43 from gnembon/inventory

touchups and docs
This commit is contained in:
gnembon authored and GitHub committed 2019-07-02 09:09:25 -03:00
commit 558f1bc344
2 files changed
+8 -2

No files matched your search

+2 -2
View File
@@ -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);
}