Compare commits
1 Commits
blank-tile
...
dirt-path-
| Author | SHA1 | Date | |
|---|---|---|---|
|
445dffd2d9
|
@@ -2882,7 +2882,7 @@ def crops8(self, blockid, data):
|
||||
|
||||
|
||||
# farmland and grass path (15/16 blocks)
|
||||
@material(blockid=[60, 208], data=list(range(2)), solid=True, transparent=True, nospawn=True)
|
||||
@material(blockid=[60, 208], data=list(range(2)), solid=True, nospawn=True)
|
||||
def farmland(self, blockid, data):
|
||||
if blockid == 60:
|
||||
side = self.load_image_texture("assets/minecraft/textures/block/dirt.png").copy()
|
||||
|
||||
@@ -984,6 +984,9 @@ class TileSet(object):
|
||||
# Ignore errors if it's "file doesn't exist"
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
logging.warning(
|
||||
"Tile %s was requested for render, but no children were found! "
|
||||
"This is probably a bug.", imgpath)
|
||||
return
|
||||
|
||||
# Create the actual image now
|
||||
@@ -1046,8 +1049,7 @@ class TileSet(object):
|
||||
The argument is a RenderTile object
|
||||
|
||||
The image is rendered and saved to disk in the place this tileset is
|
||||
configured to save images, unless the rendered image is blank, in
|
||||
which case no image is saved to disk.
|
||||
configured to save images.
|
||||
|
||||
"""
|
||||
|
||||
@@ -1071,6 +1073,18 @@ class TileSet(object):
|
||||
logging.debug("%s deleted", tile)
|
||||
return
|
||||
|
||||
# Create the directory if not exists
|
||||
dirdest = os.path.dirname(imgpath)
|
||||
if not os.path.exists(dirdest):
|
||||
try:
|
||||
os.makedirs(dirdest)
|
||||
except OSError as e:
|
||||
# Ignore errno EEXIST: file exists. Due to a race condition,
|
||||
# two processes could conceivably try and create the same
|
||||
# directory at the same time
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
# Compile this image
|
||||
tileimg = Image.new("RGBA", (384, 384), self.options['bgcolor'])
|
||||
|
||||
@@ -1106,24 +1120,6 @@ class TileSet(object):
|
||||
logging.error("Full error was:", exc_info=1)
|
||||
sys.exit(1)
|
||||
|
||||
# Don't save if the output is blank (384*384 pixels all colored bgcolor at 0% opacity)
|
||||
# The viewer will fill in this missing tile with the default blank tile created in the
|
||||
# AssetManager, so there's no need to spend compute time on compressing and disk space
|
||||
# & network traffic on serving a blank image.
|
||||
if tileimg.getcolors() == [(147456, self.options['bgcolor'])]:
|
||||
return
|
||||
|
||||
# Create the directory if not exists
|
||||
dirdest = os.path.dirname(imgpath)
|
||||
if not os.path.exists(dirdest):
|
||||
try:
|
||||
os.makedirs(dirdest)
|
||||
except OSError as e:
|
||||
# Ignore errno EEXIST: file exists. Due to a race condition,
|
||||
# two processes could conceivably try and create the same
|
||||
# directory at the same time
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
# Save them
|
||||
with FileReplacer(imgpath, capabilities=self.fs_caps) as tmppath:
|
||||
if self.imgextension == 'jpg':
|
||||
|
||||
Reference in New Issue
Block a user