Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azalea blocks #2052

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion overviewer_core/src/block_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const mc_block_t block_class_stair[] = {
block_jungle_stairs,
block_crimson_stairs,
block_warped_stairs,
block_mangrove_stairs,
block_quartz_stairs,
block_acacia_stairs,
block_dark_oak_stairs,
Expand Down Expand Up @@ -162,7 +163,8 @@ const mc_block_t block_class_door[] = {
block_acacia_door,
block_dark_oak_door,
block_crimson_door,
block_warped_door};
block_warped_door,
block_mangrove_door};
const size_t block_class_door_len = COUNT_OF(block_class_door);

const mc_block_t block_class_ancil[] = {
Expand All @@ -174,6 +176,7 @@ const mc_block_t block_class_ancil[] = {
block_acacia_door,
block_dark_oak_door,
block_crimson_door,
block_mangrove_door,
block_oak_stairs,
block_brick_stairs,
block_stone_brick_stairs,
Expand All @@ -187,6 +190,7 @@ const mc_block_t block_class_ancil[] = {
block_dark_oak_stairs,
block_crimson_stairs,
block_warped_stairs,
block_mangrove_stairs,
block_red_sandstone_stairs,
block_smooth_red_sandstone_stairs,
block_purpur_stairs,
Expand Down Expand Up @@ -270,6 +274,7 @@ const mc_block_t block_class_alt_height[] = {
block_dark_oak_stairs,
block_crimson_stairs,
block_warped_stairs,
block_mangrove_stairs,
block_red_sandstone_stairs,
block_smooth_red_sandstone_stairs,
block_prismarine_stairs,
Expand Down
18 changes: 17 additions & 1 deletion overviewer_core/src/mc_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ enum mc_block_id {
block_dark_oak_stairs = 164,
block_crimson_stairs = 509,
block_warped_stairs = 510,
block_mangrove_stairs = 518,
block_slime = 165,
block_barrier = 166,
block_iron_trapdoor = 167,
Expand All @@ -194,8 +195,10 @@ enum mc_block_id {
block_jungle_fence_gate = 185,
block_dark_oak_fence_gate = 186,
block_acacia_fence_gate = 187,
block_crimson_fence_gate = 513,
block_crimson_fence_gate = 517,
block_warped_fence_gate = 514,
block_mangrove_fence_gate = 515,
block_mangrove_fence = 516,
block_spruce_fence = 188,
block_birch_fence = 189,
block_jungle_fence = 190,
Expand All @@ -210,6 +213,7 @@ enum mc_block_id {
block_crimson_door = 499,
block_warped_door = 500,
block_dark_oak_door = 197,
block_mangrove_door = 517,
block_end_rod = 198,
block_chorus_plant = 199,
block_chorus_flower = 200,
Expand Down Expand Up @@ -268,6 +272,10 @@ enum mc_block_id {
block_structure_block = 255,
block_jigsaw = 256,
block_shulker_box = 257,

block_pearlescent_froglight = 451,
block_verdant_froglight = 452,
block_ochre_froglight = 453,
// 1.16 stuff
block_ancient_debris = 1000,
block_basalt = 1001,
Expand All @@ -289,6 +297,11 @@ enum mc_block_id {
block_crimson_roots = 1019,
block_soul_soil = 1020,
block_nether_gold_ore = 1021,

block_frogspawn = 454,
block_azalea = 455,
block_target = 456,

// Solid Nether stone blocks
block_polished_blackstone = 1022,
block_chiseled_polished_blackstone = 1023,
Expand Down Expand Up @@ -504,6 +517,7 @@ enum mc_block_id {
block_dark_oak_sign = 11406,
block_crimson_sign = 12505,
block_warped_sign = 12506,
block_mangrove_sign = 12507,
block_oak_wall_sign = 11407,
block_spruce_wall_sign = 11408,
block_birch_wall_sign = 11409,
Expand All @@ -512,6 +526,7 @@ enum mc_block_id {
block_dark_oak_wall_sign = 11412,
block_crimson_wall_sign = 12507,
block_warped_wall_sign = 12508,
block_mangrove_wall_sign = 12509,
block_bamboo_sapling = 11413,
block_scaffolding = 11414,
block_bamboo = 11416,
Expand Down Expand Up @@ -713,6 +728,7 @@ enum mc_item_id {
item_dark_oak_door = 431,
item_crimson_door = 755,
item_warped_door = 756,
item_mangrove_door = 757,
item_chorus_fruit = 432,
item_popped_chorus_fruit = 433,
item_beetroot = 434,
Expand Down
2 changes: 1 addition & 1 deletion overviewer_core/src/overviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

// increment this value if you've made a change to the c extension
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 113
#define OVERVIEWER_EXTENSION_VERSION 115

#include <stdbool.h>
#include <stdint.h>
Expand Down
72 changes: 61 additions & 11 deletions overviewer_core/textures.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ def dirt_blocks(self, blockid, data):
block(blockid=4, top_image="assets/minecraft/textures/block/cobblestone.png")

# wooden planks
@material(blockid=5, data=list(range(8)), solid=True)
@material(blockid=5, data=list(range(9)), solid=True)
def wooden_planks(self, blockid, data):
if data == 0: # normal
return self.build_block(self.load_image_texture("assets/minecraft/textures/block/oak_planks.png"), self.load_image_texture("assets/minecraft/textures/block/oak_planks.png"))
Expand All @@ -996,6 +996,9 @@ def wooden_planks(self, blockid, data):
return self.build_block(self.load_image_texture("assets/minecraft/textures/block/crimson_planks.png"),self.load_image_texture("assets/minecraft/textures/block/crimson_planks.png"))
if data == 7: # warped
return self.build_block(self.load_image_texture("assets/minecraft/textures/block/warped_planks.png"),self.load_image_texture("assets/minecraft/textures/block/warped_planks.png"))
if data == 8: # warped
return self.build_block(self.load_image_texture("assets/minecraft/textures/block/mangrove_planks.png"),self.load_image_texture("assets/minecraft/textures/block/mangrove_planks.png"))


@material(blockid=6, data=list(range(16)), transparent=True)
def saplings(self, blockid, data):
Expand Down Expand Up @@ -1167,6 +1170,8 @@ def wood(self, blockid, data):
1126: {
0: ("mangrove_log_top.png", "mangrove_log.png"),
1: ("stripped_mangrove_log_top.png", "stripped_mangrove_log.png"),
2: ("mangrove_log.png", "mangrove_log.png"),
3: ("stripped_mangrove_log.png", "stripped_mangrove_log.png"),
},
}

Expand Down Expand Up @@ -2086,7 +2091,7 @@ def fire(self, blockid, data):
# smooth_red_sandstone blackstone polished_blackstone polished_blackstone_brick
# also all the copper variants
# also all deepslate variants
@material(blockid=[53, 67, 108, 109, 114, 128, 134, 135, 136, 156, 163, 164, 180, 203, 509, 510,
@material(blockid=[53, 67, 108, 109, 114, 128, 134, 135, 136, 156, 163, 164, 180, 203, 509, 510, 518,
11337, 11338, 11339, 11370, 11371, 11374, 11375, 11376, 11377, 11378, 11379,
11380, 11381, 11382, 11383, 11384, 11415, 1030, 1031, 1032, 1064, 1065, 1066,
1067, 1068, 1069, 1070, 1071, 1099, 1100, 1101, 1102],
Expand Down Expand Up @@ -2120,6 +2125,7 @@ def stairs(self, blockid, data):
203: "assets/minecraft/textures/block/purpur_block.png",
509: "assets/minecraft/textures/block/crimson_planks.png",
510: "assets/minecraft/textures/block/warped_planks.png",
518: "assets/minecraft/textures/block/mangrove_planks.png",
11337: "assets/minecraft/textures/block/prismarine.png",
11338: "assets/minecraft/textures/block/dark_prismarine.png",
11339: "assets/minecraft/textures/block/prismarine_bricks.png",
Expand Down Expand Up @@ -2902,7 +2908,7 @@ def farmland(self, blockid, data):


# signposts
@material(blockid=[63,11401,11402,11403,11404,11405,11406,12505,12506], data=list(range(16)), transparent=True)
@material(blockid=[63,11401,11402,11403,11404,11405,11406,12505,12506,12507], data=list(range(16)), transparent=True)
def signpost(self, blockid, data):

# first rotations
Expand All @@ -2924,6 +2930,7 @@ def signpost(self, blockid, data):
11406: ("dark_oak_planks.png", "dark_oak_log.png"),
12505: ("crimson_planks.png", "crimson_stem.png"),
12506: ("warped_planks.png", "warped_stem.png"),
12507: ("mangrove_planks.png", "mangrove_log.png"),
}
texture_path, texture_stick_path = ["assets/minecraft/textures/block/" + x for x in sign_texture[blockid]]

Expand Down Expand Up @@ -2971,7 +2978,7 @@ def signpost(self, blockid, data):

# wooden and iron door
# uses pseudo-ancildata found in iterate.c
@material(blockid=[64,71,193,194,195,196,197, 499, 500], data=list(range(32)), transparent=True)
@material(blockid=[64,71,193,194,195,196,197, 499, 500, 517], data=list(range(32)), transparent=True)
def door(self, blockid, data):
#Masked to not clobber block top/bottom & swung info
if self.rotation == 1:
Expand Down Expand Up @@ -3009,6 +3016,8 @@ def door(self, blockid, data):
raw_door = self.load_image_texture("assets/minecraft/textures/block/crimson_door_top.png")
elif blockid == 500: # warped door
raw_door = self.load_image_texture("assets/minecraft/textures/block/warped_door_top.png")
elif blockid == 517: # warped door
raw_door = self.load_image_texture("assets/minecraft/textures/block/mangrove_door_top.png")
else: # bottom of the door
if blockid == 64:
raw_door = self.load_image_texture("assets/minecraft/textures/block/oak_door_bottom.png")
Expand All @@ -3028,6 +3037,8 @@ def door(self, blockid, data):
raw_door = self.load_image_texture("assets/minecraft/textures/block/crimson_door_bottom.png")
elif blockid == 500: # warped door
raw_door = self.load_image_texture("assets/minecraft/textures/block/warped_door_bottom.png")
elif blockid == 517: # warped door
raw_door = self.load_image_texture("assets/minecraft/textures/block/mangrove_door_bottom.png")

# if you want to render all doors as closed, then force
# force closed to be True
Expand Down Expand Up @@ -3171,7 +3182,7 @@ def ladder(self, blockid, data):


# wall signs
@material(blockid=[68,11407,11408,11409,11410,11411,11412,12507,12508], data=[2, 3, 4, 5], transparent=True)
@material(blockid=[68,11407,11408,11409,11410,11411,11412,12507,12508,12509], data=[2, 3, 4, 5], transparent=True)
def wall_sign(self, blockid, data): # wall sign

# first rotations
Expand Down Expand Up @@ -3201,6 +3212,7 @@ def wall_sign(self, blockid, data): # wall sign
11412: "dark_oak_planks.png",
12507: "crimson_planks.png",
12508: "warped_planks.png",
12509: "mangrove_planks.png"
}
texture_path = "assets/minecraft/textures/block/" + sign_texture[blockid]
texture = self.load_image_texture(texture_path).copy()
Expand Down Expand Up @@ -3383,7 +3395,7 @@ def levers(self, blockid, data):
return img

# wooden and stone pressure plates, and weighted pressure plates
@material(blockid=[70, 72,147,148,11301,11302,11303,11304,11305, 1033,11517,11518], data=[0,1], transparent=True)
@material(blockid=[70, 72,147,148,11301,11302,11303,11304,11305, 1033,11517,11518,11519], data=[0,1], transparent=True)
def pressure_plate(self, blockid, data):
texture_name = {70:"assets/minecraft/textures/block/stone.png", # stone
72:"assets/minecraft/textures/block/oak_planks.png", # oak
Expand All @@ -3394,6 +3406,7 @@ def pressure_plate(self, blockid, data):
11305:"assets/minecraft/textures/block/dark_oak_planks.png", # dark oak
11517:"assets/minecraft/textures/block/crimson_planks.png", # crimson
11518:"assets/minecraft/textures/block/warped_planks.png", # warped
11519:"assets/minecraft/textures/block/mangrove_planks.png", # mangrove
147:"assets/minecraft/textures/block/gold_block.png", # light golden
148:"assets/minecraft/textures/block/iron_block.png", # heavy iron
1033:"assets/minecraft/textures/block/polished_blackstone.png"
Expand Down Expand Up @@ -3427,7 +3440,7 @@ def pressure_plate(self, blockid, data):
block(blockid=[73, 74], top_image="assets/minecraft/textures/block/redstone_ore.png")

# stone and wood buttons
@material(blockid=(77,143,11326,11327,11328,11329,11330,1034,11515,11516), data=list(range(16)), transparent=True)
@material(blockid=(77,143,11326,11327,11328,11329,11330,1034,11515,11516,11517), data=list(range(16)), transparent=True)
def buttons(self, blockid, data):

# 0x8 is set if the button is pressed mask this info and render
Expand Down Expand Up @@ -3463,7 +3476,8 @@ def buttons(self, blockid, data):
11330:"assets/minecraft/textures/block/dark_oak_planks.png",
1034:"assets/minecraft/textures/block/polished_blackstone.png",
11515:"assets/minecraft/textures/block/crimson_planks.png",
11516:"assets/minecraft/textures/block/warped_planks.png"
11516:"assets/minecraft/textures/block/warped_planks.png",
11517:"assets/minecraft/textures/block/mangrove_planks.png"
}[blockid]
t = self.load_image_texture(texturepath).copy()

Expand Down Expand Up @@ -3678,7 +3692,7 @@ def jukebox(self, blockid, data):
return self.build_block(self.load_image_texture("assets/minecraft/textures/block/jukebox_top.png"), self.load_image_texture("assets/minecraft/textures/block/note_block.png"))

# nether and normal fences
@material(blockid=[85, 188, 189, 190, 191, 192, 113, 511, 512], data=list(range(16)), transparent=True, nospawn=True)
@material(blockid=[85, 188, 189, 190, 191, 192, 113, 511, 512, 516], data=list(range(16)), transparent=True, nospawn=True)
def fence(self, blockid, data):
# create needed images for Big stick fence
if blockid == 85: # normal fence
Expand Down Expand Up @@ -3713,6 +3727,10 @@ def fence(self, blockid, data):
fence_top = self.load_image_texture("assets/minecraft/textures/block/warped_planks.png").copy()
fence_side = self.load_image_texture("assets/minecraft/textures/block/warped_planks.png").copy()
fence_small_side = self.load_image_texture("assets/minecraft/textures/block/warped_planks.png").copy()
elif blockid == 516: # mangrove fence
fence_top = self.load_image_texture("assets/minecraft/textures/block/mangrove_planks.png").copy()
fence_side = self.load_image_texture("assets/minecraft/textures/block/mangrove_planks.png").copy()
fence_small_side = self.load_image_texture("assets/minecraft/textures/block/mangrove_planks.png").copy()
else: # netherbrick fence
fence_top = self.load_image_texture("assets/minecraft/textures/block/nether_bricks.png").copy()
fence_side = self.load_image_texture("assets/minecraft/textures/block/nether_bricks.png").copy()
Expand Down Expand Up @@ -4221,7 +4239,7 @@ def build_torch(active):

# trapdoor
# the trapdoor is looks like a sprite when opened, that's not good
@material(blockid=[96,167,11332,11333,11334,11335,11336,12501,12502], data=list(range(16)), transparent=True, nospawn=True)
@material(blockid=[96,167,11332,11333,11334,11335,11336,12501,12502,12503], data=list(range(16)), transparent=True, nospawn=True)
def trapdoor(self, blockid, data):

# rotation
Expand Down Expand Up @@ -4252,6 +4270,7 @@ def trapdoor(self, blockid, data):
11336:"assets/minecraft/textures/block/dark_oak_trapdoor.png",
12501:"assets/minecraft/textures/block/crimson_trapdoor.png",
12502:"assets/minecraft/textures/block/warped_trapdoor.png",
12503:"assets/minecraft/textures/block/mangrove_trapdoor.png",
}[blockid]

if data & 0x4 == 0x4: # opened trapdoor
Expand Down Expand Up @@ -4483,7 +4502,7 @@ def vines(self, blockid, data):


# fence gates
@material(blockid=[107, 183, 184, 185, 186, 187, 513, 514], data=list(range(8)), transparent=True, nospawn=True)
@material(blockid=[107, 183, 184, 185, 186, 187, 513, 514, 515], data=list(range(8)), transparent=True, nospawn=True)
def fence_gate(self, blockid, data):

# rotation
Expand Down Expand Up @@ -4526,6 +4545,8 @@ def fence_gate(self, blockid, data):
gate_side = self.load_image_texture("assets/minecraft/textures/block/crimson_planks.png").copy()
elif blockid == 514: # Warped
gate_side = self.load_image_texture("assets/minecraft/textures/block/warped_planks.png").copy()
elif blockid == 515: # Mangrove
gate_side = self.load_image_texture("assets/minecraft/textures/block/mangrove_planks.png").copy()
else:
return None

Expand Down Expand Up @@ -4609,6 +4630,12 @@ def lilypad(self, blockid, data):

return self.build_full_block(None, None, None, None, None, t)

@material(blockid=454, nodata=True, transparent=True)
def frogspawn(self, blockid, data):
t = self.load_image_texture("assets/minecraft/textures/block/frogspawn.png")

return self.build_full_block(None, None, None, None, None, t)

# nether bricks
@material(blockid=112, data=list(range(3)), solid=True)
def nether_bricks(self, blockid, data):
Expand Down Expand Up @@ -4649,6 +4676,21 @@ def enchantment_table(self, blockid, data):

return img

@material(blockid=455, data=list(range(2)),transparent=True)
def azalea(self, blockid, data):
if data == 0: # just come up
top = self.load_image_texture("assets/minecraft/textures/block/azalea_top.png")
side = self.load_image_texture("assets/minecraft/textures/block/azalea_side.png")
if data == 1: # just come up
top = self.load_image_texture("assets/minecraft/textures/block/flowering_azalea_top.png")
side = self.load_image_texture("assets/minecraft/textures/block/flowering_azalea_side.png")
img = self.build_full_block(top, None, None, side, side)

t = self.load_image_texture("assets/minecraft/textures/block/azalea_plant.png")
stem = self.build_billboard(t)
alpha_over(img,stem,(0,-2))
return img

# brewing stand
# TODO this is a place holder, is a 2d image pasted
@material(blockid=117, data=list(range(5)), transparent=True)
Expand Down Expand Up @@ -5279,6 +5321,14 @@ def prismarine_block(self, blockid, data):
# sea lantern
block(blockid=169, top_image="assets/minecraft/textures/block/sea_lantern.png")

# target
block(blockid=456, top_image="assets/minecraft/textures/block/target_top.png", side_image="assets/minecraft/textures/block/target_side.png")

# froglights
block(blockid=451, top_image="assets/minecraft/textures/block/pearlescent_froglight_top.png", side_image="assets/minecraft/textures/block/pearlescent_froglight_side.png")
block(blockid=452, top_image="assets/minecraft/textures/block/verdant_froglight_top.png", side_image="assets/minecraft/textures/block/verdant_froglight_side.png")
block(blockid=453, top_image="assets/minecraft/textures/block/ochre_froglight_top.png", side_image="assets/minecraft/textures/block/ochre_froglight_side.png")

# hay block
@material(blockid=170, data=list(range(9)), solid=True)
def hayblock(self, blockid, data):
Expand Down
Loading