Пример #1
0
  public static boolean checkBlockBreak(Block block) {
    for (SegmentSpecialBlock segment : segmentsSpecialBlock.get(block.getClass())) {
      if (segment.isAlwaysBreakable()) {
        return true;
      }
    }

    return false;
  }
Пример #2
0
    private SegmentSpecialBlock deserializeSpecialBlock(
        JsonObject json, JsonDeserializationContext context) {
      SegmentSpecialBlock segment = new SegmentSpecialBlock();

      if (json.has("meta")) {
        segment.meta = json.get("meta").getAsInt();
        json.remove("meta");
      }

      if (json.has("isAlwaysBreakable")) {
        segment.isAlwaysBreakable = json.get("isAlwaysBreakable").getAsBoolean();
        json.remove("isAlwaysBreakable");
      }

      return segment;
    }
Пример #3
0
 private void serializeSpecialBlock(
     SegmentSpecialBlock segment, JsonObject json, JsonSerializationContext context) {
   json.addProperty("meta", segment.getMeta());
   json.addProperty("isAlwaysBreakable", segment.isAlwaysBreakable);
 }