@Override public void deserialize(Block block, int index, BlockPositionState state) { // Use the original serialized block as the underlying block for the state to save object creation overhead state.setPosition(index); state.setBlock(block); } }
public static void input(Type type, BlockPositionState state, Block block, int position) { if (state.getBlock() != null) { return; } state.setBlock(block); state.setPosition(position); }
public static void combine(BlockPositionState state, BlockPositionState otherState) { if (state.getBlock() != null) { return; } state.setBlock(otherState.getBlock()); state.setPosition(otherState.getPosition()); } }
public static void maxInput(Type type, BlockPositionState state, Block block, int position) { if (state.getBlock() == null || type.compareTo(block, position, state.getBlock(), state.getPosition()) > 0) { state.setBlock(block); state.setPosition(position); } }
public static void minInput(Type type, BlockPositionState state, Block block, int position) { if (state.getBlock() == null || type.compareTo(block, position, state.getBlock(), state.getPosition()) < 0) { state.setBlock(block); state.setPosition(position); } }
public static void maxCombine(Type type, BlockPositionState state, BlockPositionState otherState) { if (state.getBlock() == null || type.compareTo(otherState.getBlock(), otherState.getPosition(), state.getBlock(), state.getPosition()) > 0) { state.setBlock(otherState.getBlock()); state.setPosition(otherState.getPosition()); } }
public static void minCombine(Type type, BlockPositionState state, BlockPositionState otherState) { if (state.getBlock() == null || type.compareTo(otherState.getBlock(), otherState.getPosition(), state.getBlock(), state.getPosition()) < 0) { state.setBlock(otherState.getBlock()); state.setPosition(otherState.getPosition()); } }