mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 07:20:04 -04:00
update block store
This commit is contained in:
parent
166093e641
commit
8f24a7f727
@ -9,18 +9,19 @@ public enum Block {
|
||||
COBBLESTONE(new Identifier("stone"), 4),
|
||||
WHITE_WOOL(new Identifier("wool"), 35, 0),
|
||||
RED_WOOL(new Identifier("wool", "red_wool"), 35, 14),
|
||||
DROPPER(new Identifier("dropper", "dropper"), 158, BlockRotation.RotationType.NORMAL);
|
||||
DROPPER_DOWN(new Identifier("dropper", "dropper"), 158, 0),
|
||||
DROPPER_EAST(new Identifier("dropper", "dropper"), 158, 1),
|
||||
DROPPER_NORTH(new Identifier("dropper", "dropper"), 158, 2),
|
||||
DROPPER_SOUTH(new Identifier("dropper", "dropper"), 158, 3),
|
||||
DROPPER_UP(new Identifier("dropper", "dropper"), 158, 4),
|
||||
DROPPER_WEST(new Identifier("dropper", "dropper"), 158, 5);
|
||||
|
||||
//ToDo all blocks
|
||||
//ToDo post water update block states
|
||||
|
||||
Identifier identifier;
|
||||
int legacyId;
|
||||
int legacyData;
|
||||
BlockRotation.RotationType rotationType;
|
||||
|
||||
Block(Identifier identifier, int legacyId, BlockRotation.RotationType rotationType) {
|
||||
this.identifier = identifier;
|
||||
this.legacyId = legacyId;
|
||||
this.rotationType = rotationType;
|
||||
}
|
||||
|
||||
Block(Identifier identifier, int legacyId, int legacyData) {
|
||||
this.identifier = identifier;
|
||||
@ -46,7 +47,4 @@ public enum Block {
|
||||
return legacyData;
|
||||
}
|
||||
|
||||
public BlockRotation.RotationType getRotationType() {
|
||||
return rotationType;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,17 @@
|
||||
package de.bixilon.minosoft.game.datatypes.blocks;
|
||||
|
||||
// Only for reference, will be removed very soon
|
||||
@Deprecated
|
||||
public interface BlockRotation {
|
||||
|
||||
int getId();
|
||||
|
||||
enum RotationType {
|
||||
BARELY,
|
||||
NORMAL,
|
||||
EXTENDED
|
||||
}
|
||||
|
||||
enum Barely implements BlockRotation {
|
||||
EAST(0),
|
||||
NORTH(1),
|
||||
SOUTH(2),
|
||||
WEST(3);
|
||||
|
||||
int id;
|
||||
|
||||
Barely(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static Barely byId(int id) {
|
||||
for (Barely b : values()) {
|
||||
if (b.getId() == id) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
enum Normal implements BlockRotation {
|
||||
@ -44,23 +22,7 @@ public interface BlockRotation {
|
||||
UP(4),
|
||||
WEST(5);
|
||||
|
||||
int id;
|
||||
|
||||
Normal(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static Normal byId(int id) {
|
||||
for (Normal n : values()) {
|
||||
if (n.getId() == id) {
|
||||
return n;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,23 +44,7 @@ public interface BlockRotation {
|
||||
SOUTH_EAST(14),
|
||||
SOUTH_SOUTH_EAST(15);
|
||||
|
||||
int id;
|
||||
|
||||
Extended(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static Extended byId(int id) {
|
||||
for (Extended e : values()) {
|
||||
if (e.getId() == id) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user