mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
Added layer encoders/decoders
This commit is contained in:
parent
03c934299f
commit
71c747c050
1 changed files with 16 additions and 0 deletions
|
@ -21,6 +21,10 @@ public class Block {
|
|||
this(0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public Block(int base, int back, int front) {
|
||||
this(base & 15, back & 65535, back >> 16 & 31, front & 65535, front >> 16 & 31, base >> 8 & 255, base >> 16 & 31);
|
||||
}
|
||||
|
||||
public Block(int baseItem, int backItem, int backMod, int frontItem, int frontMod, int liquidItem, int liquidMod) {
|
||||
this(ItemRegistry.getItem(baseItem), ItemRegistry.getItem(backItem), backMod, ItemRegistry.getItem(frontItem), frontMod, ItemRegistry.getItem(liquidItem), liquidMod);
|
||||
}
|
||||
|
@ -140,6 +144,10 @@ public class Block {
|
|||
return baseItem;
|
||||
}
|
||||
|
||||
public int getBase() {
|
||||
return baseItem.getId() | (((liquidItem.getId() & 255) << 8) | ((liquidMod) & 31) << 16);
|
||||
}
|
||||
|
||||
public Item getBackItem() {
|
||||
return backItem;
|
||||
}
|
||||
|
@ -148,6 +156,10 @@ public class Block {
|
|||
return backMod;
|
||||
}
|
||||
|
||||
public int getBack() {
|
||||
return backItem.getId() | ((backMod & 31) << 16);
|
||||
}
|
||||
|
||||
public Item getFrontItem() {
|
||||
return frontItem;
|
||||
}
|
||||
|
@ -156,6 +168,10 @@ public class Block {
|
|||
return frontMod;
|
||||
}
|
||||
|
||||
public int getFront() {
|
||||
return frontItem.getId() | ((frontMod & 31) << 16);
|
||||
}
|
||||
|
||||
public Item getLiquidItem() {
|
||||
return liquidItem;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue