use of org.spongepowered.api.util.Cycleable in project SpongeCommon by SpongePowered.
the class MixinStateImplementation method cycleValue.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public BlockState cycleValue(Key<? extends BaseValue<? extends Cycleable<?>>> key) {
if (supports(key)) {
final Cycleable value = (Cycleable) get((Key) key).get();
final Cycleable next = value.cycleNext();
return with((Key<? extends BaseValue<Object>>) (Key<?>) key, next).get();
}
throw new IllegalArgumentException("Used an invalid cyclable key! Check with supports in the future!");
}