0
Commit Graph

2704 Commits

Author SHA1 Message Date
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
Thomas Lake
1d7204ccb6 Update observer import examples for Py3
Based solely on the blog post, not had a chance to double check the usage myself.
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
Thomas Lake
4b847808eb Update observer import examples for Py3
Based solely on the blog post, not had a chance to double check the usage myself.
2019-06-25 09:15:44 +01:00
Wunkolo
8162f3f877 Add .clang_format
Also applies clang-format to the current code base, using command:
`find . -regex '.*\.\(c\|h\)' -exec clang-format -style=file -i {} \;`
2019-06-23 18:43:32 -07:00
Aaron Griffith
676bf32af9 another version bump, to test out new builder 2019-06-23 14:35:37 -04:00
Aaron Griffith
ec13bc03cf bump extension version 2019-06-23 13:54:26 -04:00
Andrew Chin
5e19ad0c6d Fixes for WindowsOutputStream 2019-06-23 12:47:05 -04:00
Andrew Chin
c78b17f6a7 Fix for reading worlds from local dir 2019-06-21 23:35:33 -04:00
Aaron Griffith
9a52a02f13 Bumped extension version. 2019-06-21 22:10:01 -04:00
Aaron Griffith
248ea42dd2 Merge branch 'master' into python3-fun-times 2019-06-21 22:08:58 -04:00
Aaron Griffith
19963129c5 updated gitignore to ignore new python3 products 2019-06-21 21:32:51 -04: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
Nicolas F
522ee28219 overviewer: add warning for CentOS/RHEL 6
If you're using CentOS/RHEL 6, you probably already can't run
Overviewer due to our dependency on argparse breaking python2.6
compatibility. However, if you somehow managed to get python2.7
working on CentOS 6, you now get a nice warning telling you to
finally get off your butt and use something else.

This warning can be dropped once we move to Python 3, which is why
this code was added in the first place: CentOS 6 has no Python 3
package that is still supported by upstream, not even in EPEL.
2019-05-20 15:21:07 +02:00
mircokroon
2dc8ebd4d9 Ensure coordinates are properly converted when changing views (#1571)
* Ensure coordinates are properly converted when changing views
2019-05-19 11:54:01 +02:00
Nicolas F
f1c7ab93f1 world: remove lit chunk check
Apparently not even chunks of that data version can be relied upon
to have that flag mean anything at all, as the --forceUpgrade and
--eraseCache switches result in a world where chunks are flagged
as not being lit but seemingly do have SkyLight and BlockLight keys.

Concerns #1570.
2019-05-05 15:17:43 +02:00
Nicolas F
9479ac59b4 world: make the chunk populated code even uglier
Fixes #1568.
Fixes #1566.
2019-05-03 15:13:18 +02:00
Nicolas F
c77fcc5fb3 world: fix snowy grass check
pro tip: 'false' == True.
2019-04-30 21:08:00 +02:00
Nicolas F
0d10211d1b world: fix rendering of 1.13 worlds
Fixes #1563.
2019-04-30 19:41:35 +02:00
Nicolas F
0004540a57 world: only render fully formed and lit chunks
Minecraft notes various stages of fetal development that chunks are
in, with the complete ones being "full". Previously, we'd check
against a list of states that are not full to skip a chunk, which
is obviously not future proof, and broke as Mojang updated their
possible range of values for the status field. It's better to
just bail if the status is anything other than "full".

Additionally, a key called "isLightOn" is in the chunk now. This
seemingly determines whether a chunk has been lit. We're also going
to check for this, and bail if it's not. In my tests, I have not yet
seen a single "full" chunk that does not have "isLightOn" set.

Fixes #1558.
2019-04-28 13:41:17 +02:00
Nicolas F
7b523c447a .gitignore: add the docs build dir to ignore 2019-04-28 12:58:13 +02:00
Nicolas F
3fc97d131e Add fletching, cartography and smithing tables 2019-04-28 12:55:14 +02:00
Nicolas F
1f7dc762aa Merge pull request #1561 from IncredibleHolg/new-slabs-1.14
added new 1.14 slabs, fixing issue #1560
2019-04-28 12:14:20 +02:00
InrcedibleHolg
702e4e9e8b added new 1.14 slabs, referencing issue #1560 2019-04-28 10:48:57 +02:00
Nicolas F
a20d09fd82 docs/running: update texture install instructions 2019-04-26 04:17:50 +02:00
Nicolas F
04302025ca travis: test with 1.14 assets 2019-04-26 04:11:49 +02:00
Nicolas F
e25557d257 textures: fix stone slabs for 1.14 2019-04-26 04:11:20 +02:00
Nicolas F
8760b040c6 world: ignore poi directory in world dir
This is a new directory added in 1.14 which contains .mca files too.

Since we scan for directories with .mca files to use as RegionSets,
and we don't know how to handle these, just skip them.

Fixes some warnings during rendering.
2019-04-23 14:03:25 +02:00
Nicolas F
bc322fa3e4 world: fix for chunk parsing for 1.14
If there's missing light data, just make up some with an empty array.
2019-04-23 14:03:25 +02:00
Nicolas F
6f680aa287 Revert "web: fix goToHash on layer change"
This reverts commit 2186d08c32.

Fixes #1553.
2019-04-21 18:02:19 +02:00
Nicolas F
7d5f3009e7 Merge pull request #1556 from SteadBytes/python3-popen-bytes
Decode Popen stdout bytes to utf-8
2019-04-20 16:45:46 +02:00
Ben Steadman
8bd731fde1 decode Popen stdout bytes to utf-8 2019-04-20 10:36:53 +01:00
Nicolas F
134d6063bf primitives: misc char -> short fixes 2019-04-07 20:25:53 +02:00
Nicolas F
6a1906445c world: space comments correctly 2019-04-07 20:23:32 +02:00
Nicolas F
bd40aeda3d textures: set prismarine slabs to transparent
This fixes upper slabs removing the block below them.
2019-04-07 20:21:45 +02:00
Nicolas F
e05a4f1083 Merge pull request #1550 from InrcedibleHolg/master
Rebased to clean the git history a little.
2019-04-07 20:19:56 +02:00
InrcedibleHolg
f1dd70bdec reorder code in world.py 2019-04-07 19:21:12 +02:00
InrcedibleHolg
abc4a858ff double slab fix 2019-04-07 19:21:12 +02:00
Nicolas F
f512492ed7 Merge pull request #1545 from SteadBytes/contrib-python3
Move Contrib Scripts to Python3
2019-04-07 14:27:59 +02:00