Skip to content

Commit

Permalink
Merge pull request #27 from stwalkerster/podzol-snow
Browse files Browse the repository at this point in the history
Fix podzol & mycelium snowy textures
  • Loading branch information
Gregory-AM authored Feb 5, 2024
2 parents 45bad4d + a5838c0 commit 45aca32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions overviewer_core/textures.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,15 +963,20 @@ def grass(self, blockid, data):


# dirt
@material(blockid=3, data=list(range(3)), solid=True)
@material(blockid=3, data=list(range(3))+[18], solid=True)
def dirt_blocks(self, blockid, data):
block_type = data & 0x0F

texture_map = [{"top": "dirt", "side": "dirt"}, # Normal
{"top": "coarse_dirt", "side": "coarse_dirt"}, # Coarse
{"top": "podzol_top", "side": "podzol_side"}] # Podzol
top_img = self.load_image_texture(BLOCKTEXTURE + "%s.png"
% texture_map[data]["top"])
% texture_map[block_type]["top"])
side_img = self.load_image_texture(BLOCKTEXTURE + "%s.png"
% texture_map[data]["side"])
% texture_map[block_type]["side"])

if data & 0x10:
side_img = self.load_image_texture(BLOCKTEXTURE + "grass_block_snow.png")

return self.build_block(top_img, side_img)

Expand Down Expand Up @@ -4948,7 +4953,15 @@ def fence_gate(self, blockid, data):
return img

# mycelium
block(blockid=110, top_image=BLOCKTEXTURE + "mycelium_top.png", side_image=BLOCKTEXTURE + "mycelium_side.png")
@material(blockid=110, data=[0, 0x10], solid=True)
def mycelium(self, blockid, data):
side_img = self.load_image_texture(BLOCKTEXTURE + "mycelium_side.png")
if data & 0x10:
side_img = self.load_image_texture(BLOCKTEXTURE + "grass_block_snow.png")
img = self.build_block(self.load_image_texture(BLOCKTEXTURE + "mycelium_top.png"), side_img)

return img

# warped_nylium & crimson_nylium
block(blockid=1006, top_image=BLOCKTEXTURE + "warped_nylium.png", side_image=BLOCKTEXTURE + "warped_nylium_side.png")
block(blockid=1007, top_image=BLOCKTEXTURE + "crimson_nylium.png", side_image=BLOCKTEXTURE + "crimson_nylium_side.png")
Expand Down
2 changes: 1 addition & 1 deletion overviewer_core/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ def _get_block(self, palette_entry):
block = 178
elif key == 'minecraft:redstone_wire':
data = palette_entry['Properties']['power']
elif key == 'minecraft:grass_block':
elif key in ['minecraft:grass_block', 'minecraft:mycelium', 'minecraft:podzol']:
if palette_entry['Properties']['snowy'] == 'true':
data |= 0x10
elif key == 'minecraft:snow':
Expand Down

0 comments on commit 45aca32

Please sign in to comment.