Code cleaning

Most notable change: Remove redundant type parameters and replaced with <>. This is a small step to bring us closer to upstream parity.
This commit is contained in:
matt
2019-02-15 21:46:10 -05:00
parent 3236bdd78e
commit 85bfd16d7c
82 changed files with 1417 additions and 1406 deletions

View File

@ -81,7 +81,8 @@ public class BlockType implements FawePattern {
public ArrayList<BlockState> updateStates(){
if(settings != null) {
return settings.localStates = new ArrayList<BlockState>(settings.localStates.stream().map(state -> new BlockStateImpl(this, state.getInternalId(), state.getOrdinal())).collect(Collectors.toList()));
return settings.localStates = new ArrayList<>(settings.localStates.stream()
.map(state -> new BlockStateImpl(this, state.getInternalId(), state.getOrdinal())).collect(Collectors.toList()));
}else {
return null;
}

View File

@ -676,9 +676,9 @@ public class BlockTypes{
public static BlockType register(BlockType type) {
if(sortedRegistry == null) {
sortedRegistry = new ArrayList<BlockType>();
stateList = new ArrayList<BlockState>();
$NAMESPACES = new LinkedHashSet<String>();
sortedRegistry = new ArrayList<>();
stateList = new ArrayList<>();
$NAMESPACES = new LinkedHashSet<>();
BIT_OFFSET = MathMan.log2nlz(WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().registerBlocks().size());
BIT_MASK = ((1 << BIT_OFFSET) - 1);
}
@ -775,7 +775,7 @@ public class BlockTypes{
this.propertiesSet = Collections.emptySet();
}
this.permutations = maxInternalStateId;
this.localStates = new ArrayList<BlockState>();
this.localStates = new ArrayList<>();
this.blockMaterial = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(type);
this.itemType = ItemTypes.get(type);

View File

@ -838,7 +838,7 @@ public final class ItemTypes {
public static ItemType register(final ItemType item) {
if(sortedRegistry == null)
sortedRegistry = new ArrayList<ItemType>();
sortedRegistry = new ArrayList<>();
if(!sortedRegistry.contains(item))sortedRegistry.add(item);
// return ItemType.REGISTRY.register(item.getId(), item);
return internalRegister(item);