8428 Commits

Author SHA1 Message Date
Dylan K. Taylor
f23bba053b Merge branch 'release/3.3' 2018-10-04 16:41:11 +01:00
Dylan K. Taylor
c065cfbeda Merge branch 'release/3.2' into release/3.3 2018-10-04 16:41:03 +01:00
Dylan K. Taylor
722924a779 Merge branch 'release/3.1' into release/3.2 2018-10-04 16:40:55 +01:00
Dylan K. Taylor
60e1b29462 RegionLoader: Remove incorrect size cap
This assumes that the region is properly garbage-collected and packed, but if the file contains uncollected garbage this may not be the case, resulting in a region larger than a gigabyte.
2018-10-04 16:40:45 +01:00
Dylan K. Taylor
b0f1863c4f Region loaders don't need to know their own coordinates 2018-10-04 16:37:19 +01:00
Dylan K. Taylor
41f335e7d9 Level: Remove setSeed()
Seed is immutable information about the world, like its generator type, generator options, name, etc. We don't allow changing any of those things, so why the fuck would we allow changing the seed? This makes no sense at all.

I'm removing this because a) its existence makes no sense, and b) it will not produce the behaviour expected from such a function (what even is the expected behaviour???)
2018-10-04 16:24:07 +01:00
Dylan K. Taylor
4d9d4d7c60 More cleanups to level provider hierarchy, move more garbage out of BaseLevelProvider 2018-10-04 16:02:55 +01:00
Dylan K. Taylor
4f421d561c BaseLevelProvider: clean up not-exists error handling disaster
It checks for the existence of (and creates) the world directory if it doesn't exist. But what sense does this make when the world obviously doesn't exist in this case and must be generated first?
2018-10-04 15:41:18 +01:00
Dylan K. Taylor
f787552e97 Remove LevelProvider::getProviderName()
This is problematic because child level providers can forget to override the provider name of their parents, and then override them by error. Instead, they should be used in a mapping fashion to make sure they are unique and not inherited.
Also, the old method did not permit registering multiple aliases for the same provider. This now makes that possible.
2018-10-04 14:56:42 +01:00
Dylan K. Taylor
65b49dec71 Refactor hierarchy of Region-based world formats
In the future, McRegion and PMAnvil will become deprecated legacy formats which we won't support for writing anymore. However, this brings complications because Anvil (which would not be deprecated) would be sandwiched between its deprecated base (McRegion) and its deprecated child (PMAnvil), complicating the implementation (particularly for PMAnvil).

This abstracts away the generic Region-based world functionality into a separate class, making McRegion, Anvil and PMAnvil all inherit from it directly. Since only the chunk formats are different, they are more accurately siblings rather than parent-child (although Anvil and PMAnvil are cousins, ish).
2018-10-04 14:19:19 +01:00
Dylan K. Taylor
eaf6b316c7 I always commit this submodule when I don't want it, and not when I do 2018-10-04 12:52:09 +01:00
Dylan K. Taylor
050e972add Clean up default level provider management 2018-10-04 12:49:46 +01:00
Dylan K. Taylor
23132b899c Added LevelProvider->getAllChunks() method
this returns a generator which yields known chunks. This will be used in the future for world format conversions.
2018-10-03 19:43:16 +01:00
Dylan K. Taylor
8a062f440d Chunk: remove column methods
these were (mostly) unused, and the places they were used breaks the interface definitions. It also exposes internals that are sensitive to change.
2018-10-03 18:35:39 +01:00
Dylan K. Taylor
77fd57e11a Removed wtf from Liquid 2018-10-01 16:20:35 -04:00
Dylan K. Taylor
94936d0f6b Fixed CPU leak in falling water block updating
The cause of this was the flow decay of falling water changing, but the flow decay is ignored for falling water. This caused the block to be repeatedly set to itself, triggering local block updates, causing the disease to spread in large falling water bodies and cause immense amounts of lag.
2018-10-01 16:15:49 -04:00
Dylan K. Taylor
74486d6880 Remove some state meta constants from API visibility 2018-09-30 14:43:55 +01:00
Dylan K. Taylor
274a4d892f Rail: detect state and then place, not vice versa 2018-09-30 14:35:57 +01:00
Dylan K. Taylor
1a2312418b Fixed assert failure when placing northeast/northwest powered rails 2018-09-30 14:17:30 +01:00
Dylan K. Taylor
5344c0a627 Merge branch 'release/3.3' 2018-09-29 15:39:40 +01:00
Dylan K. Taylor
0171095036 Merge branch 'release/3.2' into release/3.3 2018-09-29 15:39:34 +01:00
Dylan K. Taylor
5b511f6d06 Merge branch 'release/3.1' into release/3.2 2018-09-29 15:39:27 +01:00
Dylan K. Taylor
426dee04a6 Potion: remove unnecessary exception throw in getPotionEffectsById()
this is only used by Potion and SplashPotion, and simply causes errors when trying to use potions with unknown IDs.
2018-09-29 15:39:20 +01:00
Dylan K. Taylor
8e6a5813ea Don't auto-create tiles on activate
this complicates the code unnecessarily and doesn't produce the desired effect in most cases anyway.
2018-09-28 20:12:41 +01:00
Dylan K. Taylor
594a2041b6 Trapdoor: fix bad meth in comment 2018-09-28 16:44:30 +01:00
Dylan K. Taylor
2600cf5977 Split some block variants into their own classes where behaviour differs 2018-09-28 16:21:03 +01:00
Dylan K. Taylor
e038c4295d Clean up abhorrent mess of Slab placement code 2018-09-27 18:46:01 +01:00
Dylan K. Taylor
35d51570be Add and make use of Block->isSameType() 2018-09-27 17:59:06 +01:00
Dylan K. Taylor
8910c93de1 Slab: slight reduction of code repetition 2018-09-27 16:45:06 +01:00
Dylan K. Taylor
73f1480e10 Merge branch 'release/3.3' 2018-09-27 16:36:57 +01:00
Dylan K. Taylor
9d8898a4ed Server: added API method hasOfflinePlayerData() 2018-09-27 16:36:42 +01:00
Dylan K. Taylor
0b49ec46c6 Deduplicate Pumpkin/Melon stem code 2018-09-27 16:24:35 +01:00
Dylan K. Taylor
75f364fcf2 Level: Remove obsolete \$direct parameter from setBlock()
this parameter was previously used to send blocks with a different set of flags, immediately, to players. However, the flags have been demonstrated useless and the direct sending is pointless now since packets are buffered now per session, so we might as well take advantage of the batched block update sending.
2018-09-27 16:15:07 +01:00
Dylan K. Taylor
16f2ac14b3 Clean up block update sending, remove UpdateBlockPacket flag constants
These flags are not intended for network use, instead they are supposed to be used internally by the game. For network, we only need to care about the 0x02 flag (send to players) because that's necessary for the client to render the block.
2018-09-27 15:56:08 +01:00
Dylan K. Taylor
8a8f1d84ff EnchantingTable: fix BB 2018-09-27 11:29:23 +01:00
Dylan K. Taylor
e6a1398992 EndRod: fix BB rotation on X/Z axes
this was very apparent with the new code, less so with the magic meta values...
2018-09-27 02:36:39 -04:00
Dylan K. Taylor
ac3509aa3d Updated BedrockData submodule
this change won't be backported to other branches due to technical limitations that can't be easily solved without API breaks.
2018-09-26 19:58:03 +01:00
Dylan K. Taylor
f2c960cfd8 Added on/off handling for buttons and levers 2018-09-26 19:19:35 +01:00
Dylan K. Taylor
ebf5ccea8a Merge branch 'release/3.3' 2018-09-26 13:12:54 +01:00
Dylan K. Taylor
3bb22f9778 Merge branch 'release/3.2' into release/3.3 2018-09-26 13:12:34 +01:00
Dylan K. Taylor
bb1944ca40 Merge branch 'release/3.1' into release/3.2 2018-09-26 13:12:20 +01:00
Dylan K. Taylor
d1a20ecb4a CommandReader: Require readline to be explicitly enabled on Windows
readline on Windows causes issues with console output corruption. Additionally, PM readline impl is extremely buggy and probably ought to be removed. However, have a hotfix for now.
2018-09-26 13:11:21 +01:00
Dylan K. Taylor
896ecb52f4 Merge branch 'release/3.3' 2018-09-24 18:27:26 -04:00
Dylan K. Taylor
16c636df83 Merge branch 'release/3.2' into release/3.3 2018-09-24 18:27:04 -04:00
Dylan K. Taylor
f6a8ec83a1 Merge branch 'release/3.1' into release/3.2 2018-09-24 18:26:39 -04:00
Dylan K. Taylor
28137efb53 Fixed server freezing when using chorus fruit from large Y coordinates 2018-09-24 18:26:20 -04:00
Dylan K. Taylor
9651b3f470 Crops: micro optimization - check age before generating random number (faster)
I don't have any idea how much benefit this will provide in real terms, but it may be significant.
2018-09-24 16:48:19 +01:00
Dylan K. Taylor
a195e940db Fixed BB and right-click action for daylight sensor 2018-09-24 16:37:18 +01:00
Dylan K. Taylor
a77e05f875 Implement corner stair BB handling 2018-09-24 16:25:17 +01:00
Dylan K. Taylor
0b989925d7 whitespace 2018-09-23 18:41:57 +01:00