@Override public Chunk getChunk() { return base.getChunk(); }
private void customblockComparator(List<MgBlockData> baseBlocks) { baseBlocks.sort((o1, o2) -> { int comp = Integer.compare(o1.getBlockState().getChunk().getX(), o2.getBlockState().getChunk().getX()); if (comp != 0) return comp; comp = Integer.compare(o1.getBlockState().getChunk().getZ(), o2.getBlockState().getChunk().getZ()); if (comp != 0) return comp; return Integer.compare(o1.getBlockState().getY(), o2.getBlockState().getY()); }); }
@Override public org.bukkit.Chunk convertSpecial(Object value, Class<?> valueType, org.bukkit.Chunk def) { if (value instanceof Chunk) { return ((Chunk) value).bukkitChunk; } else if (value instanceof org.bukkit.block.Block) { return ((org.bukkit.block.Block) value).getChunk(); } else if (value instanceof BlockState) { return ((BlockState) value).getChunk(); } else if (value instanceof Location) { return ((Location) value).getChunk(); } else { return def; } } };