refactor Block byLegacy Function

This commit is contained in:
bixilon 2020-06-06 20:11:46 +02:00
parent 19f2c4a654
commit b968d772ba
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 5 additions and 5 deletions

View File

@ -89,7 +89,7 @@ public enum Block {
return legacyData;
}
public static Block getBlockByIdentifier(Identifier identifier) {
public static Block byIdentifier(Identifier identifier) {
for (Block b : values()) {
if (b.getIdentifier().equals(identifier)) {
return b;
@ -98,7 +98,7 @@ public enum Block {
return UNKNOWN;
}
public static Block getBlockByLegacy(int id, int data) {
public static Block byLegacy(int id, int data) {
for (Block b : values()) {
if (b.getLegacyId() == id && b.getLegacyData() == data) {
return b;
@ -107,8 +107,8 @@ public enum Block {
return UNKNOWN;
}
public static Block getBlockByLegacy(int id) {
return getBlockByLegacy(id, 0);
public static Block byLegacy(int id) {
return byLegacy(id, 0);
}

View File

@ -102,7 +102,7 @@ public class PacketChunkBulk implements ClientboundPacket {
// ToDo light, biome
blockMap.put(new ChunkNibbleLocation(nibbleX, nibbleY, nibbleZ), Block.getBlockByLegacy(singeBlockId, singleMeta));
blockMap.put(new ChunkNibbleLocation(nibbleX, nibbleY, nibbleZ), Block.byLegacy(singeBlockId, singleMeta));
arrayPos++;
}
}