Commit Graph
100 Commits
Author SHA1 Message Date
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 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
Nicolas F 1ab66dddea fix prismarine stairs
Sorry for the noise in mc_id.h, but somebody decided they want DOS
line endings and I couldn't allow that to happen. When not doing that
put the whole thing into diff, I decided to just fix the indentation
too while I was at it.

Needed bugfixing of some overlooked unsigned char usages for block IDs,
as otherwise the lighting would be scuffed.

Concerns issue #1486.
2019-03-31 19:20:10 +02:00
Nicolas F be69712ca0 docs/signs.rst: fix filter function ids for 1.13 2019-03-29 17:05:31 +01:00
Nicolas F f93bc28230 world: fix stair orientations
Concerns issue #1486.

Inner/outer corners apparently have their data from ancil data instead
of Minecraft's stuff, so we might need to fix that in the future.
2019-03-28 16:02:53 +01:00
Nicolas F 79754b367c world: bandaid fix for double stone brick slabs
This code badly needs a rewrite, we're just altering code path and
data all over the place and this isn't okay.
2019-03-25 21:42:08 +01:00
Nicolas FandGitHub ed9a9930db Merge pull request #1547 from InrcedibleHolg/master
added missing cut_red_sandstone and chiseled_red_sandstone
2019-03-24 22:20:19 +01:00
Nicolas F fb63788dc7 mailmap: more adding of myself, sheesh 2019-03-22 19:22:46 +01:00
Nicolas F 477bd701a3 mailmap: add myself 2019-03-22 19:16:34 +01:00
Nicolas FandGitHub 2c4b0d40b5 Merge pull request #1541 from Wunkolo/block_class
Add block_class to accelerate block-conditionals
2019-03-19 00:52:36 +01:00
Nicolas FandGitHub 00b4e83822 Merge pull request #1539 from Wunkolo/mc_id
Convert block ids into mc_block_id enum
2019-03-17 21:10:38 +01:00
Nicolas F 99eebd5b69 world: fix potatoes and carrots growth stages
Concerns #1486

Also get rid of an obviously broken leftover wheat elif.
2019-03-16 17:47:49 +01:00
Nicolas F f7ab92917f world: fix seed growth stages
Concerns #1486
2019-03-16 17:40:05 +01:00
Nicolas F 061406ca55 world: fix mossy cobblestone block/wall rendering
Concerns #1486

I need some high-proof alcohol.
2019-03-16 17:07:35 +01:00
Nicolas F dd6e69189f world: fix petrified_oak_slab rendering
Concerns #1486
2019-03-16 16:50:15 +01:00
Nicolas F 6aaf680c8c settingsValidators: fix code style, adjust strings
Some absolute thonkers in here like two-spaces indent code. Yikes
my man.
2019-03-15 16:48:08 +01:00
Nicolas F d6ed0bd416 overviewer: use print_function
PYTHON 3 SOON POGGERS
2019-03-14 16:03:35 +01:00
Nicolas FandGitHub daa25d80fd Merge pull request #1533 from CounterPillow/png-it-modernisation
Modernise png-it.py and make it less weird
2019-03-13 17:09:27 +01:00
Nicolas FandGitHub d742c15a1c Merge pull request #1534 from NPCtom/patch-2
Replace OSX with macOS
2019-03-12 05:58:15 +01:00
Nicolas F 2c1ce0d522 contrib/png-it: allow saving to stdout with -
Following the same convention as some other tools, - as output
filename means stdout now.
2019-03-12 00:41:57 +01:00
Nicolas F e6d4ed8068 contrib/png-it: use the print function
This also allows us to print to stderr, which is handy and means
all program text output (i.e. argument parser and script messages)
will be on stderr.
2019-03-12 00:33:02 +01:00
Nicolas F eee196623f contrib/png-it: switch from optparse to argparse
In the process, we can clean up some of the command line argument
handling. Sadly, argparse's mutually exclusive groups are too
primitive to get rid of the autocrop/manual crop conflict checking,
but we'll have to live with those two lines I guess.

This script apparently also works with Python 3 now, which is neat.
2019-03-12 00:26:51 +01:00
Nicolas F 88c056b6b7 contrib/png-it: clean up code, grammar
This took several years off my life expectancy, and there's still
ways to go.
2019-03-12 00:26:45 +01:00
Nicolas FandGitHub 4e08859f0e Merge pull request #1532 from jsmienk/patch-2
Simplify finding spawn Y
2019-03-11 19:16:03 +01:00
Nicolas F 57a55b68e1 contribManager: get rid of removed scripts 2019-03-11 18:05:20 +01:00
Nicolas F 9f50e0fb2f contrib: delete scripts that are no longer useful
dtt-c has been a thing for 8 years now, I think it's safe to say
people have deleted their old caches in the meantime.

findSigns has also been superseded by genPOI ever since genPOI
has been a thing, which has probably been since anvil.
2019-03-10 18:09:09 +01:00
Nicolas F c9b506a58c genPOI: fix code style
One code style error can't really be fixed because despite
has_key being deprecated, "in" doesn't work on "super" for objects
that derive from dict, at least not in Python 2.7. Thanks Guido.

Also, I don't know which one of you it is that keeps putting semicolons
at the end of your statements but you seriously need to stop.
2019-03-10 18:05:32 +01:00
Nicolas FandGitHub 6f5730d40a Merge pull request #1529 from CounterPillow/arrrgparse
overviewer: replace optparse with argparse
2019-03-10 17:39:54 +01:00
Nicolas F 3a923c2932 overviewer: warn about shell quoting issues
This reimplements the warning about missing quotes on the command
line that was removed with the previous commit.
2019-03-09 18:47:49 +01:00
Nicolas F 25f0907d05 overviewer: replace optparse with argparse
optparse is deprecated, and switching to argparse is mostly but not
entirely trivial. Nicely telling the user about shell quoting had
to be removed because I didn't see an easy way to do that with
argparse.
2019-03-08 16:48:31 +01:00
Nicolas F 849e5d690e overviewer: fix git hash being after line break
Apparently that comma had its reasons for being there because
Python2's print works in weird ways. We can do this better though
by using string concatenation.
2019-03-07 16:04:56 +01:00
Nicolas F e4924c3d73 overviewer: misc style fixes
except as instead of comma, get rid of strange superfluous comma
after print.
2019-03-07 16:02:14 +01:00
Nicolas F a551795969 optimizeimages: fix code style 2019-03-07 15:50:59 +01:00
Nicolas F ec63aa55b6 util: fix code style 2019-03-07 15:49:37 +01:00
Nicolas F fc88572aa3 cache: fix code style 2019-03-07 15:43:01 +01:00
Nicolas F 94aa49019c logger: code style fixes 2019-03-07 15:33:28 +01:00
Nicolas F ef66efd140 overviewer: code style and consistency fixes
A good sprinkling of PEP8 fixes. We're also getting rid of some
odd manual linebreaks in the output messages, and making sure to
end sentences with a period where appropriate. Help messages have
also been made more consistent, e.g. "Tries" -> "Try" and so forth.
2019-03-06 14:27:04 +01:00
Nicolas FandGitHub 4ffa0be456 Merge pull request #1526 from CounterPillow/webp-support
Add WebP image format support
2019-03-06 13:54:21 +01:00
Nicolas F 61ebd35240 Add WebP image format support
Since Firefox 65 added support for WebP, users may be interested
in having maps that use WebP images. Support for this is added in
this commit, along with documentation for it.

A new option, "imglossless", controls whether we write out lossless
or lossy WebP images. The generic name "imglossless" as opposed to
a more specific "webplossless" was chosen in case future image
formats we also implement also support lossless/lossy modes in the
same format (JPEG-XL? AV1 image format?).

It's an okay meme but lossy mode really falls apart on our sorts
of images on the more zoomed out composite tiles, resulting in
pretty blurry messes. Might be due to a PSNR bias in the encoder,
which is to be expected from Google.
2019-03-04 17:04:09 +01:00
Nicolas F 7f63dfe315 tileset: drastic code style fixes
We've also added a setup.cfg to specify what rules we want for
pycodestyle. We'll be ignoring some dumb ones that make no sense
and probably shouldn't exist, like both W503 and W504 being an
issue somehow???????

We're using a line length limit of 100. If you're on an 80 character
terminal and incredibly upset about this, then that's the nursing
home staff's problem, not ours.
2019-03-03 16:47:35 +01:00
Nicolas F 0499f8d168 docs: update copyright year, version, release
Bump version and release to 0.13, update the copyright date from
2017 (!!!) to 2019.
2019-03-02 16:35:23 +01:00
Nicolas F 846b7ab8f8 nbt: code style fixes
We're ignoring E221 and E741 since I disagree with them; I think extra
whitespace around operators to align repeated operations can aid
readability and help spot bugs.

This was mostly whitespace issues, e.g. trailing whitespace and
a single space on blank lines.
2019-03-02 15:47:13 +01:00
Nicolas F 336850ea04 observer: drastic code style fixes
I've used pycodestyle to find pep8 violations, and isort to fix import
sorting.

Currently we're looking at a max line length of 80, but I think we may
want to raise this to 100 because 80 is a pain in the butt.
2019-03-02 15:32:25 +01:00
Nicolas F 715b3a2d43 progressbar: actually flush the fd on update
A young software tinkerer from Switzerland noticed an issue with
an application he was working on one day. The progress bar it
was rendering only updated very rarely. This perplexed the teenager,
but never bugged him enough to investigate further. Nobody else seemed
to notice this, so maybe it was his system?

Fast forward a few years. The young man is now a 24 year old fully
grown manchild. The progress bar was still updating only very rarely.
On this rainy afternoon, the tinkerer had nothing else to do than
finally get to the bottom of this perplexing behaviour.

Much investigating was done. Did the Observer have a logic bug? No,
if we check in the update function by appending a line to a file,
we can see that it works properly. Besides, the logic of this piece
of code surely hasn't been changed for years.

Did maxvalue get set to 100 instead of the number of tiles? No, it
correctly overrode the right method to not just set max_value but
also maxvalue. (Great naming there, aheadley.)

Was it the polymorphic inheritance causing issues then? No, even the
parent class correctly behaved in its update function. Well, almost.
That is when the developer came upon a shocking revelation. His hands
trempled as his fingers moved across the laptop's keyboard, nearly
accidentally entering the "nuclear missile launch" mode in Kate's
Vi-Input editing. The developer added one line to the file.

self.fd.flush()

The progress bar finally worked as intended.
2019-03-01 14:36:28 +01:00
Nicolas FandGitHub 45fa7552c0 Merge pull request #1524 from CounterPillow/overlay-fix
web: fix overlays showing up for all base layers
2019-02-28 13:39:31 +01:00
Nicolas F 311d3eacc2 web: add layer fallback to goToHash
With the changes to things being indexed by path instead of name,
old hashes would stop working. To make this a bit less jarring, we
can fall back to the default tileset of a world, which means the
map would still load.
2019-02-28 13:37:19 +01:00
Nicolas F b57db703ae web: fix overlays showing up for all base layers
Overlays should only show up for the base layers they apply to,
however, we've had them show up for all base layers in a world.

To fix this, we first change things to be indexed by the unique path,
not the human-readable name (which is not supposed to be always unique).

Then, we remove and add overlay layers to the layerCtrl as needed on a
baselayerchange event.
2019-02-27 14:22:18 +01:00
Nicolas F b70f1a012f Fix C extension build warnings the painful way
Some bad distributions (Debian) apparently are not good enough to
have a Pillow version from this decade packaged.

Therefore, we need to do it the painful way of prefixing our
symbols and refactoring everything to use them.

A new header file called "utils.h" has been added for this purpose,
and it is included in "overviewer.h".

The following macros have been prefixed with "OV_":
- MIN
- MAX
- CLAMP
- BLEND
- MULDIV255

Additionally, the C extension version was bumped to 56 because 55
was reverted back to 54.
2019-02-22 12:53:47 +01:00
Nicolas F bc71ad7a8f web: fix white rectangle behind markers 2019-02-21 18:25:50 +01:00
Nicolas F 23f8cbd330 web: reimplement marker groups default checking
Now you can use checked=True again!

Fixes #1474.
2019-02-21 17:24:08 +01:00
Nicolas F 094b403515 docs: actually fix chestFilter example
oops
2019-02-21 16:36:48 +01:00
Nicolas F b0921972ba docs: fix chestFilter example
Fixes #1509
2019-02-21 16:34:28 +01:00
Nicolas F 03a8697866 Fix C extension build warnings
Today in "why did we ever do this?", we discover we've vendored
code from PIL/Pillow, but PIL/Pillow moved some macro definitions
around, so now our vendored code conflicted with their macros that
they included in the headers we're including.

The solution is to throw out our vendored macros and update the
semantics in our vendored Draw.c. I'm not sure why we vendored it,
but we seemingly did remove some stuff from it to avoid having to
pull in all of PIL/Pillow.
2019-02-21 16:27:55 +01:00
Nicolas FandGitHub a05daa7519 Merge pull request #1510 from 14mRh4X0r/fix-icon-offset
Fix marker icon position properly. Closes #1481.
2019-02-21 15:59:14 +01:00
Nicolas FandGitHub 71f80eba69 Merge pull request #1507 from mtoensing/minecraft113
fixed dead navigation on iOS on iPhone and iPad.
2019-01-12 02:49:25 +01:00
Nicolas F e1728b9e59 genpoi: Also fix missing nbt keys if processes > 1
oopsie
2018-11-26 14:40:52 +01:00
Nicolas F 38bc400b2f genPOI: catch ChunkDoesntExist when processes > 1
Fixes #1480.

No clue how this wasn't an issue before but is an issue now in 1.13,
maybe Minecraft writes more placeholder chunks these days.
2018-11-26 13:03:44 +01:00
Nicolas F cf53208989 genpoi: fix uncaught KeyErrors on some MC data
Apparently TileEntities can just not even exist now, and the same
goes for the player Dimension key. For the latter, I'm not sure
whether the fallback is correct, but it's a guess I suppose.

Hopefully addresses #1480.
2018-11-18 09:29:48 +01:00
Nicolas F bde265a8ac web: fix createInfoWindow not having any effect
Fixes #1494.
2018-11-18 09:18:55 +01:00
Nicolas F 2918637539 web: fix marker icon position
Shoutouts to 14mRh4X0r for finding the right CSS properties that
work for centering the marker icons.

Fixes #1481.
2018-11-18 09:10:54 +01:00
Nicolas F 39d9dba814 Merge branch 'whitespaces' of https://github.com/r15ch13/Minecraft-Overviewer into r15ch13-fixes 2018-06-14 13:54:34 +02:00
Nicolas FandGitHub cd9a0d6c68 Merge pull request #1459 from r15ch13/noscript
Use <noscript> to display message when JavaScript is disabled
2018-06-13 19:18:25 +02:00
Nicolas F a129274aa1 Remove broken marker centreing code
Apparently, having an image's origin be in the center is too
advanced of a concept for The Web™. I guess we can't do this then.
2018-05-09 16:22:21 +02:00
Nicolas F 6fbced79bf Fix custom icons not showing up properly
Individual POIs such as player POIs can have their own icon per
POI, so we should respect that.
2018-05-09 15:45:31 +02:00
Nicolas F cf5a14a088 Increase the Overviewer C extension version 2018-05-09 14:36:11 +02:00
Nicolas F ebdc4016d7 world: Don't call sys.exit here, raise something
A world being unsupported may not be a fatal application error in
all instances where this codepath in world.py is used, hence
throwing an exception is more sensible.
2018-05-09 14:25:05 +02:00
Nicolas F 12c12d128f Set the attribution prefix 2018-05-06 17:44:07 +02:00
Nicolas F 05cc9e60e7 Don't collapse marker group control 2018-05-06 17:12:03 +02:00
Nicolas F 23ea1918ea Update leaflet to 1.3.1 2018-05-06 17:11:46 +02:00
Nicolas F ea33ebe2fb Assume 32x32 marker size so they get centred
Maybe expose this as an option to the markers dict later, with
the anchor as an option too.
2018-05-06 16:59:27 +02:00
Nicolas F 614663f601 Show marker group display names 2018-05-06 16:53:32 +02:00
Nicolas FandGitHub cff0dcc187 Merge pull request #1431 from kevinwchang/travis-fix
Update Travis config
2018-02-23 04:47:26 +01:00
Nicolas FandGitHub e847adaa20 Merge pull request #1430 from kevinwchang/no-rgba-jpeg
Convert RGBA to RGB before saving as JPEG
2018-02-23 01:49:49 +01:00
Nicolas F 39d588ae45 docs: various small updates to build instructions
* python26 to python27
* PIL to Pillow
* Requirement on having python2, numpy and pillow for the MSVC build
* Mention -dev package for Pillow/PIL
2017-06-19 22:55:55 +02:00
Nicolas F 21b9e0aa13 docs: Clarify Ubuntu/Debian install instructions
We use HTTPS these days and mentioning python2.6 in 2017 is very
triggering to me.
2017-06-13 16:11:10 +02:00
Nicolas FandGitHub 6043ae958e Merge pull request #1386 from Monkey0x9/patch-1
Change forgotten 1.11 to 1.12
2017-06-11 16:56:53 +02:00
Nicolas F f7973410ea travis: Update MC version 2017-06-09 18:12:05 +02:00
Nicolas F 4b75f7fa63 Merge branch 'snapshot' 2017-06-09 18:08:38 +02:00
Nicolas F 711488e07d textures.py: Fix beds for 1.12
Bed textures are now one unified texture, so some cropping and
fiddling needs to be done.

Bed colours not yet implemented.
2017-06-09 18:06:29 +02:00
Nicolas F 461f8647e0 Update strings to 1.12 2017-06-09 16:28:49 +02:00
Nicolas F 412c8231b7 docs: add a section about how to contribute
This adds a work-in-progress section with a few tips and tricks
about how one should go about contributing to the project. It mostly
focuses on making people familiar with some of the code, and giving
them a few tips along the way on how to work with Git.

A few more contribution examples should be added, and what most
notably is lacking right now is a section about the web output
part. This is due to us currently rewriting it in Leaflet, so any
examples added now would quickly become outdated.
2017-04-18 15:30:51 +02:00
Nicolas F a183553ba5 setup.py: remove workaround for CentOS 5
More like ScentOS because it stinks LOLOLOLOLO
2017-04-10 12:22:05 +02:00
Nicolas F e07e588e59 readme: add API key note, small fixes
We previously stated that a Google Maps API key is not required.
However, this is not true (anymore). I'm still wary of adding
it to the documentation since my hopes is that in the time it would
take me to add this to the docs I could just finish leaflet, but this
is the least we can do to clear up any confusion.

Also switched some URLs to use HTTPS, which closes #1314.

Lastly, fixed a warning about a not long enough title line.
2017-04-10 12:18:14 +02:00
Nicolas F dd96d95b66 settingsValidators: clean up checkBadEscapes
A side-effect of these changes is that \a no longer gets shown as
'\a', but '\0x07'. Some characters, i.e. \n and \t, are still shown
as '\n' and '\t' respectively, so this comes simply down to repr()
behaviour.

However, I do believe it's worth it to get rid of that ugly code
duplication.
2017-03-24 18:29:15 +01:00
Nicolas F 8cf47935e4 Remove unused imports 2017-03-24 17:57:37 +01:00
Nicolas F b7837a9656 docs: update copyright year to 2017 2017-03-24 15:29:22 +01:00
Nicolas F 52afa7f8d2 docs: optimise PNGs
I used zopflipng with 100 iterations on most of them, and advpng
with 300 iterations in zopfli mode on front_page_screenshot.png
2017-03-24 15:26:32 +01:00
Nicolas F 57a1000f4c docs: fix two warnings during docs building
sphinx does not enjoy duplicate link names, and unless your label
is pointing to a header, it needs an explicit name when referenced
too.
2017-03-24 14:53:07 +01:00
Nicolas F 032b8831f9 docs: fix code block in signs.rst 2017-03-24 14:42:16 +01:00
Nicolas F ba5a4bbaed docs: add link to Twitter account to index.rst 2017-03-24 14:40:54 +01:00
Nicolas F f9148b7e2e docs: Change some http:// URLs to https:// 2017-03-24 14:35:05 +01:00
Nicolas F d11c9b5aa2 docs: remove remaining references to CentOS 5 2017-03-24 14:30:22 +01:00
Nicolas F b393489ea9 docs: remove CentOS 5 build instructions
It's EOL in a few days and the instructions only add confusion.
Anyone still using CentOS 5 has bigger issues than not having
documentation on how to build Minecraft-Overviewer.
2017-03-17 17:09:35 +01:00
Nicolas FandGitHub 99b223fb5a Merge pull request #1356 from overviewer/python2
Replace `python` with `python2`
2017-03-17 16:54:25 +01:00