public static boolean checkBlockBreak(Block block) { for (SegmentSpecialBlock segment : segmentsSpecialBlock.get(block.getClass())) { if (segment.isAlwaysBreakable()) { return true; } } return false; }
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; }
private void serializeSpecialBlock( SegmentSpecialBlock segment, JsonObject json, JsonSerializationContext context) { json.addProperty("meta", segment.getMeta()); json.addProperty("isAlwaysBreakable", segment.isAlwaysBreakable); }