mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Replace more instances of String#split with BlockUtils#getCleanIdentifier
This commit is contained in:
parent
4e629feee8
commit
80b8d18c31
2 changed files with 4 additions and 3 deletions
|
@ -39,6 +39,7 @@ import org.geysermc.connector.inventory.Inventory;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
import org.geysermc.connector.network.translators.inventory.InventoryTranslator;
|
import org.geysermc.connector.network.translators.inventory.InventoryTranslator;
|
||||||
import org.geysermc.connector.registry.BlockRegistries;
|
import org.geysermc.connector.registry.BlockRegistries;
|
||||||
|
import org.geysermc.connector.utils.BlockUtils;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -62,10 +63,10 @@ public class BlockInventoryHolder extends InventoryHolder {
|
||||||
if (validBlocks != null) {
|
if (validBlocks != null) {
|
||||||
Set<String> validBlocksTemp = new HashSet<>(validBlocks.length + 1);
|
Set<String> validBlocksTemp = new HashSet<>(validBlocks.length + 1);
|
||||||
Collections.addAll(validBlocksTemp, validBlocks);
|
Collections.addAll(validBlocksTemp, validBlocks);
|
||||||
validBlocksTemp.add(javaBlockIdentifier.split("\\[")[0]);
|
validBlocksTemp.add(BlockUtils.getCleanIdentifier(javaBlockIdentifier));
|
||||||
this.validBlocks = ImmutableSet.copyOf(validBlocksTemp);
|
this.validBlocks = ImmutableSet.copyOf(validBlocksTemp);
|
||||||
} else {
|
} else {
|
||||||
this.validBlocks = Collections.singleton(javaBlockIdentifier.split("\\[")[0]);
|
this.validBlocks = Collections.singleton(BlockUtils.getCleanIdentifier(javaBlockIdentifier));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -272,7 +272,7 @@ public class BlockRegistryPopulator {
|
||||||
|
|
||||||
BlockStateValues.storeBlockStateValues(entry.getKey(), javaRuntimeId, entry.getValue());
|
BlockStateValues.storeBlockStateValues(entry.getKey(), javaRuntimeId, entry.getValue());
|
||||||
|
|
||||||
String cleanJavaIdentifier = entry.getKey().split("\\[")[0];
|
String cleanJavaIdentifier = BlockUtils.getCleanIdentifier(entry.getKey());
|
||||||
String bedrockIdentifier = entry.getValue().get("bedrock_identifier").asText();
|
String bedrockIdentifier = entry.getValue().get("bedrock_identifier").asText();
|
||||||
|
|
||||||
if (!BlockRegistries.JAVA_CLEAN_IDENTIFIERS.get().containsValue(cleanJavaIdentifier)) {
|
if (!BlockRegistries.JAVA_CLEAN_IDENTIFIERS.get().containsValue(cleanJavaIdentifier)) {
|
||||||
|
|
Loading…
Reference in a new issue