0

add composter

This commit is contained in:
Ian Salmons
2019-11-01 11:45:00 +01:00
committed by InrcedibleHolg
parent 3c3e958eae
commit 9e27e6adc9
4 changed files with 31 additions and 2 deletions

View File

@@ -325,6 +325,7 @@ enum mc_block_id {
block_bamboo_sapling = 11413, block_bamboo_sapling = 11413,
block_scaffolding = 11414, block_scaffolding = 11414,
block_bamboo = 11416, block_bamboo = 11416,
block_composter = 11417,
// adding a gap in the numbering of walls to keep them all // adding a gap in the numbering of walls to keep them all
// in one numbering block starting at 21000 // in one numbering block starting at 21000
block_andesite_wall = 21000, block_andesite_wall = 21000,

View File

@@ -31,7 +31,7 @@
// increment this value if you've made a change to the c extesion // increment this value if you've made a change to the c extesion
// and want to force users to rebuild // and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 76 #define OVERVIEWER_EXTENSION_VERSION 77
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -1936,7 +1936,7 @@ def lantern(self, blockid, data):
return img return img
# bamboo # bamboo
@material(blockid=11416, data=[0], transparent=True) @material(blockid=11416, transparent=True)
def bamboo(self, blockid, data): def bamboo(self, blockid, data):
# get the multipart texture of the lantern # get the multipart texture of the lantern
inputtexture = self.load_image_texture("assets/minecraft/textures/block/bamboo_stalk.png") inputtexture = self.load_image_texture("assets/minecraft/textures/block/bamboo_stalk.png")
@@ -1994,6 +1994,31 @@ def bamboo(self, blockid, data):
alpha_over(img, top, (-4+xoff, -5), top) alpha_over(img, top, (-4+xoff, -5), top)
return img return img
# composter
@material(blockid=11417, data=list(range(9)), transparent=True)
def composter(self, blockid, data):
side = self.load_image_texture("assets/minecraft/textures/block/composter_side.png")
top = self.load_image_texture("assets/minecraft/textures/block/composter_top.png")
# bottom = self.load_image_texture("assets/minecraft/textures/block/composter_bottom.png")
if data == 0: # empty
return self.build_full_block(top, side, side, side, side)
if data == 8:
compost = self.transform_image_top(
self.load_image_texture("assets/minecraft/textures/block/composter_ready.png"))
else:
compost = self.transform_image_top(
self.load_image_texture("assets/minecraft/textures/block/composter_compost.png"))
nudge = {1: (0, 9), 2: (0, 8), 3: (0, 7), 4: (0, 6), 5: (0, 4), 6: (0, 2), 7: (0, 0), 8: (0, 0)}
img = self.build_full_block(None, side, side, None, None)
alpha_over(img, compost, nudge[data], compost)
img2 = self.build_full_block(top, None, None, side, side)
alpha_over(img, img2, (0, 0), img2)
return img
# fire # fire
@material(blockid=51, data=list(range(16)), transparent=True) @material(blockid=51, data=list(range(16)), transparent=True)
def fire(self, blockid, data): def fire(self, blockid, data):

View File

@@ -833,6 +833,7 @@ class RegionSet(object):
'minecraft:scaffolding': (11414, 0), 'minecraft:scaffolding': (11414, 0),
"minecraft:smooth_red_sandstone_stairs": (11415, 0), "minecraft:smooth_red_sandstone_stairs": (11415, 0),
'minecraft:bamboo': (11416, 0), 'minecraft:bamboo': (11416, 0),
"minecraft:composter": (11417, 0),
# adding a gap in the numbering of walls to keep them all # adding a gap in the numbering of walls to keep them all
# in one numbering block starting at 21000 # in one numbering block starting at 21000
'minecraft:andesite_wall': (21000, 0), 'minecraft:andesite_wall': (21000, 0),
@@ -1128,6 +1129,8 @@ class RegionSet(object):
data = 1 data = 1
else: else:
data = 0 data = 0
elif key == "minecraft:composter":
data = palette_entry['Properties']['level']
return (block, data) return (block, data)
def get_type(self): def get_type(self):