@Dynamic public static double random() { return random.nextDouble(); }
@Dynamic public static double randint(RValue max) throws EvaluationException { return random.nextInt((int) Math.floor(max.getValue())); }
@Dynamic public static double megabuf(RValue index) throws EvaluationException { return getBufferItem(Expression.getInstance().getFunctions().megabuf, (int) index.getValue()); }
@Dynamic public static double gmegabuf(RValue index) throws EvaluationException { return getBufferItem(gmegabuf, (int) index.getValue()); }
@Dynamic public static double megabuf(RValue index, double value) throws EvaluationException { return setBufferItem(Expression.getInstance().getFunctions().megabuf, (int) index.getValue(), value); }
@Dynamic public static double gmegabuf(RValue index, double value) throws EvaluationException { return setBufferItem(gmegabuf, (int) index.getValue(), value); }
@Dynamic public static double queryRel(RValue x, RValue y, RValue z, RValue type, RValue data) throws EvaluationException { final double xp = x.getValue(); final double yp = y.getValue(); final double zp = z.getValue(); final ExpressionEnvironment environment = Expression.getInstance().getEnvironment(); // Read values from world final double typeId = environment.getBlockTypeRel(xp, yp, zp); final double dataValue = environment.getBlockDataRel(xp, yp, zp); return queryInternal(type, data, typeId, dataValue); }
@Dynamic public static double query(RValue x, RValue y, RValue z, RValue type, RValue data) throws EvaluationException { final double xp = x.getValue(); final double yp = y.getValue(); final double zp = z.getValue(); final ExpressionEnvironment environment = Expression.getInstance().getEnvironment(); // Read values from world final double typeId = environment.getBlockType(xp, yp, zp); final double dataValue = environment.getBlockData(xp, yp, zp); return queryInternal(type, data, typeId, dataValue); }
@Dynamic public static double gclosest(RValue x, RValue y, RValue z, RValue index, RValue count, RValue stride) throws EvaluationException { return findClosest( gmegabuf, x.getValue(), y.getValue(), z.getValue(), (int) index.getValue(), (int) count.getValue(), (int) stride.getValue() ); }
@Dynamic public static double closest(RValue x, RValue y, RValue z, RValue index, RValue count, RValue stride) throws EvaluationException { return findClosest( Expression.getInstance().getFunctions().megabuf, x.getValue(), y.getValue(), z.getValue(), (int) index.getValue(), (int) count.getValue(), (int) stride.getValue() ); }
@Dynamic public static double queryAbs(RValue x, RValue y, RValue z, RValue type, RValue data) throws EvaluationException { final double xp = x.getValue(); final double yp = y.getValue(); final double zp = z.getValue(); final ExpressionEnvironment environment = Expression.getInstance().getEnvironment(); // Read values from world final double typeId = environment.getBlockTypeAbs(xp, yp, zp); final double dataValue = environment.getBlockDataAbs(xp, yp, zp); return queryInternal(type, data, typeId, dataValue); }