Commit Graph
100 Commits
Author SHA1 Message Date
Nicolas FandGitHub 98fe552790 Merge pull request #1786 from IncredibleHolg/flowers-berry
add flowers and berries
2020-06-14 18:58:48 +02:00
Nicolas FandGitHub 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
Nicolas F 98f83af4df Merge PR #1759 from iRath96 2020-05-22 16:21:02 +02:00
Nicolas FandGitHub dc6f8cfcbd Merge pull request #1747 from cliffmeyers
Apply consisting sorting to markers JS files in genPOI
2020-04-12 21:06:24 +02:00
Nicolas F 7af188da4e textures: better error logging for corrupt files
Sometimes people's texture packs contain weird things, and it'd
be good if instead of throwing an unhandled IOError, we raise
a TextureException with the filename in it.

Also, make verbose mode actually run find_file in verbose mode,
which is useful for finding where Overviewer loaded that texture
file from.
2020-03-30 07:47:16 +02:00
Nicolas F e5ec41fcf9 Revert "textures: remove baffling texture generation logic"
This reverts commit 9895fe875b.

The original code was correct, but confusing. Overviewer did regenerate
the texture in each worker process because Python pickling is incredibly
fragile fucking garbage designed by idiots who have no clue of what
a good language looks like.
2020-03-02 19:59:18 +01:00
Nicolas F 9895fe875b textures: remove baffling texture generation logic
We used to generate textures multiple times for each worker process,
which didn't seem to be intended as it was done gated behind a reversed
if statement. It just so happened to fix an issue introduced by the
pickling code which was deleting vital attributes like the actual
generated textures.

I'm honestly not sure why this was ever done, so let's just throw this
out and call it a day.

Fixes #1728
2020-02-19 15:06:42 +01:00
Nicolas F 51efdbaa4e overviewer.h: bump extension version 2020-02-14 21:26:34 +01:00
Nicolas F d8b3183a88 Merge PR 1717 from DragonDev1906 2020-02-14 21:21:58 +01:00
Nicolas F 1d8279243d genPOI: polyline text improvements
Don't require text for polylines/polygons, and support hovertext
by utilising leaflet's tooltips.
2020-02-13 18:35:20 +01:00
Nicolas F 2c92b4acf9 Merge PR 1649 from deltaidea 2020-02-13 17:40:35 +01:00
Nicolas F 6fdf78c35f overviewer.h: bump extension version 2020-02-13 17:36:20 +01:00
Nicolas F 27e63d4aa6 Merge PR 1704 from dgrimreaper 2020-02-13 17:32:30 +01:00
Nicolas F 3575b8d4e7 travis: hopefully fix build by replacing 3.8-dev 2020-02-12 20:48:08 +01:00
Nicolas F a929b55d4e observer: minor change to LoggingObserver interval
Off-by-one situation and all that.
2020-02-11 19:52:04 +01:00
Nicolas F 6251a6c730 Merge PR #1716 by Auron956 2020-02-11 07:38:43 +01:00
Nicolas FandGitHub 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
Nicolas F 7097f76476 Merge PR #1720 by DragonDev1906 2020-02-11 07:02:51 +01:00
Nicolas FandGitHub 021e88dd4a Merge pull request #1699 from sjamesr/py3.4-compat
Fix construct requiring >=Python3.5
2020-02-11 06:52:51 +01:00
Nicolas F 1c5c77bcbc Merge #1705 2020-02-11 06:46:02 +01:00
Nicolas F 751ba39bd0 docs/running: fix leftover mention of 1.14
Oopsie.
2019-12-28 13:44:17 +01:00
Nicolas F 9800c58c14 genpoi: add -p/--processes option for parity
People could always set this through the config file, but somehow
not the command line. This commit fixes this oddity by adding the
option to the genPOI script's argument parser.
2019-12-27 15:32:10 +01:00
Nicolas F bdca0b9250 textures: clean up chest code
- drop 1.14 compatibility
- code style fixes
2019-12-27 14:42:55 +01:00
Nicolas F 19b5f70fda Merge chest fix of Gyzie into 115 2019-12-27 14:25:38 +01:00
Nicolas F 7538eb42c3 1.15 release preparations
- Update texture error string
- Update docs
- Add missing newline at the end of textures.py
2019-12-27 14:23:01 +01:00
Nicolas F a9fa06f019 nbt: small optimisation to list reading
Don't use .append(), we already know the final length. Instead,
have python initialise the list of a certain size and set the elements
in it.

Makes the function like 4% faster.
2019-12-26 17:28:51 +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 ed46082e16 biome: actually use the full range of biome data
Oopsie.
2019-12-23 18:36:24 +01:00
Nicolas F e7c9a2c49e biome: fix biome reading code
Fixes #1696.
2019-12-23 18:31:30 +01:00
Nicolas F 64edf65aa5 biome: fix biomes for chunks at Y=16
Okay so you know how you have chunks and they map to 4 levels of biomes?
Logically you'd go hmmmm, let's just map 4 Y levels to one biome level.
Except there aren't 16 chunk heights, there are about 17 if you count
Y=16 (which can contain data), but there's also -1 technically but I've
never seen this have data in an NBT structure I don't think.

Anyway, let's just hope we're doing the right thing by giving Y=16 the
same biome as Y=15. If someone wants to check whether that is actually
correct please feel free to, but for now it's better than crashing at
the very least.

Would be nice if we had a spec for these kinds of things.

Fixes #1685.
2019-12-11 19:15:56 +01:00
Nicolas F 37ad13dba7 biome: for Y -1, return the first biome
Apparently rotated worlds would try to access the biome for Y-level
-1. I don't know why they do that (probably some dumb reason that may
be a bug in of itself) but returning the first level should be harmless.

Fixes #1683.
2019-12-11 18:43:16 +01:00
Nicolas F 76bbabb7de fix various logging.warn calls
Those are deprecated in favour of logging.warning now.
2019-12-11 18:42:35 +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
Nicolas FandGitHub 9607636d49 Merge pull request #1682 from Dravere/fixing-incorrect-blocks-rendering-1578
Fixed incorrect rendering of blocks (issue #1578)
2019-12-07 21:21:55 +01:00
Nicolas FandGitHub 6dccdaa2a0 Merge pull request #1668 from IncredibleHolg/addblocks-nov19-01
Adds composter and bamboo
2019-12-05 15:32:25 +01:00
Nicolas F 3d31347e9b observer: create outputdir if it doesn't exist
Observers get initialised at config parse time, before Overviewer
creates the outputdir. So we can just tell them to create the
outputdir if it doesn't already exist to avoid an awkward error
on the initial render.

Fixes #1657.
2019-10-27 20:19:07 +01:00
Nicolas FandGitHub a688c7b7c9 Merge pull request #1645 from dreamwraith/patch-1
Update Docs for Texture Install
2019-10-27 11:59:38 +01:00
Nicolas FandGitHub dce1c216ec Merge pull request #1664 from IncredibleHolg/addblocks-dec19
Addblocks dec19
2019-10-27 11:55:59 +01:00
Nicolas FandGitHub 240a02a2dc Merge pull request #1663 from Esvandiary/fix/go-to-hash-layers
Web: Fix multiple layers being added on page load if a non-default layer is in the hash
2019-10-26 21:56:40 +02:00
Nicolas FandGitHub d07c2e708b Merge pull request #1634 from Gyzie/saplings_rework
Created seperate sapling blocks and added bamboo_sapling
2019-10-26 21:52:59 +02:00
Nicolas F 79a5668bd2 genPOI: handle more uuidcache.dat corruption
Apparently the gzip stream can be malformed in a way where it
does read it, but then throws an EOFError when it abruptly ends.

Catch this so we don't error out.
2019-10-26 02:41:56 +02:00
Nicolas F 71d59be4b9 tileset: fix changelist option for Python 3
Turns out os.write only accepts bytes!
2019-09-11 21:00:34 +02:00
Nicolas F 4f619cbaef world: also allow chunks of status "spawn"
Apparently this is a status sometimes seen with worlds converted from
1.12 to 1.14. From the sample I have, it looks like they're properly
populated with light and terrain data, so hopefully this doesn't break
anything.

Possibly fixes #1630.
2019-08-26 19:37:12 +02:00
Nicolas F 3498641d4e Merge rebased sign changes from Gyzie's 1-14-signs (#1627) 2019-08-19 12:36:57 +02:00
Nicolas F 577c86afab Merge branch 'implement-new-stairs' of IncredibleHolg (#1624) 2019-08-19 12:07:28 +02:00
Nicolas FandGitHub 040085a2a8 Merge pull request #1629 from Horcrux/patch-1
Documentation typo fix
2019-08-17 13:08:15 +02:00
Nicolas F 56a0d5bef2 contrib: add empty __init__.py
Maybe Debian needs this? Who knows!
2019-08-08 21:34:52 +02:00
Nicolas F bdd3b7bc16 test: import relative to __init__.py
Might fix tests for Debian builders somehow maybe?
2019-08-08 21:31:41 +02:00
Nicolas F 3b96158fb4 Implement smooth sandstone stairs 2019-08-06 14:26:03 +02:00
Nicolas F b28073c3a7 Increase overviewer C extension version to 71 2019-08-02 17:12:04 +02:00
Nicolas F 467dc728b8 Merge branch 'add-lantern' of IncredibleHolg/Minecraft-Overviewer (#1617) 2019-08-02 17:03:40 +02:00
Nicolas F d2bef52a76 travis: use xenial after all because python 3.5
The bionic image offers no Python 3.5. Since we still want to test
for that, we should stick with Xenial, I guess.
2019-07-29 16:55:28 +02:00
Nicolas F 15f18812d5 observer: use == 0, not is 0
Who thought that was a good idea?
2019-07-29 16:51:52 +02:00
Nicolas F 32e34af381 travis: use bionic and test for 3.8-dev 2019-07-29 16:35:00 +02:00
Nicolas F cf5dad5539 docs/building: clarify Linux build instructions
python3-imaging doesn't exist but python3-pil does, which
python3-pillow is aliased to. It also includes the necessary headers.

Add a note about pip missing the headers and warn of ABI mismatches if
people do weird things.
2019-07-29 16:27:15 +02:00
Nicolas F e2ee37393b world: fix rail orientations
Fixes #1616.
2019-07-29 11:36:23 +02:00
Nicolas F 1b85e478f5 test_world: disable broken test case
Blegh pre-anvil
2019-07-24 17:17:02 +02:00
Nicolas F 0d3d630104 Get rid of config global state, improve tests
While dicking around with the tests I noticed that you could make
them fail if you ran them twice. Many hours were spent investigating,
and it turns out that Overviewer's config stuff has global state that
gets modified by having parsed configurations actually modify the
default config values. Not good!

We can fix this by having settingsDefinition return a dict of the
defaults, instead of assigning it to module-level names.

We can also get rid of test_all.py, because what it would do with
pytest is run all tests *twice*. Instead, do the module path stuff
in __init__.py. Also, instead of throwing a non-specific Exception
if exmaple isn't checked out, just skip the test thank you very much.

This is the weirdest rabbit hole I've ever gone down and I haven't
slept in about 30 hours. I'm going to push this commit, and if it
breaks anything, I'll be blissfully asleep as the unwashed masses
begin to riot over exception this traceback that.
2019-07-24 17:02:39 +02:00
Nicolas F 0bb823599d assetmanager: code style fixes 2019-07-24 09:49:25 +02:00
Nicolas F cf74500efa dispatcher: code style fixes 2019-07-24 09:35:52 +02:00
Nicolas F da80e50022 observer: code style fixes 2019-07-24 09:23:36 +02:00
Nicolas F 01f30de176 remove vestigial python2 references 2019-07-24 09:20:49 +02:00
Nicolas F c13d3aae3c rename configParser to config_parser
CamelCase does not bode well in Python land, so it's best we rename
these ill-named files before the Guidoists get us and throw us into
a damp dungeon.
2019-07-24 09:18:02 +02:00
Nicolas F f314de1403 configParser: code style and string changes
It's now PEP8 compliant! Also we can remove an unused optparse
import (wtf?) and let logging.error do the string formatting lazily.
2019-07-24 05:35:40 +02:00
Nicolas F 7e2cb56c1b Implement some mossy blocks
This adds:
- mossy stone brick stairs
- mossy cobblestone stairs
- mossy stone brick walls

We also add another block class for walls, and while we're at it,
clean up the stairs texture function to not have a huge sprawling
elif mess for loading textures, but instead to a cheeky dictionary
lookup.

In case you're wondering, yes I am just as disgusted by this code as
you are.
2019-07-15 17:23:25 +02:00
Nicolas F 634e13c92c Merge branch 'workstations' of https://github.com/IncredibleHolg/Minecraft-Overviewer 2019-07-13 17:37:58 +02:00
Nicolas F a422270666 Add force_writable argument to mirror_dir
Fixes #1611.
2019-07-12 23:37:35 +02:00
Nicolas F 70c64cd4c5 overviewer_core/__init__: code style fixes 2019-07-12 17:55:30 +02:00
Nicolas F f6937fe6a3 signals: whitespace fixes 2019-07-12 17:48:32 +02:00
Nicolas F 07cb05f4d8 observer: don't divide by zero in RConObserver
If no tiles needed to be updated, RConObserver would divide by zero,
which is less than ideal.

Fixes #1422.
2019-07-12 17:37:58 +02:00
Nicolas F a9aabab790 util.js: actually run the ready queue
Fixes #1466 I hope.
2019-07-12 17:25:29 +02:00
Nicolas F 106d332136 Catch KeyboardInterrupt so we don't barf a trace
Concerns issue #1531.

Future work can actually try to save state in this case, but especially
with multiprocessing, that might become a bit hairy.
2019-07-12 17:15:51 +02:00
Nicolas F 402d35fefc util.js: remove some obsolete stuff
A few debug console.log statements got the axe too, because I
felt like it.
2019-07-12 16:55:47 +02:00
Nicolas F 4d27cf3dfc util.js: don't specify a map minzoom of 0
Who put this here? Why? Whatever.

Fixes #1590.
2019-07-12 16:43:05 +02:00
Nicolas F 4dc2c8a5b7 world: add __lt__ to RegionSetWrapper for genPOI
genPOI needs this for groupby, and since we can now throw cropped
regionsets into genPOI we definitely need this too.

Probably also fixes rotated regionsets with multiple genPOI filters.
2019-07-12 16:32:07 +02:00
Nicolas F 033d75b08e genPOI: respect crop option
Use CroppedRegionSets to generate markers, which should only affect
handleEntities. I have not yet checked whether this generates
dupicate players and manualpois for maps with multiple crop zones,
but that's a fire to put out for another day.

Fixes #1574.
2019-07-12 16:04:28 +02:00
Nicolas F aeeaadd5bb Bump C extension version to 68 2019-07-12 15:27:42 +02:00
Nicolas F 221b2c6805 Bump C extension version to 67 2019-07-10 18:37:38 +02:00
Nicolas F 4f3c7368ba Merge branch 'posix-types' of Wunkolo (#1598) 2019-07-10 18:36:32 +02:00
Nicolas F 6bdcd32a6f world: remove redundant stride 1 in iteration
IRC chairfarters are pedantic.
2019-07-09 18:11:29 +02:00
Nicolas F 8bbe034aad world: use numpy.empty instead of numpy.zeros
Some arrays get completely filled anyway, so we might as well not
use numpy.zeros, and instead choose numpy.empty.
2019-07-09 18:05:15 +02:00
Nicolas F a5071663cd world: optimise bad block translation code
Makes Overviewer like 45% faster lol
2019-07-09 17:59:40 +02:00
Nicolas F e0e33a9acb textures: fix texturepath option not being used
If the first texture loaded was not in the pack, i.e. we fell back
on system textures, then the pack was ignored altogether for the
remainder of the render.

Here we fix this by using an OrderedDict instead of the split jars
and jarpath nonsense, and then always checking the custom textures
first and opening them if they are not already open, and putting
the jar file handle at the start of the OrderedDict.

We also switch around some logic to avoid unnecessary isdir calls
when we're using a resource pack.
2019-07-09 14:20:31 +02:00
Nicolas F 19042a7669 rcon: fix for python 3
We need to encode the payload since rcon is a binary protocol.

Also, add some more error checking.

Fixes #1605.
2019-07-09 13:44:43 +02:00
Nicolas F d92e61e559 nbt: catch EOFError because of gzip streams
Might fix world listing for some corrupt worlds.

Fixes #1606.
2019-07-08 23:01:34 +02:00
Nicolas F a6bcc0f957 textures: implement proper fallback loading
Sometimes a texture pack is not complete, but system textures are
available to make up the difference. In that case, we should load
those.

Current caveat is that we might not notice texture names changing
with newer minecraft clients because we have old ones installed.

I'll have to think some more about that one.
2019-07-06 23:36:47 +02:00
Nicolas F 6b0ccc1513 src/primitives/base: don't try to free nullpointer
If loading the grass and foliage biome colour fails, Overviewer doesn't
necessarily crash, it just renders everything gray, apart from one small
issue: in trying to call base_finish, it'd crash trying to decrease the
reference of a null pointer.
2019-07-06 23:15:55 +02:00
Nicolas F 0b4ad361c3 world: fix those pesky poi warnings 2019-07-06 21:24:58 +02:00
Nicolas F 204bcd0310 Add "center" config option
This option allows you to specify your own initial center for a
tileset, which is useful if your map is extremely asymmetric or
you don't really care about what's around the spawn.

Future work needs to be done on the JS side in order to fix the
fromWorldToLatLng and friends, as they're currently off by -24 in X
and +24 in Z direction.

Closes #1350.
2019-07-06 19:06:15 +02:00
Nicolas F 5b0430f94b textures: greatly simplify find_file and friends
find_file contained a lot of code for searching textures in ways that
haven't been relevant for years. For example, it had workarounds for
MCPatcher, a tool that hasn't been updated since 2015.

Instead of searching in multiple paths that will never succeed in a
resource pack and Minecraft version that actually work, just look
for the filename that the block functions ask for.

Also, if we already have a manually specified resource pack open,
we shouldn't repeatedly re-open it. Furthermore, it's best if
the very first thing find_file does is try to find the file in
the resource pack or client jar we've already opened previously.

We can now also remove chest.png, ender.png, foliage.png, grass.png
and normal_double.png because Minecraft ships them, so we don't
need to ship them ourselves too. Us shipping them actually hid the
whole find_file garbagefire.

Concerns issue #1604.
2019-07-04 18:24:57 +02:00
Nicolas F 864be71667 textures: cache when a texture couldn't be found
Previously, textures that couldn't be found the first time around
would not have this fact cached, so we'd run through the whole
slow path of find_file with each blockid and data entry.

This is what caused the chests texture generation function to take
almost 12 seconds on my system, as it is looking for "normal.png"
that hasn't existed in Minecraft textures for ages.

Shoving the exception, if one is encountered, into the cache, and
then re-raising it if we load it from the texture cache brings this
number down to about 2 seconds. That's six times as fast!

Concerns issue #1604.
2019-07-04 16:40:11 +02:00
Nicolas F 1e8735328e textures: try more than the most recent Minecraft
We can try each jar in descending order of versions until we actually
find one that works. This fixes #1328.

Future work might move the "if self.jar is not None" higher up in the
function so that we don't keep re-checking the overviewer dir and texture
path for files that we will then not use at all for some reason.
2019-07-04 15:27:58 +02:00
Nicolas F 7d1a04b0fe genPOI: hopefully fix binary string nonsense
Somebody reported that genPOI was throwing an exception in two
different places related to trying to read bytes as a string.

I personally could not reproduce (possibly needs some special player
names or something?) but I think this change should fix it either way.
2019-06-28 13:24:48 +02:00
Nicolas F b6a3c18b65 web_assets: update leaflet to 1.5.1 2019-06-25 19:40:42 +02:00
Nicolas F c34be9ca67 world: add __lt__ method to RegionSet
So turns out genPOI wants to use sorted() so it can use itertools.groupby.

Python 2 somehow just... sorted objects so that groupby (which is basically
the UNIX uniq) could group them properly. Python 3 no longer does this,
so as comparison method let's just compare regiondir strings since that
gives us the desired result.

Fixes #1597.
2019-06-25 19:19:28 +02:00
Nicolas F f58d7ae0a2 Merge Pull Request #1542 2019-06-25 18:21:27 +02:00
Nicolas F b20705e46a observer: use bytes fp for JSObserver
Unbuffered I/O requires a bytes fp, so I guess we now just send
utf-8 encoded strings into that instead.

Fixes #1596.
2019-06-25 18:17:45 +02:00
Nicolas F 50bd2a4303 observer: use bytes fp for JSObserver
Unbuffered I/O requires a bytes fp, so I guess we now just send
utf-8 encoded strings into that instead.

Fixes #1596.
2019-06-25 18:13:57 +02:00
Nicolas F e28c2e9284 docs/installing: remove CentOS 6 section
Hopelessly outdated distro release that not even EPEL can save, so
there's no way we can support it with prebuilt packages.
2019-05-20 15:35:49 +02:00