0
Commit Graph

284 Commits

Author SHA1 Message Date
Bernd Buschinski
49339af795 Fixes snow height rendering 2021-05-15 17:40:26 +02:00
Joseph Camp
b29c9e9ffc world: Fix melon/pumpkin/mushroom stem rendering
Previous check for warped & crimson stem blocks was too inclusive,
causing stems of melons, pumpkins, and mushrooms to be interpreted
as air blocks
2020-08-06 23:18:07 +00:00
Nicolas F
50b84e95b5 Merge pull request #1791 from overviewer/116-blocks 2020-08-05 19:05:57 +02:00
InrcedibleHolg
0a9d1961c5 add soul_soil, nether_gold_ore, removelist 2020-08-04 19:38:23 +02:00
Nicolas F
11aabbfd9f world: fix 1.16 block unpacking
Fixes #1797.
2020-07-28 13:08:43 +02:00
InrcedibleHolg
3ac090a7a0 nether biomes 2020-07-17 00:21:29 +02:00
Nicolas F
fcb3f2644d Shuffle around wall IDs, change wall check
Previously, walls were all numbered at 21000+. This is bad because
our blockmap is an array, so this caused our blockmap to take up
80 MiB of RAM in each worker process.

This commit changes the wall numbering, and exploits some bitmasking
to have the wall check run in constant time no matter how many walls
there are. This is done with a simple mask and xor to check the prefix.

RAM usage for the blockmap thus drops to like 44 MiB.

This is in preparation for adding more walls for 1.16.
2020-07-13 19:15:47 +02:00
Nicolas F
8c0028495d world: work around minecraft palette bugs
Instead of trusting that Minecraft will only request up to index
num_palette_entries - 1, we'll assume Mojang occasionally produces
a weird file where it tries to request past that, up to the maximum
palette index it can based on the bits per value. To facilitate this,
this commit extends the translation palette array to this maximum size.

Such invalid palette picks will simply be replaced by ID 0 (aka air),
so it should cause minimal weirdness in the output.

Works around #1797.
2020-07-09 18:33:39 +02:00
Nicolas F
a3e4812ca9 world: skip zero-size region files
Minecraft 1.16.1 loves writing these in singleplayer, and they
cause a whole bunch of corruption warnings if we don't handle them
in a special way like this.
2020-07-03 13:10:23 +02:00
Nicolas F
fd2c0a057a Add blackstone and netherite blocks 2020-07-03 13:10:23 +02:00
Nicolas F
bc56346bad Initial 1.16 block work
- Add ancient debris
- Add basalt
- Add polished basalt
- Add soul campfire
2020-07-03 13:10:23 +02:00
Nicolas F
d3a5786642 world: work around Minecraft lighting nonsense
Minecraft occasionally generates chunks which are not yet lit.
In the past, I'd have said to just make them not render, but these
can sometimes be large areas of the world.

Instead, render them with full bright SkyLight. This looks less bad
than whatever is stored in the SkyLight property in these cases.

Closes #1787, probably. Only one person bothered providing a sample file.
2020-06-25 18:55:48 +02:00
Nicolas F
1355f8c49e world: retry chunk read on OSError too
Closes #1790.

If a chunk fails reading due to an underlying operating system
IO error, we can invoke the retry logic too. No clue what could
cause this to happen beyond hardware faults.

Also lower the sleep time to 0.25s down from 0.5s because half a
second of sleeping for each chunk this happens on seems incredibly
overkill.

Making the nbt code raise a CorruptChunkError in this case also means
that failing to read a chunk due to an IOError is not a fatal error
anymore, it'll simply skip it and move on.
2020-06-25 15:37:17 +02:00
Joseph Camp
297a940a4b Amend loom rendering
- Account for render direction & block facing data
2020-06-23 23:35:43 +00:00
Joseph Camp
efc345313d Add bell texture 2020-06-23 23:35:43 +00:00
Joseph Camp
99864d99a7 Add campfire texture 2020-06-23 23:35:43 +00:00
Joseph Camp
9365cce160 Amend lectern rendering
- Replaces exising implementation with a texture that better
  resembles the in game block, accounting for its facing & whether
  a book has been placed or not
2020-06-23 23:35:43 +00:00
Joseph Camp
cde059e9a6 Amend stonecutter rendering
- Account for facing when generating textures
- Render block top at the appropriate height & add saw blade
2020-06-23 23:35:43 +00:00
Joseph Camp
3bfe52013d Amend grindstone rendering
- Replaces existing implementation with a texture that better
  resembles the in game block and accounts for its facing & what
  surface it is attached to (ceiling, wall, or floor)
2020-06-23 23:35:42 +00:00
Joseph Camp
8e1eeb2170 Amend glazed terracotta rendering
- Reduce data range to prevent excessive texture generation
- Correct rotation of side 4 texture
- Simplify texture generation code
2020-06-23 23:35:42 +00:00
Joseph Camp
b2244f5b76 Amend observer rendering
- Allow rendering of powered observers with appropriate back texture
2020-06-23 23:35:41 +00:00
Joseph Camp
0bb4785008 Amend shulker box rendering
- Correct shulker box side textures being resized to 4x4 resolution
- Use intended texture for 'uncolored' shulker boxes instead of purple
2020-06-23 23:33:56 +00:00
Joseph Camp
7e0c880a58 Add mushroom block & vine variants
- Add all possible variants of mushroom blocks introduced in 1.13
- Render mushroom stems similarly to red/brown mushroom blocks
- Add vine variants where vines are on the upwards facing side
2020-06-23 23:33:55 +00:00
Joseph Camp
b6716a898a Fix chiseled sandstone rendering
- Resolve data value mismatch between textures.py and world.py
2020-06-23 23:33:55 +00:00
Joseph Camp
29eff95f8b Amend (blast) furnace & smoker rendering
- Use 'lit' property to determine when block is on or off
- Account for facing when generating textures
- Clean up smoker/furnace/dispenser/dropper texture generation code
2020-06-23 23:33:55 +00:00
Joseph Camp
6d5ccdfd54 Amend farmland rendering
- Use 'moisture' property to determine when to render farmland as moist
2020-06-23 23:33:55 +00:00
Joseph Camp
16753aad79 Fix cake rendering
- Use 'bites' property to determine which cut of cake to render
2020-06-23 23:33:55 +00:00
Joseph Camp
63eefb2423 Amend redstone repeater delay rendering
- Use 'delay' property to determine offset of repeater torch
2020-06-23 23:33:55 +00:00
Joseph Camp
268e773c11 Amend structure block variant rendering
- Use 'mode' property to determine which variant of block to render
2020-06-23 23:33:55 +00:00
Joseph Camp
70ce68da4b Add Jigsaw block 2020-06-23 23:33:55 +00:00
Joseph Camp
46d48bf1f8 Fix cauldron water rendering
- Use cauldron 'level' property to determine water level
2020-06-23 23:33:55 +00:00
Joseph Camp
c30e976cbd Amend end portal frame rendering
- Use portal frame 'eye' property to allow ender eye to be rendered
- Use portal frame 'facing' property to determine block rotation
2020-06-23 23:33:55 +00:00
Joseph Camp
4ee5673e0d Add piston variant rendering & fix lighting
- Fix extended pistons rendering as if they were retracted
- Fix retracted pistons rendering completely dark when using a
  lighting rendermode primitive
- Use piston head 'facing' property to determine rotation
- Use piston head 'type' property to determine if sticky or not
2020-06-23 23:33:52 +00:00
Joseph Camp
2a7280f8bf Add colored beds & use bed facing/type properties
- Add beds with colors other than red
- Use bed 'facing' property to determine bed's rotation
- Use bed 'type' property to determine if the head or foot is rendered
- Correct faulty logic during bed texture generation
2020-06-23 22:27:04 +00:00
InrcedibleHolg
8c08b44a38 add flowers and berries 2020-06-13 16:45:50 +02:00
Nicolas F
678048177d Merge pull request #1755 from cliffmeyers
fix a bug where multiple renders of the same world led to repeat genPOI scans
2020-05-23 16:27:05 +02:00
Alexander Rath
9e7bd98410 make 20w17a blockstate code cleaner 2020-05-22 10:27:47 +02:00
Alexander Rath
5ff3e2b09f world: add support for 20w17a blockstates 2020-04-23 01:19:35 +02:00
Cliff Meyers
61903939a3 remove __lt__ from RegionSet & wrapper as it's no longer used in genPOI 2020-04-15 08:06:12 -04:00
Nicolas F
d8b3183a88 Merge PR 1717 from DragonDev1906 2020-02-14 21:21:58 +01:00
Nicolas F
6251a6c730 Merge PR #1716 by Auron956 2020-02-11 07:38:43 +01:00
Nicolas F
58ae9dc529 Merge pull request #1670 from robosphinx/patch-1
Change lava ID from 10 to 11 (Fixes issue #1551)
2020-02-11 07:27:00 +01:00
Jens
e9bb7d340e Add regiondir property to CroppedRegionSet
- CroppedRegionSet is a Wrapper for RegionSet and should have all of
  it's Variables / Parameters
- genPOI sorts a list by (Cropped)RegionSet objects
- The comparing method (__lt__) was correct in CroppedRegionSet but not
  in RegionSet. To prevent this issue from happening again, the
  RegionSetWrapper now has the regiondir property, too
- Fixes Issue: #1706
- Example config: see below

def testFilter(poi):
    if poi['id'] == 'Town':
        return poi['name']
def townFilter(poi):
    if poi['id'] == 'Town':
        return poi['name']

renders["normalrender"] = {
    "world": "Test12985",
    "title": "Normal Render of Testworld",
    'markers': [dict(name="Towns", filterFunction=townFilter), dict(name="Test", filterFunction=testFilter)],
}

renders["secondrender"] = {
    "world": "Test12985",
    "title": "Second Render of Testworld",
    "crop": (180, -230, 220, -260),
    'markers': [dict(name="Towns", filterFunction=townFilter), dict(name="Test", filterFunction=testFilter)],
}
2020-02-06 20:14:08 +01:00
Auron956
a3960bd419 Fix chest rendering by using 'type' property
Resolves an issue where chests with more than one adjacent chest would
fail to render. Instead of distinguishing double from single chests by
checking for the presence of adjacent chests, use the provided "type"
property of chests to determine if they are single or the left/right
part of a double chest.
2020-02-04 00:16:28 +00:00
Jens
2c6a77b051 Add Barrel Block
- Barrel Block with 6 directions and open/closed state
- One of the missing Blocks in #1613
2020-02-03 18:02:42 +01:00
Gijs Oortgiese
885fa75f54 Add bee_hive, beenest, honeycom_block and honey_block 2019-12-27 14:17:34 +01:00
Nicolas F
0b74d26c49 Completely change biome code again
Turns out my previous grasp of how Minecraft does this was wrong.

This seems to be the correct way. One side effect is that biome data
now has less resolution. One only really notices this when looking at
water, for which Minecraft does not even use the water colours for
in-game, otherwise I can't really tell a big difference.

Fixes #1698.
2019-12-23 23:50:20 +01:00
Nicolas F
2b699d0355 world: fix door block translation code
Fixes #1697.
2019-12-23 19:06:51 +01:00
Nicolas F
268938a706 Fix biomes for Minecraft 1.15
Fixes #1650.

Mojang changed the biomes code so that it now can have different
biomes for different Y levels. We need to adjust our logic accordingly,
which is done through some small BiomeDispensary class where we shove
a numpy'd Mojang array in and can then read out the biomes for each level.

Biome data is now stored per-section, which needed some changes on the C
side of things. I didn't change anything in the biome overlay code so
I wouldn't be surprised if it's broken now, but for the time being I'd
rather have 1.15 fixed than some obscure overlay.

Tested to work with 1.14 and 1.15 data. No new biomes have been added
to the code yet.
2019-12-10 23:12:16 +01:00
Florian Graf
19086b3ea5 Fixed incorrect rendering of blocks (issue #1578)
The unpacking of the block states missed a single bit
when the bits per value was 7. Every 7 bytes it would
miss one bit and store it as 0 instead of the actual
value. This happened because 0xfc was used instead of
0xfe. 0xfc has six bits set to 1 and two to 0. 0xfe
has correctly set seven bits and one bit to 0. We need
those seven bits and not just the six.
2019-12-07 20:50:37 +01:00