Update from sk89q/master

This commit is contained in:
Jesse Boyd
2018-09-25 15:35:21 +10:00
14 changed files with 47 additions and 29 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit.world.block;
import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BlockMaterial;
@ -155,6 +156,13 @@ public interface BlockType extends FawePattern, Comparable<BlockTypes> {
*/
BlockState getDefaultState();
/**
* Gets a list of all possible states for this BlockType.
*
* @return All possible states
*/
List<BlockState> getAllStates();
/**
* Gets whether this block type has an item representation.
*

View File

@ -820,7 +820,7 @@ public enum BlockTypes implements BlockType {
* @return collection of states
*/
@Deprecated
public Collection<BlockState> getStates() {
public List<BlockState> getAllStates() {
if (settings.stateOrdinals == null) return Collections.singletonList(getDefaultState());
return IntStream.of(settings.stateOrdinals).filter(i -> i != -1).mapToObj(i -> states[i]).collect(Collectors.toList());
}