mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:38:34 +00:00
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:
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user