Merge pull request #1151 from computertechie/fence_gates
Add support for the new fence gates
This commit is contained in:
@@ -313,7 +313,9 @@ generate_pseudo_data(RenderState *state, unsigned short ancilData) {
|
|||||||
} else if ((state->block == 85) || (state->block == 188) || (state->block == 189) ||
|
} else if ((state->block == 85) || (state->block == 188) || (state->block == 189) ||
|
||||||
(state->block == 190) || (state->block == 191) || (state->block == 192)) { /* fences */
|
(state->block == 190) || (state->block == 191) || (state->block == 192)) { /* fences */
|
||||||
/* check for fences AND fence gates */
|
/* check for fences AND fence gates */
|
||||||
return check_adjacent_blocks(state, x, y, z, state->block) | check_adjacent_blocks(state, x, y, z, 107);
|
return check_adjacent_blocks(state, x, y, z, state->block) | check_adjacent_blocks(state, x, y, z, 107) |
|
||||||
|
check_adjacent_blocks(state, x, y, z, 183) | check_adjacent_blocks(state, x, y, z, 184) | check_adjacent_blocks(state, x, y, z, 185) |
|
||||||
|
check_adjacent_blocks(state, x, y, z, 186) | check_adjacent_blocks(state, x, y, z, 187);
|
||||||
|
|
||||||
} else if (state->block == 55) { /* redstone */
|
} else if (state->block == 55) { /* redstone */
|
||||||
/* three addiotional bit are added, one for on/off state, and
|
/* three addiotional bit are added, one for on/off state, and
|
||||||
|
|||||||
@@ -26,7 +26,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 48
|
#define OVERVIEWER_EXTENSION_VERSION 49
|
||||||
|
|
||||||
/* Python PIL, and numpy headers */
|
/* Python PIL, and numpy headers */
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|||||||
@@ -1606,10 +1606,7 @@ def slabs(self, blockid, data):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if blockid == 43: # double slab
|
if blockid == 43 or blockid == 181: # double slab
|
||||||
return self.build_block(top, side)
|
|
||||||
|
|
||||||
if blockid == 181: # double red sandstone slab
|
|
||||||
return self.build_block(top, side)
|
return self.build_block(top, side)
|
||||||
|
|
||||||
# cut the side texture in half
|
# cut the side texture in half
|
||||||
@@ -3590,7 +3587,7 @@ def vines(self, blockid, data):
|
|||||||
return img
|
return img
|
||||||
|
|
||||||
# fence gates
|
# fence gates
|
||||||
@material(blockid=107, data=range(8), transparent=True, nospawn=True)
|
@material(blockid=[107, 183, 184, 185, 186, 187], data=range(8), transparent=True, nospawn=True)
|
||||||
def fence_gate(self, blockid, data):
|
def fence_gate(self, blockid, data):
|
||||||
|
|
||||||
# rotation
|
# rotation
|
||||||
@@ -3617,7 +3614,21 @@ def fence_gate(self, blockid, data):
|
|||||||
data = data | 0x4
|
data = data | 0x4
|
||||||
|
|
||||||
# create the closed gate side
|
# create the closed gate side
|
||||||
|
if blockid == 107: # Oak
|
||||||
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_oak.png").copy()
|
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_oak.png").copy()
|
||||||
|
elif blockid == 183: # Spruce
|
||||||
|
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_spruce.png").copy()
|
||||||
|
elif blockid == 184: # Birch
|
||||||
|
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_birch.png").copy()
|
||||||
|
elif blockid == 185: # Jungle
|
||||||
|
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_jungle.png").copy()
|
||||||
|
elif blockid == 186: # Dark Oak
|
||||||
|
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_big_oak.png").copy()
|
||||||
|
elif blockid == 187: # Acacia
|
||||||
|
gate_side = self.load_image_texture("assets/minecraft/textures/blocks/planks_acacia.png").copy()
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
gate_side_draw = ImageDraw.Draw(gate_side)
|
gate_side_draw = ImageDraw.Draw(gate_side)
|
||||||
gate_side_draw.rectangle((7,0,15,0),outline=(0,0,0,0),fill=(0,0,0,0))
|
gate_side_draw.rectangle((7,0,15,0),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||||
gate_side_draw.rectangle((7,4,9,6),outline=(0,0,0,0),fill=(0,0,0,0))
|
gate_side_draw.rectangle((7,4,9,6),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||||
|
|||||||
Reference in New Issue
Block a user