Skip to content

Commit

Permalink
refactor: improvment of the contains method
Browse files Browse the repository at this point in the history
ArrayList -> LinkedHashSet
  • Loading branch information
MukjepScarlet authored Nov 9, 2024
1 parent 61aa9fd commit c5b79fc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class BedrockMappingData extends MappingDataBase {
// Block states
private BlockStateUpgrader bedrockBlockStateUpgrader;
private BiMap<BlockState, Integer> javaBlockStates;
private List<BedrockBlockState> bedrockBlockStates;
private Set<BedrockBlockState> bedrockBlockStates;
private Map<BlockState, BlockState> bedrockToJavaBlockStates;
private Map<String, String> bedrockBlockTags;
private Map<String, Map<String, Set<String>>> bedrockBlockTraits;
Expand Down Expand Up @@ -192,7 +192,7 @@ public void load() {
}

final ListTag<CompoundTag> bedrockBlockStatesTag = this.readNBT("bedrock/block_palette.nbt").getListTag("blocks", CompoundTag.class);
this.bedrockBlockStates = new ArrayList<>(bedrockBlockStatesTag.size());
this.bedrockBlockStates = new LinkedHashSet<>(bedrockBlockStatesTag.size(), 1.0F);
for (CompoundTag tag : bedrockBlockStatesTag) {
final BedrockBlockState bedrockBlockState = BedrockBlockState.fromNbt(tag);
this.bedrockBlockStates.add(bedrockBlockState);
Expand Down Expand Up @@ -900,7 +900,7 @@ public BiMap<BlockState, Integer> getJavaBlockStates() {
return this.javaBlockStates;
}

public List<BedrockBlockState> getBedrockBlockStates() {
public Set<BedrockBlockState> getBedrockBlockStates() {
return this.bedrockBlockStates;
}

Expand Down

0 comments on commit c5b79fc

Please sign in to comment.