0

soul lightning

This commit is contained in:
InrcedibleHolg
2020-08-23 09:55:29 +02:00
parent 619ce0a219
commit 66ef67bb78
4 changed files with 47 additions and 15 deletions

View File

@@ -306,6 +306,10 @@ enum mc_block_id {
block_crying_obsidian = 1035, block_crying_obsidian = 1035,
block_lodestone = 1036, block_lodestone = 1036,
block_respawn_anchor = 1037, block_respawn_anchor = 1037,
// soul lightning
block_soul_lantern = 1038,
block_soul_torch = 1039,
block_soul_fire = 1040,
// 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 1792 // in one numbering block starting at 1792

View File

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

View File

@@ -401,7 +401,18 @@ class Textures(object):
firetexture = (fireNS, fireEW) firetexture = (fireNS, fireEW)
self.firetexture = firetexture self.firetexture = firetexture
return firetexture return firetexture
def load_soul_fire(self):
"""Special-case function for loading soul_fire."""
soul_firetexture = getattr(self, "soul_firetexture", None)
if soul_firetexture:
return soul_firetexture
fireNS = self.load_image_texture("assets/minecraft/textures/block/soul_fire_0.png")
fireEW = self.load_image_texture("assets/minecraft/textures/block/soul_fire_1.png")
soul_firetexture = (fireNS, fireEW)
self.soul_firetexture = soul_firetexture
return soul_firetexture
def load_portal(self): def load_portal(self):
"""Special-case function for loading portal.""" """Special-case function for loading portal."""
portaltexture = getattr(self, "portaltexture", None) portaltexture = getattr(self, "portaltexture", None)
@@ -1794,8 +1805,8 @@ block(blockid=48, top_image="assets/minecraft/textures/block/mossy_cobblestone.p
# obsidian # obsidian
block(blockid=49, top_image="assets/minecraft/textures/block/obsidian.png") block(blockid=49, top_image="assets/minecraft/textures/block/obsidian.png")
# torch, redstone torch (off), redstone torch(on) # torch, redstone torch (off), redstone torch(on), soul_torch
@material(blockid=[50, 75, 76], data=[1, 2, 3, 4, 5], transparent=True) @material(blockid=[50, 75, 76, 1039], data=[1, 2, 3, 4, 5], transparent=True)
def torches(self, blockid, data): def torches(self, blockid, data):
# first, rotations # first, rotations
if self.rotation == 1: if self.rotation == 1:
@@ -1819,9 +1830,10 @@ def torches(self, blockid, data):
small = self.load_image_texture("assets/minecraft/textures/block/torch.png") small = self.load_image_texture("assets/minecraft/textures/block/torch.png")
elif blockid == 75: # off redstone torch elif blockid == 75: # off redstone torch
small = self.load_image_texture("assets/minecraft/textures/block/redstone_torch_off.png") small = self.load_image_texture("assets/minecraft/textures/block/redstone_torch_off.png")
else: # on redstone torch elif blockid == 76: # on redstone torch
small = self.load_image_texture("assets/minecraft/textures/block/redstone_torch.png") small = self.load_image_texture("assets/minecraft/textures/block/redstone_torch.png")
elif blockid == 1039: # soul torch
small= self.load_image_texture("assets/minecraft/textures/block/soul_torch.png")
# compose a torch bigger than the normal # compose a torch bigger than the normal
# (better for doing transformations) # (better for doing transformations)
torch = Image.new("RGBA", (16,16), self.bgcolor) torch = Image.new("RGBA", (16,16), self.bgcolor)
@@ -1865,10 +1877,14 @@ def torches(self, blockid, data):
return img return img
# lantern # lantern
@material(blockid=11373, data=[0, 1], transparent=True) @material(blockid=[11373, 1038], data=[0, 1], transparent=True)
def lantern(self, blockid, data): def lantern(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/lantern.png") if blockid == 11373:
inputtexture = self.load_image_texture("assets/minecraft/textures/block/lantern.png")
if blockid == 1038:
inputtexture = self.load_image_texture("assets/minecraft/textures/block/soul_lantern.png")
# # now create a textures, using the parts defined in lantern.json # # now create a textures, using the parts defined in lantern.json
@@ -2004,12 +2020,18 @@ def composter(self, blockid, data):
alpha_over(img, img2, (0, 0), img2) alpha_over(img, img2, (0, 0), img2)
return img return img
# fire # fire and soul_fire
@material(blockid=51, data=list(range(16)), transparent=True) @material(blockid=[51, 1040], data=list(range(16)), transparent=True)
def fire(self, blockid, data): def fire(self, blockid, data):
firetextures = self.load_fire() if blockid == 51:
side1 = self.transform_image_side(firetextures[0]) firetextures = self.load_fire()
side2 = self.transform_image_side(firetextures[1]).transpose(Image.FLIP_LEFT_RIGHT) side1 = self.transform_image_side(firetextures[0])
side2 = self.transform_image_side(firetextures[1]).transpose(Image.FLIP_LEFT_RIGHT)
elif blockid == 1040:
soul_firetextures = self.load_soul_fire()
side1 = self.transform_image_side(soul_firetextures[0])
side2 = self.transform_image_side(soul_firetextures[1]).transpose(Image.FLIP_LEFT_RIGHT)
img = Image.new("RGBA", (24,24), self.bgcolor) img = Image.new("RGBA", (24,24), self.bgcolor)

View File

@@ -758,6 +758,11 @@ class RegionSet(object):
'minecraft:crying_obsidian': (1035, 0), 'minecraft:crying_obsidian': (1035, 0),
'minecraft:lodestone': (1036, 0), 'minecraft:lodestone': (1036, 0),
'minecraft:respawn_anchor': (1037, 0), 'minecraft:respawn_anchor': (1037, 0),
# soul lightning
'minecraft:soul_lantern': (1038, 0),
'minecraft:soul_wall_torch': (1039, 0),
'minecraft:soul_torch': (1039, 5),
'minecraft:soul_fire': (1040, 0),
# New blocks # New blocks
'minecraft:carved_pumpkin': (11300, 0), 'minecraft:carved_pumpkin': (11300, 0),
@@ -1129,7 +1134,8 @@ class RegionSet(object):
elif key == 'minecraft:basalt' or key == 'minecraft:polished_basalt': elif key == 'minecraft:basalt' or key == 'minecraft:polished_basalt':
axis = palette_entry['Properties']['axis'] axis = palette_entry['Properties']['axis']
data = {'y': 0, 'x': 1, 'z': 2}[axis] data = {'y': 0, 'x': 1, 'z': 2}[axis]
elif key in ['minecraft:redstone_torch','minecraft:redstone_wall_torch','minecraft:wall_torch']: elif key in ['minecraft:redstone_torch','minecraft:redstone_wall_torch','minecraft:wall_torch',
'minecraft:soul_torch', 'minecraft:soul_wall_torch']:
if key.startswith('minecraft:redstone_') and palette_entry['Properties']['lit'] == 'true': if key.startswith('minecraft:redstone_') and palette_entry['Properties']['lit'] == 'true':
block += 1 block += 1
if key.endswith('wall_torch'): if key.endswith('wall_torch'):
@@ -1207,7 +1213,7 @@ class RegionSet(object):
'minecraft:pumpkin_stem', 'minecraft:potatoes', 'minecraft:carrots', 'minecraft:pumpkin_stem', 'minecraft:potatoes', 'minecraft:carrots',
'minecraft:sweet_berry_bush']: 'minecraft:sweet_berry_bush']:
data = palette_entry['Properties']['age'] data = palette_entry['Properties']['age']
elif key == 'minecraft:lantern': elif key in ['minecraft:lantern', 'minecraft:soul_lantern']:
if palette_entry['Properties']['hanging'] == 'true': if palette_entry['Properties']['hanging'] == 'true':
data = 1 data = 1
else: else: