Skip to content

add stone nether blocks #1832

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

Closed
Closed
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
17 changes: 16 additions & 1 deletion overviewer_core/src/block_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ const mc_block_t block_class_stair[] = {
block_end_stone_brick_stairs,
block_red_nether_brick_stairs,
block_mossy_stone_brick_stairs,
block_smooth_sandstone_stairs};
block_smooth_sandstone_stairs,
block_blackstone_stairs,
block_polished_blackstone_stairs,
block_polished_blackstone_brick_stairs};
const size_t block_class_stair_len = COUNT_OF(block_class_stair);

const mc_block_t block_class_door[] = {
Expand Down Expand Up @@ -167,6 +170,9 @@ const mc_block_t block_class_ancil[] = {
block_end_stone_brick_stairs,
block_red_nether_brick_stairs,
block_smooth_sandstone_stairs,
block_blackstone_stairs,
block_polished_blackstone_stairs,
block_polished_blackstone_brick_stairs,
block_grass,
block_flowing_water,
block_water,
Expand All @@ -193,6 +199,9 @@ const mc_block_t block_class_ancil[] = {
block_red_sandstone_wall,
block_sandstone_wall,
block_stone_brick_wall,
block_blackstone_wall,
block_polished_blackstone_wall,
block_polished_blackstone_brick_wall,
block_double_plant,
block_stained_glass_pane,
block_stained_glass,
Expand Down Expand Up @@ -235,6 +244,9 @@ const mc_block_t block_class_alt_height[] = {
block_end_stone_brick_stairs,
block_red_nether_brick_stairs,
block_smooth_sandstone_stairs,
block_blackstone_stairs,
block_polished_blackstone_stairs,
block_polished_blackstone_brick_stairs,
block_prismarine_slab,
block_dark_prismarine_slab,
block_prismarine_brick_slab,
Expand All @@ -250,6 +262,9 @@ const mc_block_t block_class_alt_height[] = {
block_smooth_red_sandstone_slab,
block_cut_red_sandstone_slab,
block_end_stone_brick_slab,
block_blackstone_slab,
block_polished_blackstone_slab,
block_polished_blackstone_brick_slab,
block_mossy_cobblestone_slab,
block_mossy_stone_brick_slab,
block_smooth_quartz_slab,
Expand Down
20 changes: 20 additions & 0 deletions overviewer_core/src/mc_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@ enum mc_block_id {
block_crimson_roots = 1019,
block_soul_soil = 1020,
block_nether_gold_ore = 1021,
// Solid Nether stone blocks
block_polished_blackstone = 1022,
block_chiseled_polished_blackstone = 1023,
block_gilded_blackstone = 1024,
block_cracked_polished_blackstone_bricks = 1025,
block_polished_blackstone_bricks = 1026,
// Nether stone stairs
block_blackstone_stairs = 1030,
block_polished_blackstone_stairs = 1031,
block_polished_blackstone_brick_stairs = 1032,
// nether redstone blocks
block_polished_blackstone_pressure_plate = 1033,
block_polished_blackstone_button = 1034,

// adding a gap in the numbering of walls to keep them all
// in one numbering block starting at 1792
// all blocks between 1792 and 2047 are considered walls
Expand All @@ -299,6 +313,9 @@ enum mc_block_id {
block_red_sandstone_wall = 1803,
block_sandstone_wall = 1804,
block_stone_brick_wall = 1805,
block_blackstone_wall = 1806,
block_polished_blackstone_wall = 1807,
block_polished_blackstone_brick_wall = 1808,
// end of walls

block_prismarine_stairs = 11337,
Expand All @@ -319,6 +336,9 @@ enum mc_block_id {
block_smooth_red_sandstone_slab = 11352,
block_cut_red_sandstone_slab = 11353,
block_end_stone_brick_slab = 11354,
block_blackstone_slab = 1027,
block_polished_blackstone_slab = 1028,
block_polished_blackstone_brick_slab = 1029,
block_mossy_cobblestone_slab = 11355,
block_mossy_stone_brick_slab = 11356,
block_smooth_quartz_slab = 11357,
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 91
#define OVERVIEWER_EXTENSION_VERSION 92

#include <stdbool.h>
#include <stdint.h>
Expand Down
50 changes: 36 additions & 14 deletions overviewer_core/textures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1676,8 +1676,8 @@ def flower(self, blockid, data):
# double slabs and slabs
# these wooden slabs are unobtainable without cheating, they are still
# here because lots of pre-1.3 worlds use this blocks, add prismarine slabs
@material(blockid=[43, 44, 181, 182, 204, 205] + list(range(11340,11359)), data=list(range(16)),
transparent=[44, 182, 205] + list(range(11340,11359)), solid=True)
@material(blockid=[43, 44, 181, 182, 204, 205] + list(range(11340,11359)) + list(range(1027,1030)), data=list(range(16)),
transparent=[44, 182, 205] + list(range(11340,11359)) + list(range(1027,1030)), solid=True)
def slabs(self, blockid, data):
if blockid == 44 or blockid == 182:
texture = data & 7
Expand Down Expand Up @@ -1767,6 +1767,12 @@ def slabs(self, blockid, data):
elif blockid == 11358: # smooth_stone_slab
top = self.load_image_texture("assets/minecraft/textures/block/smooth_stone.png").copy()
side = self.load_image_texture("assets/minecraft/textures/block/smooth_stone_slab_side.png").copy()
elif blockid == 1027: # blackstone_slab
top = side = self.load_image_texture("assets/minecraft/textures/block/blackstone.png").copy()
elif blockid == 1028: # polished_blackstone_slab
top = side = self.load_image_texture("assets/minecraft/textures/block/polished_blackstone.png").copy()
elif blockid == 1029: # polished_blackstone_brick_slab
top = side = self.load_image_texture("assets/minecraft/textures/block/polished_blackstone_bricks.png").copy()

if blockid == 43 or blockid == 181 or blockid == 204: # double slab
return self.build_block(top, side)
Expand Down Expand Up @@ -2017,9 +2023,10 @@ def fire(self, blockid, data):
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch,
# jungle, quartz, red sandstone, (dark) prismarine, mossy brick and mossy cobblestone, stone smooth_quartz
# polished_granite polished_andesite polished_diorite granite diorite andesite end_stone_bricks red_nether_brick stairs
# smooth_red_sandstone_stairs
# smooth_red_sandstone blackstone polished_blackstone polished_blackstone_brick
@material(blockid=[53, 67, 108, 109, 114, 128, 134, 135, 136, 156, 163, 164, 180, 203, 11337, 11338, 11339,
11370, 11371, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 11381, 11382, 11383, 11384, 11415],
11370, 11371, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 11381, 11382, 11383, 11384, 11415,
1030, 1031, 1032],
data=list(range(128)), transparent=True, solid=True, nospawn=True)
def stairs(self, blockid, data):
# preserve the upside-down bit
Expand Down Expand Up @@ -2065,6 +2072,9 @@ def stairs(self, blockid, data):
11383: "assets/minecraft/textures/block/end_stone_bricks.png",
11384: "assets/minecraft/textures/block/red_nether_bricks.png",
11415: "assets/minecraft/textures/block/red_sandstone_top.png",
1030: "assets/minecraft/textures/block/blackstone.png",
1031: "assets/minecraft/textures/block/polished_blackstone.png",
1032: "assets/minecraft/textures/block/polished_blackstone_bricks.png",
}

texture = self.load_image_texture(stair_id_to_tex[blockid]).copy()
Expand Down Expand Up @@ -3278,7 +3288,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], data=[0,1], transparent=True)
@material(blockid=[70, 72,147,148,11301,11302,11303,11304,11305, 1033], 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 @@ -3289,6 +3299,7 @@ def pressure_plate(self, blockid, data):
11305:"assets/minecraft/textures/block/dark_oak_planks.png", # dark oak
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"
}[blockid]
t = self.load_image_texture(texture_name).copy()

Expand Down Expand Up @@ -3318,8 +3329,8 @@ def pressure_plate(self, blockid, data):
# normal and glowing redstone ore
block(blockid=[73, 74], top_image="assets/minecraft/textures/block/redstone_ore.png")

# stone a wood buttons
@material(blockid=(77,143,11326,11327,11328,11329,11330), data=list(range(16)), transparent=True)
# stone and wood buttons
@material(blockid=(77, 143, 11326, 11327, 11328, 11329, 11330, 1034), 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 @@ -3352,7 +3363,8 @@ def buttons(self, blockid, data):
11327:"assets/minecraft/textures/block/birch_planks.png",
11328:"assets/minecraft/textures/block/jungle_planks.png",
11329:"assets/minecraft/textures/block/acacia_planks.png",
11330:"assets/minecraft/textures/block/dark_oak_planks.png"
11330:"assets/minecraft/textures/block/dark_oak_planks.png",
1034:"assets/minecraft/textures/block/polished_blackstone.png"
}[blockid]
t = self.load_image_texture(texturepath).copy()

Expand Down Expand Up @@ -4350,10 +4362,7 @@ def fence_gate(self, blockid, data):
# warped_nylium & crimson_nylium
block(blockid=1006, top_image="assets/minecraft/textures/block/warped_nylium.png", side_image="assets/minecraft/textures/block/warped_nylium_side.png")
block(blockid=1007, top_image="assets/minecraft/textures/block/crimson_nylium.png", side_image="assets/minecraft/textures/block/crimson_nylium_side.png")
# soul soil
block(blockid=1020, top_image="assets/minecraft/textures/block/soul_soil.png")
# nether gold ore
block(blockid=1021, top_image="assets/minecraft/textures/block/nether_gold_ore.png")


# lilypad
# At the moment of writing this lilypads has no ancil data and their
Expand Down Expand Up @@ -4686,7 +4695,7 @@ def beacon(self, blockid, data):

# cobblestone and mossy cobblestone walls, chorus plants, mossy stone brick walls
# one additional bit of data value added for mossy and cobblestone
@material(blockid=[199]+list(range(1792, 1805 + 1)), data=list(range(32)), transparent=True, nospawn=True)
@material(blockid=[199]+list(range(1792, 1808 + 1)), data=list(range(32)), transparent=True, nospawn=True)
def cobblestone_wall(self, blockid, data):
walls_id_to_tex = {
199: "assets/minecraft/textures/block/chorus_plant.png", # chorus plants
Expand All @@ -4703,7 +4712,10 @@ def cobblestone_wall(self, blockid, data):
1802: "assets/minecraft/textures/block/red_nether_bricks.png",
1803: "assets/minecraft/textures/block/red_sandstone.png",
1804: "assets/minecraft/textures/block/sandstone.png",
1805: "assets/minecraft/textures/block/stone_bricks.png"
1805: "assets/minecraft/textures/block/stone_bricks.png",
1806: "assets/minecraft/textures/block/blackstone.png",
1807: "assets/minecraft/textures/block/polished_blackstone.png",
1808: "assets/minecraft/textures/block/polished_blackstone_bricks.png"
}
t = self.load_image_texture(walls_id_to_tex[blockid]).copy()

Expand Down Expand Up @@ -5710,3 +5722,13 @@ def basalt(self, blockid, data):

# Netherite
block(blockid=[1005], top_image="assets/minecraft/textures/block/netherite_block.png")
# soul soil
block(blockid=1020, top_image="assets/minecraft/textures/block/soul_soil.png")
# nether gold ore
block(blockid=1021, top_image="assets/minecraft/textures/block/nether_gold_ore.png")
# Solid Nether stone blocks
block(blockid=1022, top_image="assets/minecraft/textures/block/polished_blackstone.png")
block(blockid=1023, top_image="assets/minecraft/textures/block/chiseled_polished_blackstone.png")
block(blockid=1024, top_image="assets/minecraft/textures/block/gilded_blackstone.png")
block(blockid=1025, top_image="assets/minecraft/textures/block/cracked_polished_blackstone_bricks.png")
block(blockid=1026, top_image="assets/minecraft/textures/block/polished_blackstone_bricks.png")
35 changes: 34 additions & 1 deletion overviewer_core/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,23 @@ def __init__(self, regiondir, rel):
'minecraft:crimson_roots': (1019, 0),
'minecraft:soul_soil': (1020, 0),
'minecraft:nether_gold_ore': (1021, 0),
# Solid Nether stone blocks
'minecraft:polished_blackstone': (1022, 0),
'minecraft:chiseled_polished_blackstone': (1023, 0),
'minecraft:gilded_blackstone': (1024, 0),
'minecraft:cracked_polished_blackstone_bricks': (1025, 0),
'minecraft:polished_blackstone_bricks': (1026, 0),
# Nether slabs
'minecraft:blackstone_slab': (1027, 0),
'minecraft:polished_blackstone_slab': (1028, 0),
'minecraft:polished_blackstone_brick_slab': (1029, 0),
# Nether stairs
'minecraft:blackstone_stairs': (1030, 0),
'minecraft:polished_blackstone_stairs': (1031, 0),
'minecraft:polished_blackstone_brick_stairs': (1032, 0),
# nether redstone blocks
'minecraft:polished_blackstone_pressure_plate': (1033, 0),
'minecraft:polished_blackstone_button': (1034,0),

# New blocks
'minecraft:carved_pumpkin': (11300, 0),
Expand Down Expand Up @@ -839,6 +856,7 @@ def __init__(self, regiondir, rel):
'minecraft:campfire': (11506, 0),
'minecraft:bell': (11507, 0),
# adding a gap in the numbering of walls to keep them all
# blocks >= 1792 and <= 2047 are considered walls
'minecraft:andesite_wall': (1792, 0),
'minecraft:brick_wall': (1793, 0),
'minecraft:cobblestone_wall': (1794, 0),
Expand All @@ -853,6 +871,9 @@ def __init__(self, regiondir, rel):
'minecraft:red_sandstone_wall': (1803, 0),
'minecraft:sandstone_wall': (1804, 0),
'minecraft:stone_brick_wall': (1805, 0),
'minecraft:blackstone_wall': (1806, 0),
'minecraft:polished_blackstone_wall': (1807, 0),
'minecraft:polished_blackstone_brick_wall': (1808, 0),
}

colors = [ 'white', 'orange', 'magenta', 'light_blue',
Expand Down Expand Up @@ -893,8 +914,11 @@ def _get_block(self, palette_entry):
'minecraft:cut_sandstone_slab','minecraft:smooth_red_sandstone_slab',
'minecraft:cut_red_sandstone_slab','minecraft:end_stone_brick_slab',
'minecraft:mossy_cobblestone_slab','minecraft:mossy_stone_brick_slab',
'minecraft:smooth_quartz_slab','minecraft:smooth_stone_slab'
'minecraft:smooth_quartz_slab','minecraft:smooth_stone_slab',
'minecraft:blackstone_slab','minecraft:polished_blackstone_slab',
'minecraft:polished_blackstone_brick_slab'
)

prismarine_slabs = ('minecraft:prismarine_slab','minecraft:dark_prismarine_slab','minecraft:prismarine_brick_slab')

key = palette_entry['Name']
Expand Down Expand Up @@ -1004,6 +1028,15 @@ def _get_block(self, palette_entry):
elif key == 'minecraft:smooth_stone_slab':
block = 11313 # minecraft:smooth_stone
data = 0
elif key == 'minecraft:blackstone_slab':
block = 1004 # blackstone
data = 0
elif key == 'minecraft:polished_blackstone_slab':
block = 1022 # polished_blackstone
data = 0
elif key == 'minecraft:polished_blackstone_brick_slab':
block = 1026 # polished_blackstone_bricks
data = 0

elif key in prismarine_slabs:
block = 168 # minecraft:prismarine variants
Expand Down