Commit Graph

1355 Commits

Author SHA1 Message Date
ab75e89d95 Fixed generation changes in recent builds compared to 3.x
this was caused by improper RNG sanitization and a recent cleanup refactor.
2018-12-27 17:36:41 -05:00
a6cd9ae029 Implemented #2556: don't send tile NBT updates until the end of tick
this eliminates spam when tile spawn NBT changes a lot during a tick, for example the lines of a sign being updated.

closes #2556
2018-12-26 22:18:52 +00:00
e5cb48bec2 Merge branch 'release/3.5' 2018-12-22 13:31:18 +00:00
42f8e061a5 Merge branch 'release/3.4' into release/3.5 2018-12-22 13:29:41 +00:00
75df6973df LevelDB: Account for 2D maps tag being missing
I don't know why this would be missing, but in some cases it is, as seen in the crash archive. Whatever the case, we shouldn't be shitting the bed because of this.
2018-12-22 13:13:14 +00:00
16ffd99005 Merge branch 'release/3.5' 2018-12-21 18:40:04 +00:00
2664a1b4d8 Merge branch 'release/3.4' into release/3.5 2018-12-21 18:39:42 +00:00
4249c00c3e Level: Fixed generation/send race condition causing blocks to be missing on the client
this FINALLY fixes the remaining occurrences of half-trees.
2018-12-21 18:39:33 +00:00
b709e21622 Merge branch 'release/3.5' 2018-12-21 17:27:02 +00:00
517c4e5143 Merge branch 'release/3.4' into release/3.5 2018-12-21 17:26:32 +00:00
69c343bb9b Level: fix setChunk() deleting tiles when replacing a chunk with the same chunk
this can be desirable to trigger events related to chunks changing, such as chunk sending.
2018-12-21 17:24:08 +00:00
2506947641 Merge branch 'release/3.5' 2018-12-20 20:01:02 +00:00
ea9f9aa250 Update some non-critical protocol magic numbers 2018-12-20 19:59:42 +00:00
20aaa8373a Sound no longer extends Vector3 2018-12-16 14:26:42 +00:00
3c520aa786 Particle no longer extends Vector3 2018-12-16 14:15:41 +00:00
e0558d2551 Merge branch 'release/3.5' 2018-12-14 10:03:36 +00:00
c05697f506 Merge branch 'release/3.4' into release/3.5 2018-12-14 09:39:21 +00:00
ed88684e71 Fixed invisible FloatingTextParticle crashing the server, closes #2560 2018-12-14 09:30:14 +00:00
ffa733fe0c Merge branch 'release/3.5' 2018-12-12 19:51:41 +00:00
ec4c61e113 fix extradata defaults for broadcastLevelSoundEvent
fixes TNT sounds not working, amongst other things
2018-12-12 17:42:52 +00:00
30f5a8fac6 Protocol changes for 1.8.0 release 2018-12-11 21:05:03 +00:00
a9dc447f8f Tile: make createFromData() retrieve the ID by itself 2018-12-11 14:56:25 +00:00
d72e4cb9a1 Tile: remove createNBT(), add create(), createFromData(), createFromItem() 2018-12-10 19:40:37 +00:00
7d594ac6d8 Merge branch 'release/3.4' 2018-12-09 19:28:52 +00:00
f704061618 Tree: fixed being able to overwrite other trees
this was observable by planting a sapling underneath an existing tree and punching it with bone meal.

This change will also prevent trees generating too close together.
2018-12-09 19:26:48 +00:00
cd5b81bdb9 ChunkManager: Remove getBlockIdAt()/setBlockIdAt()/getBlockDataAt()/setBlockDataAt(), add getBlockAt() and setBlockAt() 2018-12-04 22:27:00 +00:00
8dd2ea22b8 Level: make use of fromFullState() in getBlockAt() 2018-12-04 22:05:00 +00:00
47e62b1b38 Level: Add setBlockAt() which accepts integers instead of Vector3 2018-12-04 21:59:58 +00:00
8051fa4f6d Remove some direct Position->level accesses 2018-12-03 21:39:17 +00:00
9fb365306a Make Block->position() accept Level,x,y,z instead of Position
since this is an internal method, it doesn't make sense to force a single parameter that requires potentially constructing a separate object just for the parameters, so we pass primitives instead, which are also easier to typehint against.
2018-12-03 21:18:22 +00:00
c3623478c1 Merge branch 'release/3.4' 2018-12-03 18:33:44 +00:00
e4223bb7dc Level: Duct tape fix for crashy trees at the top of the world
this doesn't fix shit but it at least doesn't crash. Fixing this properly can't be effectively done any other way without backwards compatibility breaks. Fortunately it's not common practice to grow trees at the top of the world.
2018-12-03 18:30:27 +00:00
16006f9175 Make Tile constructors non-dependent on NBT 2018-11-30 17:05:36 +00:00
5024713291 Fixed population artifacts always generating in the bottom subchunk, closes #2538 2018-11-26 14:29:06 +00:00
0fec58730b Level: fixed recursion bug when reading dynamic states
calculating dynamic states in some cases requires getting properties from neighbouring blocks, but getting these blocks also causes their dynamic states to be calculated, leading to a bouncing recursion.
This change allows retrieving blocks without calculating dynamic state information, if the call was generated by calculating dynamic state information.
Since these blocks are incomplete, they should not be cached and are only used to allow another adjacent block to complete its state. It is therefore not possible for a block's dynamic states to depend on another block's dynamic states.

This recursion bug was observable by running /gc and walking into a door, which would cause the server to freeze and crash.
2018-11-24 19:44:31 +00:00
1170b66fd5 Automate creation of tiles when they are used to store block properties 2018-11-24 19:44:31 +00:00
3af293f024 Added a mechanism for blocks to detect dynamic state properties from surroundings 2018-11-24 19:43:02 +00:00
b2201c8c59 Further cleanup to general AABB handling 2018-11-24 19:17:03 +00:00
4c848bb4c1 docs fixes 2018-11-22 17:07:36 +00:00
8b350808ef Fixed merge error 2018-11-22 16:56:44 +00:00
98efd27543 Remove ability to set blockID and blockdata independently
This was the cause of many inconsistency and broken world bugs. In the future (once we switch to paletted chunks) this won't be possible anyway. For now, some temporary API is provided to allow modifying chunkdata directly, but it is required that **both** must be provided.
2018-11-22 16:53:22 +00:00
507d47a6f5 Merge branch 'release/3.4' 2018-11-22 16:49:30 +00:00
449dda83fb Merge branch 'release/3.3' into release/3.4 2018-11-22 16:48:57 +00:00
6bc79149c3 SubChunk: Fixed $changed not getting set in setBlock() when only block data changed
it was comparing a string and an int. This now compares the integer values first.
2018-11-22 16:47:25 +00:00
a4e81674c3 Merge branch 'release/3.4' 2018-11-17 18:13:03 +00:00
cdf7e28251 shut up PhpStorm 2018-11-17 18:12:48 +00:00
f7ba4f553c Merge branch 'release/3.4' 2018-11-17 16:30:19 +00:00
a02f422d85 SubChunk: Fixed constant redefinition on worker threads when autoloading
this happens when workers inherit constants but not classes.
2018-11-17 16:29:53 +00:00
e67b1a20de Merge remote-tracking branch 'origin/release/3.4' 2018-11-17 14:47:35 +00:00
f8bfbc107d Reduce chunk memory usage by 20-60% by exploiting PHP copy-on-write behaviour (#2527)
This takes advantage of two key behaviours of PHP:
1. Assigning a string does not copy the string
2. Changing an offset in a string causes the string to be copied.

These two factors combined, along with the fact that blocklight and skylight arrays are usually all-zeros, allow us to produce a significant memory usage reduction of loaded chunks.
A freshly generated PM world with 3,332 chunks loaded drops from 310MB to 200MB memory usage with these changes applied.
2018-11-17 14:46:05 +00:00