use of org.spongepowered.api.data.manipulator.immutable.block.ImmutableLogAxisData in project SpongeCommon by SpongePowered.
the class MixinBlockLog method getStateWithData.
@Override
public Optional<BlockState> getStateWithData(IBlockState blockState, ImmutableDataManipulator<?, ?> manipulator) {
if (manipulator instanceof ImmutableTreeData) {
final TreeType treeType = ((ImmutableTreeData) manipulator).type().get();
final BlockPlanks.EnumType type = TreeTypeResolver.getFor(treeType);
return processLogType(blockState, type, treeType);
} else if (manipulator instanceof ImmutableLogAxisData) {
final LogAxis logAxis = ((ImmutableLogAxisData) manipulator).type().get();
return Optional.of((BlockState) blockState.withProperty(BlockLog.LOG_AXIS, (BlockLog.EnumAxis) (Object) logAxis));
}
return super.getStateWithData(blockState, manipulator);
}
Aggregations