public static Location<World> getRelativeOffset(Location<World> block, int offsetX, int offsetY, int offsetZ) { return getRelativeOffset(SignUtil.getBackBlock(block), SignUtil.getFacing(block), offsetX, offsetY, offsetZ); }
public static Location<World> parseBlockLocation(Sign sign, int lPos, LocationCheckType relative) { return parseBlockLocation(sign, SignUtil.getTextRaw(sign, lPos), relative); }
/** * Checks if this {@link CartMechanismBlocks} contains a sign. * * @return If it contains a sign */ public boolean hasSign() { return sign != null && SignUtil.isSign(sign); }
public static Vector3d parseRadius(Sign sign, int lPos) { return parseRadius(SignUtil.getTextRaw(sign, lPos)); }
/** * @param sign treated as sign post if it is such, or else assumed to be a wall sign (i.e., * if you ask about a stone block, it's considered a wall * sign). * @return the cardinal or ordinal direction to a player's left as they face the sign to read it; if the sign is * oriented in a further direction, * the result is rounded to the nearest ordinal direction. */ public static Direction getRight(Location<World> sign) { Direction front = getFront(sign); if (front == null) return Direction.NONE; return getClockWise(front); }
/** * @param sign treated as sign post if it is such, or else assumed to be a wall sign (i.e., * if you ask about a stone block, it's considered a wall * sign). * @return the cardinal or ordinal direction to a player's right they face the sign to read it; if the sign is * oriented in a further direction, the * result is rounded to the nearest ordinal direction. */ public static Direction getLeft(Location<World> sign) { Direction front = getFront(sign); if (front == null) return Direction.NONE; return getCounterClockWise(front); }
public static String getTextRaw(SignData sign, int line) { return getTextRaw(getText(sign, line)); }
public TernaryState isActive(Location<World> block) { boolean isConnected = false; for (Direction direction : BlockUtil.getDirectHorizontalFaces()) { switch (BlockUtil.isPowered(block, direction)) { case TRUE: return TernaryState.TRUE; case NONE: break; case FALSE: isConnected = true; break; } } return isConnected ? TernaryState.FALSE : TernaryState.NONE; }
@Override protected JsonObject getChartData() { JsonObject data = new JsonObject(); Country value = getValue(); if (value == null) { // Null = skip the chart return null; } data.addProperty("value", value.getCountryIsoTag()); return data; }
public static Location<World> parseBlockLocation(Sign sign) { return parseBlockLocation(sign, 2, LocationCheckType.OFFSET); }
/** * @param sign treated as sign post if it is such, or else assumed to be a wall sign (i.e., * if you ask about a stone block, it's considered a wall * sign). * @return the direction a player would be facing when reading the sign; i.e. the face that is actually the back * side of the sign. */ public static Direction getFacing(Location<World> sign) { return getBack(sign); }
@Override public List<Location<World>> findPotentialOutputs(Location<World> location, ItemStack itemStack, Direction inputSide) { return BlockUtil.getAdjacentExcept(location, inputSide); } }
public static LocationCheckType getTypeFromChar(char c) { for(LocationCheckType t : values()) if(t.c == c) return t; return RELATIVE; }
@Override public boolean isValid(Location<World> location) { return BlockUtil.getLightLevel(location) >= 0; }
/** * Gets whether or not the specified {@link BlockState} passes the {@link SpongeBlockFilter}s. * * @param filters The filters * @param state The state to test * @return If it passes */ public static boolean doesStatePassFilters(Collection<SpongeBlockFilter> filters, BlockState state) { for(SpongeBlockFilter filter : filters) if(doesStatePassFilter(filter, state)) return true; return false; }
public static Vector3d parseRadius(Sign sign) { return parseRadius(sign, 2); }
public Location<World> getBackBlock() { return SignUtil.getBackBlock(this.block); }
public static void verifySignSyntax(Sign sign) throws CraftBookException { verifySignLocationSyntax(sign, 2); }
public static Location<World> parseBlockLocation(Sign sign, int lPos) { return parseBlockLocation(sign, lPos, LocationCheckType.OFFSET); }