Initial 1.16 block work
- Add ancient debris - Add basalt - Add polished basalt - Add soul campfire
This commit is contained in:
@@ -6,7 +6,7 @@ python:
|
|||||||
- "3.7"
|
- "3.7"
|
||||||
- "3.8"
|
- "3.8"
|
||||||
env:
|
env:
|
||||||
- MC_VERSION=1.15
|
- MC_VERSION=1.16.1
|
||||||
before_install:
|
before_install:
|
||||||
- wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/Imaging.h
|
- wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/Imaging.h
|
||||||
- wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImagingUtils.h
|
- wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImagingUtils.h
|
||||||
|
|||||||
@@ -273,14 +273,14 @@ If you want or need to provide your own textures, you have several options:
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
VERSION=1.15
|
VERSION=1.16.1
|
||||||
mkdir -p ~/.minecraft/versions/${VERSION}/
|
mkdir -p ~/.minecraft/versions/${VERSION}/
|
||||||
wget https://overviewer.org/textures/${VERSION} -O ~/.minecraft/versions/${VERSION}/${VERSION}.jar
|
wget https://overviewer.org/textures/${VERSION} -O ~/.minecraft/versions/${VERSION}/${VERSION}.jar
|
||||||
|
|
||||||
If that's too confusing for you, then just take this single line and paste it into
|
If that's too confusing for you, then just take this single line and paste it into
|
||||||
a terminal to get 1.15 textures::
|
a terminal to get 1.16 textures::
|
||||||
|
|
||||||
wget https://overviewer.org/textures/1.15 -O ~/.minecraft/versions/1.15/1.15.jar
|
wget https://overviewer.org/textures/1.16.1 -O ~/.minecraft/versions/1.16.1/1.16.1.jar
|
||||||
|
|
||||||
* You can also just run the launcher to install the client.
|
* You can also just run the launcher to install the client.
|
||||||
|
|
||||||
|
|||||||
@@ -239,6 +239,9 @@ def main():
|
|||||||
f = tex.find_file("assets/minecraft/textures/block/grass_block_top.png", verbose=True)
|
f = tex.find_file("assets/minecraft/textures/block/grass_block_top.png", verbose=True)
|
||||||
f = tex.find_file("assets/minecraft/textures/block/diamond_ore.png", verbose=True)
|
f = tex.find_file("assets/minecraft/textures/block/diamond_ore.png", verbose=True)
|
||||||
f = tex.find_file("assets/minecraft/textures/block/acacia_planks.png", verbose=True)
|
f = tex.find_file("assets/minecraft/textures/block/acacia_planks.png", verbose=True)
|
||||||
|
# 1.16
|
||||||
|
f = tex.find_file("assets/minecraft/textures/block/ancient_debris_top.png",
|
||||||
|
verbose=True)
|
||||||
except IOError:
|
except IOError:
|
||||||
logging.error("Could not find any texture files.")
|
logging.error("Could not find any texture files.")
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -260,6 +260,12 @@ enum mc_block_id {
|
|||||||
block_structure_block = 255,
|
block_structure_block = 255,
|
||||||
block_jigsaw = 256,
|
block_jigsaw = 256,
|
||||||
block_shulker_box = 257,
|
block_shulker_box = 257,
|
||||||
|
// 1.16 stuff
|
||||||
|
block_ancient_debris = 1000,
|
||||||
|
block_basalt = 1001,
|
||||||
|
block_polished_basalt = 1002,
|
||||||
|
block_soul_campfire = 1003,
|
||||||
|
|
||||||
block_prismarine_stairs = 11337,
|
block_prismarine_stairs = 11337,
|
||||||
block_dark_prismarine_stairs = 11338,
|
block_dark_prismarine_stairs = 11338,
|
||||||
block_prismarine_brick_stairs = 11339,
|
block_prismarine_brick_stairs = 11339,
|
||||||
|
|||||||
@@ -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 86
|
#define OVERVIEWER_EXTENSION_VERSION 87
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ class Textures(object):
|
|||||||
if verbose: logging.info("Found %s in '%s'", filename, path)
|
if verbose: logging.info("Found %s in '%s'", filename, path)
|
||||||
return open(path, mode)
|
return open(path, mode)
|
||||||
|
|
||||||
raise TextureException("Could not find the textures while searching for '{0}'. Try specifying the 'texturepath' option in your config file.\nSet it to the path to a Minecraft Resource pack.\nAlternately, install the Minecraft client (which includes textures)\nAlso see <http://docs.overviewer.org/en/latest/running/#installing-the-textures>\n(Remember, this version of Overviewer requires a 1.15-compatible resource pack)\n(Also note that I won't automatically use snapshots; you'll have to use the texturepath option to use a snapshot jar)".format(filename))
|
raise TextureException("Could not find the textures while searching for '{0}'. Try specifying the 'texturepath' option in your config file.\nSet it to the path to a Minecraft Resource pack.\nAlternately, install the Minecraft client (which includes textures)\nAlso see <http://docs.overviewer.org/en/latest/running/#installing-the-textures>\n(Remember, this version of Overviewer requires a 1.16-compatible resource pack)\n(Also note that I won't automatically use snapshots; you'll have to use the texturepath option to use a snapshot jar)".format(filename))
|
||||||
|
|
||||||
def load_image_texture(self, filename):
|
def load_image_texture(self, filename):
|
||||||
# Textures may be animated or in a different resolution than 16x16.
|
# Textures may be animated or in a different resolution than 16x16.
|
||||||
@@ -5459,18 +5459,21 @@ def barrel(self, blockid, data):
|
|||||||
return self.build_full_block(t_side.rotate(90), None, None, t_top, t_side.rotate(270))
|
return self.build_full_block(t_side.rotate(90), None, None, t_top, t_side.rotate(270))
|
||||||
|
|
||||||
|
|
||||||
# Campfire
|
# Campfire (11506) and soul campfire (1003)
|
||||||
@material(blockid=11506, data=list(range(8)), solid=True, transparent=True, nospawn=True)
|
@material(blockid=[11506, 1003], data=list(range(8)), solid=True, transparent=True, nospawn=True)
|
||||||
def campfire(self, blockid, data):
|
def campfire(self, blockid, data):
|
||||||
# Do rotation, mask to not clobber lit data
|
# Do rotation, mask to not clobber lit data
|
||||||
data = data & 0b100 | ((self.rotation + (data & 0b11)) % 4)
|
data = data & 0b100 | ((self.rotation + (data & 0b11)) % 4)
|
||||||
|
block_name = "campfire" if blockid == 11506 else "soul_campfire"
|
||||||
|
|
||||||
# Load textures
|
# Load textures
|
||||||
# Fire & lit log textures contain multiple tiles, since both are
|
# Fire & lit log textures contain multiple tiles, since both are
|
||||||
# 16px wide rely on load_image_texture() to crop appropriately
|
# 16px wide rely on load_image_texture() to crop appropriately
|
||||||
fire_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_fire.png")
|
fire_raw_t = self.load_image_texture("assets/minecraft/textures/block/" + block_name
|
||||||
|
+ "_fire.png")
|
||||||
log_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_log.png")
|
log_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_log.png")
|
||||||
log_lit_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_log_lit.png")
|
log_lit_raw_t = self.load_image_texture("assets/minecraft/textures/block/" + block_name
|
||||||
|
+ "_log_lit.png")
|
||||||
|
|
||||||
def create_tile(img_src, coord_crop, coord_paste, rot):
|
def create_tile(img_src, coord_crop, coord_paste, rot):
|
||||||
# Takes an image, crops a region, optionally rotates the
|
# Takes an image, crops a region, optionally rotates the
|
||||||
@@ -5683,3 +5686,22 @@ def bell(self, blockid, data):
|
|||||||
alpha_over(img, post_front_t, (0, 0), post_front_t)
|
alpha_over(img, post_front_t, (0, 0), post_front_t)
|
||||||
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
|
|
||||||
|
# Ancient Debris
|
||||||
|
block(blockid=[1000], top_image="assets/minecraft/textures/block/ancient_debris_top.png",
|
||||||
|
side_image="assets/minecraft/textures/block/ancient_debris_side.png")
|
||||||
|
|
||||||
|
|
||||||
|
# Basalt
|
||||||
|
@material(blockid=[1001, 1002], data=list(range(3)), solid=True)
|
||||||
|
def basalt(self, blockid, data):
|
||||||
|
block_name = "polished_basalt" if blockid == 1002 else "basalt"
|
||||||
|
top = self.load_image_texture("assets/minecraft/textures/block/" + block_name + "_top.png")
|
||||||
|
side = self.load_image_texture("assets/minecraft/textures/block/" + block_name + "_side.png")
|
||||||
|
if data == 0:
|
||||||
|
return self.build_block(top, side)
|
||||||
|
elif data == 1: # east-west orientation
|
||||||
|
return self.build_full_block(side.rotate(90), None, None, top, side.rotate(90))
|
||||||
|
elif data == 2: # north-south orientation
|
||||||
|
return self.build_full_block(side, None, None, side.rotate(270), top)
|
||||||
|
|||||||
@@ -686,6 +686,12 @@ class RegionSet(object):
|
|||||||
'minecraft:tube_coral_fan': (8, 0),
|
'minecraft:tube_coral_fan': (8, 0),
|
||||||
'minecraft:tube_coral_wall_fan': (8, 0),
|
'minecraft:tube_coral_wall_fan': (8, 0),
|
||||||
|
|
||||||
|
# Some 1.16 stuff that I'll arbitrarily shove in here due to ID bloat
|
||||||
|
'minecraft:ancient_debris': (1000, 0),
|
||||||
|
'minecraft:basalt': (1001, 0),
|
||||||
|
'minecraft:polished_basalt': (1002, 0),
|
||||||
|
'minecraft:soul_campfire': (1003, 0),
|
||||||
|
|
||||||
# New blocks
|
# New blocks
|
||||||
'minecraft:carved_pumpkin': (11300, 0),
|
'minecraft:carved_pumpkin': (11300, 0),
|
||||||
'minecraft:spruce_pressure_plate': (11301, 0),
|
'minecraft:spruce_pressure_plate': (11301, 0),
|
||||||
@@ -1029,6 +1035,9 @@ class RegionSet(object):
|
|||||||
data = 3
|
data = 3
|
||||||
if axis == 'z':
|
if axis == 'z':
|
||||||
data = 4
|
data = 4
|
||||||
|
elif key == 'minecraft:basalt' or key == 'minecraft:polished_basalt':
|
||||||
|
axis = palette_entry['Properties']['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']:
|
||||||
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
|
||||||
@@ -1141,7 +1150,7 @@ class RegionSet(object):
|
|||||||
# A moisture level of 7 has a different texture from other farmland
|
# A moisture level of 7 has a different texture from other farmland
|
||||||
data = 1 if palette_entry['Properties'].get('moisture', '0') == '7' else 0
|
data = 1 if palette_entry['Properties'].get('moisture', '0') == '7' else 0
|
||||||
elif key in ['minecraft:grindstone', 'minecraft:lectern', 'minecraft:campfire',
|
elif key in ['minecraft:grindstone', 'minecraft:lectern', 'minecraft:campfire',
|
||||||
'minecraft:bell']:
|
'minecraft:bell', 'minecraft:soul_campfire']:
|
||||||
p = palette_entry['Properties']
|
p = palette_entry['Properties']
|
||||||
data = {'south': 0, 'west': 1, 'north': 2, 'east': 3}[p['facing']]
|
data = {'south': 0, 'west': 1, 'north': 2, 'east': 3}[p['facing']]
|
||||||
if key == 'minecraft:grindstone':
|
if key == 'minecraft:grindstone':
|
||||||
@@ -1149,7 +1158,7 @@ class RegionSet(object):
|
|||||||
elif key == 'minecraft:lectern':
|
elif key == 'minecraft:lectern':
|
||||||
if p['has_book'] == 'true':
|
if p['has_book'] == 'true':
|
||||||
data |= 4
|
data |= 4
|
||||||
elif key == 'minecraft:campfire':
|
elif key == 'minecraft:campfire' or key == 'minecraft:soul_campfire':
|
||||||
if p['lit'] == 'true':
|
if p['lit'] == 'true':
|
||||||
data |= 4
|
data |= 4
|
||||||
elif key == 'minecraft:bell':
|
elif key == 'minecraft:bell':
|
||||||
|
|||||||
Reference in New Issue
Block a user