50 Commits

Author SHA1 Message Date
Dylan K. Taylor
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
Dylan K. Taylor
6ce9e79cd5 fix some minor documentation issues in Binary 2017-10-28 18:40:05 +01:00
Dylan K. Taylor
e88aa385a3 make use of new pack() codes for longs 2017-10-28 14:04:41 +01:00
Dylan K. Taylor
55a1731da3 Remove redundant asserting function in Binary
If this was an inline assert, it would be harmless. Since it's in a function, it contributes to a 20% performance loss when using these functions on a large scale regardless of whether assertions are enabled or not.
Additionally, there's no need to assert that we have enough bytes since unpack() will raise warnings if there isn't, which will trigger exceptions, and for readByte(), an undefined offset notice will be raised, which will also trigger an exception.

TL;DR: This is simply wasting CPU time for no good reason.
2017-10-20 19:23:04 +01:00
Dylan K. Taylor
88807e8b22 Fixed Binary::unsignShort() being non-static 2017-10-03 12:21:09 +01:00
Dylan K. Taylor
ad72fe6232 Make use of awesome new pack() codes for floats 2017-09-14 10:41:53 +01:00
Dylan K. Taylor
23eb8600ab Added methods for endian-flipping 2017-08-06 18:46:03 +01:00
Dylan K. Taylor
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
Dylan K. Taylor
c0377fc63a more typehints, removed more 32-bit leftovers 2017-06-25 11:40:12 +01:00
Dylan K. Taylor
e3b3f60c66 Fixed item stack count and effect amplifier overflows, close #1072 2017-06-17 12:22:38 +01:00
Dylan K. Taylor
4765242397 Drop support for 32 bit systems/PHP (#984)
* Cutting out 32-bit and minor improvements to bootstrap

* Byeeeeee

* Removing legacy code

* added note to the issue template
as suggested by @xxFlare
2017-06-10 16:11:28 +01:00
Dylan K. Taylor
105917a534 Fixed type issues writing longs and var-longs on 32-bit 2017-06-03 12:04:08 +01:00
Dylan K. Taylor
22ba017965 Binary strict types (#969)
* Some Binary cleanup, type-hints and strict types
yes, I know this is very crashy... that's good, because it highlights unexpected behaviour

* added some default values
2017-06-03 09:39:45 +01:00
Dylan K. Taylor
e4e4ef5f2a Fixed preprocessor issues with signed bytes and floats, close #967 2017-06-02 12:50:48 +01:00
Dylan K. Taylor
db3cd1829c Made Binary::readVarInt/VarLong methods less useless 2017-05-30 14:19:34 +01:00
Dylan K. Taylor
16972bf9a5 Fix issues with writing negative numbers as non-zigzag varints, close #493 2017-03-31 18:59:40 +01:00
Dylan K. Taylor
f8c2eb8c3a Fixed signed VarInt encoding on 64-bit systems
Numbers represented as hex or binary with the 32nd bit set, for example 0xffffffff, were not considered as signed on 64-bit.
2017-03-09 12:23:24 +00:00
Dylan K. Taylor
295d9bc80b Cleaned up muddled varint/varlong mess, added separate methods for entity unique and runtime ids, moved some MCPE-protocol-specific methods out of BinaryStream 2017-03-08 20:29:24 +00:00
Dylan K. Taylor
3a044f0154 Added methods for VarLong, limited Binary::readVarInt() to 5-byte numbers 2017-03-08 20:29:23 +00:00
Dylan K. Taylor
8a3c30ee7e Moved entity metadata methods out of Binary 2017-02-13 14:05:16 +00:00
Dylan K. Taylor
75a38699e2 Fix metadata block coords (signed Y coordinate), close #286 2017-01-23 13:13:29 +00:00
Dylan K. Taylor
8ea03524ff Fixed most movement-check false-positives (finally!)
Removed ySize hack, fixes ladders, fixed original autojump and dropdown issues. These were due to a tiny, tiny tiny margin for error when decoding network floats (usually less than 0.000001, but enough to cause issues. Added Binary floating-point decode accuracy option to combat this. Network Vector3s are now rounded to 4 decimal places.
2017-01-20 10:00:20 +00:00
Dylan K. Taylor
1b543b2c16 Improved varint write performance (#126) 2016-11-26 15:07:27 +00:00
Dylan K. Taylor
6e0cebbe38 Add missing import 2016-10-27 10:55:04 +01:00
Dylan K. Taylor
2dfca14714 Add varint length checks (10 bytes, currently no proper varlong support) 2016-10-27 10:55:04 +01:00
Dylan K. Taylor
b6e1a21566 Add new metadata type vector3f and correct metadata encoding. Result = client crash. TODO: new data values and flags. 2016-10-27 10:55:03 +01:00
Dylan K. Taylor
750462aa75 Fix large signed varint/negative number CPU leak 2016-10-27 10:55:03 +01:00
Dylan K. Taylor
bd1b18d9af Fix issues on 64-bit systems -_- (hate php) 2016-10-27 10:55:02 +01:00
Tatsuyuki Ishi
affed33066 Add length check assertions 2016-10-27 10:55:00 +01:00
Dylan K. Taylor
dd0c5efb56 Initial spawn on 0.16 2016-10-27 10:55:00 +01:00
SOFe
58ff381557 PhpStorm automated formatting (#11)
* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
2016-10-03 19:05:48 +08:00
Shoghi Cervantes
1666602652
Improved memory output, logging, removed locks 2015-03-22 03:20:48 +01:00
Shoghi Cervantes
c00370cfbf
Added experimental particles 2015-03-18 08:51:38 +01:00
Shoghi Cervantes
6af87814e3 Added 64-bit entity data field 2015-03-17 16:26:02 +01:00
Shoghi Cervantes
2ae80031f0
New implementation of sending/setting/getting entity data, added effect saving 2015-03-17 00:01:54 +01:00
Shoghi Cervantes
a605e90dfc Added experimental LevelDB support, fixed a few issues with NBT, spawning and Binary R/W 2014-12-19 00:28:50 +01:00
Shoghi Cervantes
7ab3c57b00 Optimized networking code & AxisAlignedBB 2014-10-30 22:06:07 +01:00
Shoghi Cervantes
92eb5cb0b8 Added LE Triad methods 2014-10-30 17:56:58 +01:00
Shoghi Cervantes
d8f9def7f4 Added preprocessor optimizations 2014-10-30 07:58:53 +01:00
Shoghi Cervantes
9b85abd75e Micro-optimizations 2014-10-15 10:44:01 +02:00
Shoghi Cervantes
1174b0c45c Added binary reading optimizations, faster 64-bit reading 2014-09-10 12:13:15 +02:00
Shoghi Cervantes
eab86f5f90 Replaced array() with [] 2014-08-28 17:04:22 +02:00
Shoghi Cervantes
96445c4613 Fixed item in hand in creative mode, player files are now readable by Minecraft PC 2014-05-29 18:45:49 +02:00
Shoghi Cervantes
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
Shoghi Cervantes
6cbd39de9b Added Inventory interfaces and types, updated long array() to [] 2014-05-22 18:59:16 +02:00
Shoghi Cervantes
96e36dbcb3 better Binary 2014-04-09 04:09:39 +02:00
Shoghi Cervantes
5abe5bd43d replaced binary with hexadecimal 2014-04-08 13:02:13 +02:00
Shoghi Cervantes
8d14c98da9 Fixed binary reading/writing of longs 2014-04-08 13:00:50 +02:00
Shoghi Cervantes
999990756c Fixed invalid string type in writeMetadata() 2014-04-07 16:24:58 +02:00
Shoghi Cervantes
c0de004472 Moved binary methods from Utils to Binary 2014-04-07 13:52:01 +02:00