Skip to content

Commit

Permalink
1.2.4 blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
zydeco committed Mar 28, 2012
1 parent 756c798 commit de2f875
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/inventory.h
Expand Up @@ -13,7 +13,9 @@
#define GRASS_BYDATA (BYDATA_BASE+112)
#define STNBRICK_BYDATA (BYDATA_BASE+128)
#define LEAVES_BYDATA (BYDATA_BASE+144)
#define SPAWNEGG_BYDATA (BYDATA_BASE+160)
#define PLANK_BYDATA (BYDATA_BASE+160)
#define SANDSTN_BYDATA (BYDATA_BASE+176)
#define SPAWNEGG_BYDATA (BYDATA_BASE+192)
#define BYDATA_END (BYDATA_BASE+416)

#define ID_WOOL 35
Expand All @@ -26,6 +28,8 @@
#define ID_TALL_GRASS 31
#define ID_STONE_BRICK 98
#define ID_LEAVES 18
#define ID_PLANK 5
#define ID_SANDSTONE 24
#define ID_SPAWNEGG 383

// returns true if an item id must be stored with data too
Expand All @@ -41,6 +45,8 @@ static inline bool has_data(int16_t item) {
case ID_TALL_GRASS:
case ID_STONE_BRICK:
case ID_LEAVES:
case ID_PLANK:
case ID_SANDSTONE:
case ID_SPAWNEGG:
return true;
default:
Expand All @@ -65,6 +71,8 @@ static inline int data_id_get_item(int i) {
if (!is_data(i)) return i;
// compare in reverse order, big ones first
if (i >= SPAWNEGG_BYDATA) return ID_SPAWNEGG;
if (i >= SANDSTN_BYDATA) return ID_SANDSTONE;
if (i >= PLANK_BYDATA) return ID_PLANK;
if (i >= LEAVES_BYDATA) return ID_LEAVES;
if (i >= STNBRICK_BYDATA) return ID_STONE_BRICK;
if (i >= GRASS_BYDATA) return ID_TALL_GRASS;
Expand Down Expand Up @@ -109,6 +117,12 @@ static inline int item_data_id(int16_t item, int data) {
case ID_LEAVES:
data &= 3;
return LEAVES_BYDATA + (data < 4 ? data : 0);
case ID_PLANK:
data &= 3;
return PLANK_BYDATA + (data < 4 ? data : 0);
case ID_SANDSTONE:
data &= 3;
return SANDSTN_BYDATA + (data < 3 ? data : 0);
case ID_SPAWNEGG:
return SPAWNEGG_BYDATA + data;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Expand Up @@ -20,7 +20,7 @@ uint64_t * mcr_count(MCR *mcr, int mx, int mz, size_t max);
uint64_t * mca_count(MCR *mcr, int mx, int mz, size_t max);

#define ITEM_MAX 4608 // 4096 + space for item+data pairs
#define VERSION "1.5"
#define VERSION "1.5.1"
#define NTRIES 8

// some evil globals
Expand Down
Binary file added www/images/blocks/24.1_l.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/24.1_s.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/24.2_l.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/24.2_s.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/5.1_l.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/5.1_s.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/5.2_l.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/5.2_s.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/5.3_l.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/images/blocks/5.3_s.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion www/js/minecount.js
Expand Up @@ -8,6 +8,10 @@ blockNames = {
"3":"Dirt",
"4":"Cobblestone",
"5":"Wooden Plank",
"5.0":"Oak plank",
"5.1":"Pine Plank",
"5.2":"Birch Plank",
"5.3":"Jungle Wood Plank",
"6":"Sapling",
"6.0":"Oak Sapling",
"6.1":"Pine Sapling",
Expand Down Expand Up @@ -38,6 +42,9 @@ blockNames = {
"22":"Lapis Lazuli Block",
"23":"Dispenser",
"24":"Sandstone",
"24.0":"Sandstone",
"24.1":"Hieroglyphic Sandstone",
"24.2":"Smooth Sandstone",
"25":"Note Block",
"26":"Bed",
"27":"Powered Rail",
Expand Down Expand Up @@ -374,6 +381,8 @@ blockNames = {
};

blockAlias = {
"5.0":"5",
"24.0":"24",
"383.1":"383",
"383.2":"383",
"383.10":"383",
Expand All @@ -389,7 +398,7 @@ blockAlias = {
"383.53":"383",
"383.63":"383",
"383.97":"383",
"393.99":"383",
"383.99":"383",
"383.200":"383",
};

Expand Down

0 comments on commit de2f875

Please sign in to comment.