Compare commits

...

3347 Commits

Author SHA1 Message Date
c7f578f297 Possible fix for #2297 2014-11-18 13:57:03 +01:00
19c030281f Fixed #1969 2014-11-18 13:53:38 +01:00
ca9fe1b89a Improved and fixed command exception message, closes #2301 2014-11-18 13:46:00 +01:00
9fd6a695f6 Fixed permission-related memory leak 2014-11-18 13:42:24 +01:00
c07b0ff35b Fixed tile entities not being placed in the correct array 2014-11-15 11:49:09 +01:00
6796fca2b6 Merge pull request #2294 from LukeDarling/patch-1
fixed version message color
2014-11-15 14:20:14 +10:30
5657cce3db fixed version message color 2014-11-14 15:52:38 -05:00
05ac256cc3 Fixed Acacia / Dark Oak logs crafting recipes 2014-11-14 15:58:31 +01:00
49977c5410 Bumped weakref version, fixes travis builds 2014-11-14 10:30:06 +01:00
ca40bb678c Merge pull request #2288 from sekjun9878/master
Get timezone directly. Fixes #2287.
2014-11-13 23:08:22 +10:30
2068cc9cdf Merge pull request #2243 from PEMapModder/patch-1
cmd files comment syntax should be like this.
2014-11-13 21:42:25 +10:30
ea4617cedd Get timezone directly. Fixes #2287. 2014-11-13 21:13:12 +10:30
1a5544f68c Fixed Chunk tile indexes 2014-11-08 15:00:18 +01:00
0128a7aeb2 API version 1.7.1 (fixes) 2014-11-07 09:45:30 +01:00
fd954ce708 Fixed PlayerInventory->setItem() with null items 2014-11-07 09:43:36 +01:00
d63a82de0a MCPE protocol 20 2014-11-06 19:08:32 +01:00
92143d523c Added SetDifficultyPacket 2014-11-06 19:07:24 +01:00
1818e64c8e Merge branch 'master' into 0.10 2014-11-06 18:56:47 +01:00
7e1095e28d Reenabled collision against entities on move 2014-11-06 12:57:17 +01:00
f1519e6d13 Improved Level->getTile() to a direct lookup instead of linear search 2014-11-06 12:34:33 +01:00
3b9a9bcd5d Use proper indexes on Living->getLineOfSight() when a max length is set 2014-11-06 12:23:45 +01:00
263bff01c8 Change RuntimeException to InvalidStateException on BlockIterator 2014-11-06 12:16:12 +01:00
987d647b76 Return proper BlockIterator index, throw more exceptions, improved blockQueue performance 2014-11-06 12:12:31 +01:00
522b75645c Merge branch 'master' into 0.10 2014-11-05 19:04:36 +01:00
9eed0a579c Fixed red sand smelting recipe 2014-11-05 17:41:12 +01:00
064976d32b Fixed ladder recipe 2014-11-05 17:38:23 +01:00
2abb577178 Fixed String -> Wool recipe 2014-11-05 17:36:44 +01:00
127855c220 Fixed Snow block recipe 2014-11-05 17:36:06 +01:00
93c7a3c170 Fixed bonemeal recipe, closes #2260 2014-11-05 17:32:28 +01:00
31903a764a Fixed unloaded chunks residing on memory and getting loaded again causing crash, fixed spawn chunks getting unloaded by players 2014-11-04 17:16:02 +01:00
79bc1d6c85 Fixed server not stopping after a special crash 2014-11-04 17:15:20 +01:00
cc7f12739d Added vertical and horizontal collision detection to Entities 2014-11-04 12:23:42 +01:00
32dae93ef9 Removed unused imports 2014-11-04 12:08:24 +01:00
8fd6582e74 Automatically set Entity / Tile entity save identifiers 2014-11-04 12:04:08 +01:00
a5369b3570 Fixed unloading chunks 2014-11-04 11:18:34 +01:00
abbd33210a Possible fix for #2245 2014-11-04 00:19:50 +01:00
6b6222c09c Allow passing a Player source as last parameter on Inventory->addItem() and Inventory->removeItem() 2014-11-04 00:16:25 +01:00
a8c997d88a ¬¬ 2014-11-03 12:54:46 +01:00
6993718a83 Added EntityDamageByChildEntityEvent 2014-11-03 12:03:37 +01:00
86afecec89 Improved inventory sending, send single slots instead of full inventory as much as possible 2014-11-03 11:48:10 +01:00
29d1fd1fc8 Fixed player viewer list including themselves 2014-11-03 11:29:01 +01:00
af4eb2ab1e Create server.log properly on non-existent directories 2014-11-02 16:15:15 +01:00
f7baf46a54 Fire PlayerInteractEvent on 0xff face 2014-11-02 16:12:51 +01:00
75c0d8324c Fixed some inventory events not firing on players 2014-11-02 13:26:58 +01:00
da4334f06b Revert Armor then Inventory instead of Inventory then Armor on failed transaction 2014-11-01 23:02:59 +01:00
413bd3c0df Use SplFixedArray for improved performance 2014-11-01 22:12:35 +01:00
1a0428654b Updated timings command, give direct link to results 2014-11-01 21:20:44 +01:00
2803a38fd1 Fixed random block updates not firing 2014-11-01 20:26:13 +01:00
95a5ca7889 Added command message to /time add 2014-11-01 20:12:55 +01:00
240f14c425 Fixed #2253 2014-11-01 19:40:15 +01:00
cb9b6ab1d1 Fixed server not using the correct provided path if it did not exist 2014-11-01 19:23:10 +01:00
8a87280566 Added /time start and /time stop 2014-11-01 17:45:11 +01:00
4d97827d44 Improved level switching for players 2014-11-01 17:39:09 +01:00
f8f1e0e9df Despawn entities correctly from clients as they move 2014-11-01 16:47:40 +01:00
bf596ebf05 Fixed Query-related crash 2014-11-01 16:20:40 +01:00
90777014b6 Fixed Stone crash 2014-11-01 16:17:47 +01:00
4a78ffd2dd Fixed FallingSand crash 2014-11-01 16:15:09 +01:00
7c361a52d2 Fixed #2252 2014-11-01 13:52:20 +01:00
13fc0df92c Fixed #2251 2014-11-01 12:40:45 +01:00
d5012f6fcf Fixed server not stopping after a fatal error 2014-11-01 03:07:47 +01:00
4569a73f3d Fixed Entity being set position after being closed 2014-10-31 23:10:29 +01:00
66acb5cdd7 Possible fix for crashing server not stopping 2014-10-31 23:10:12 +01:00
8601405a88 Fixed CPU leak 2014-10-31 21:07:00 +01:00
ae06681b60 Added packet exception handling, updated RakLib 2014-10-31 19:14:59 +01:00
01ffb14e39 Fixed #2204 2014-10-31 17:34:45 +01:00
ce989876af Improved freeing chunks 2014-10-31 16:39:32 +01:00
f8d6ebabf3 Removed some calls 2014-10-31 15:57:07 +01:00
094b600a0c Updated NBT/DataPacket reading 2014-10-31 01:02:31 +01:00
82cfe6ea9c Updated NBT/DataPacket reading 2014-10-31 00:32:50 +01:00
4fba6d7c86 Merge branch 'master' into 0.10 2014-10-30 23:20:59 +01:00
f72d7284b9 Added EncapsulatedPacket reuse on broadcast 2014-10-30 23:20:28 +01:00
8f0527832f Removed extra AxisAlignedBB generation on Door and Trapdoor 2014-10-30 22:15:19 +01:00
f66944368d Update RakLib 2014-10-30 22:06:23 +01:00
7ab3c57b00 Optimized networking code & AxisAlignedBB 2014-10-30 22:06:07 +01:00
673b867ee8 Fixed players not loading chunks when stuck on a unloaded chunk 2014-10-30 20:05:40 +01:00
2424c8a76c Update RakLib, possible fix for notifyACK 2014-10-30 19:44:05 +01:00
92eb5cb0b8 Added LE Triad methods 2014-10-30 17:56:58 +01:00
fd46c71120 Updated RakLib 2014-10-30 17:18:43 +01:00
6a4259bf24 Updated RakLib 2014-10-30 17:04:19 +01:00
9a65279c6a Added ifndef for packets Binary 2014-10-30 16:41:11 +01:00
09a01be709 Added ifndef for NBT Binary 2014-10-30 16:32:57 +01:00
57d1847c50 Updated to receive new optimizations 2014-10-30 16:02:48 +01:00
6e8e2a79dd Fixed Event name being null 2014-10-30 14:52:11 +01:00
d8f9def7f4 Added preprocessor optimizations 2014-10-30 07:58:53 +01:00
8cb9dd9a14 Fixed #2244 2014-10-29 22:58:40 +01:00
c4c374e3fa Added extra chunk sending timings 2014-10-29 21:52:27 +01:00
d57e37896d Improved Region / RakLib 2014-10-29 17:43:21 +01:00
022a978ffb Added InventoryPickupArrowEvent 2014-10-29 16:29:00 +01:00
00b282d40c Improved cache pool cleanup times 2014-10-29 16:13:47 +01:00
8a768cea33 EntityDamageEvent and children now only fire if the attack is possible, moved event trigger to Entity->attack() 2014-10-29 16:02:40 +01:00
289bc56b4b Blocks now save their bounding box, fixed entity block collision check 2014-10-29 15:43:23 +01:00
6f64af3066 Reuse even more objects! 2014-10-29 14:23:51 +01:00
72c09045d5 Fixed Zombie drops crash 2014-10-29 13:21:54 +01:00
5e55c3a8f0 Fixed Chest->unpair() 2014-10-29 13:21:14 +01:00
afaa2cf722 Fixed Double Chest behavior 2014-10-29 12:57:26 +01:00
50cfeaa393 Fixed Stonecutter recipe 2014-10-29 12:36:34 +01:00
dda8b03349 Fixed Bowl recipe 2014-10-29 12:12:54 +01:00
56e848488a Fixed Trapdoor recipe 2014-10-29 12:10:48 +01:00
7e4f862634 Fixed typo in OfflinePlayer 2014-10-29 11:42:29 +01:00
577a7a1c3d cmd files comment syntax should be like this. 2014-10-29 17:20:36 +08:00
78f8d0280d Removed unused imports 2014-10-29 01:14:09 +01:00
0680b98380 Remove chunks from advanced cache after setting 2014-10-29 01:07:30 +01:00
cbe0fe5e46 Added Entity->onGround setting when entities keep moving without checks 2014-10-29 00:41:13 +01:00
7eed92e8fb Use Player->forceMovement on MovePlayerPacket non-tick revert 2014-10-29 00:31:17 +01:00
f772391866 Fixed InventoryPickupItemEvent 2014-10-28 22:05:54 +01:00
8c4faa8622 Added extra Exceptions 2014-10-28 21:07:12 +01:00
b6f7ee20fc Added Error -> Exception handling 2014-10-28 20:43:36 +01:00
0fce83c671 Fixed #2189 2014-10-28 13:27:30 +01:00
8080643cc9 Fixed plugins crashing the server when teleporting players on an invalid event 2014-10-28 13:18:40 +01:00
5bf2174cad Fixed UseItemPacket being able to be sent before spawning 2014-10-28 13:16:20 +01:00
34ae760def New way to spawn entities/tiles using a global register table, allow overriding default entity/tile classes via classes 2014-10-28 13:09:27 +01:00
a5b85c549a Added Snowballs 2014-10-28 12:13:31 +01:00
b9f1812f61 Disallow further modification of Signs by its creator after load/unload 2014-10-28 11:05:32 +01:00
350cee3d41 Added Event allocation pool, updated SPL with Class::onClassLoaded() 2014-10-28 10:47:40 +01:00
144a871c07 Improved Vector3 and Block handling, less allocation on Positions 2014-10-28 10:03:10 +01:00
69492474e4 Improve #2238, do not crash when an invalid/corrupt RCON stop event happens 2014-10-28 02:09:36 +01:00
4299ebebcc Bump API version to 1.6.1 2014-10-28 00:55:07 +01:00
119b429ab8 RakLib update 2014-10-28 00:43:47 +01:00
8f1eb41ca5 RakLib update 2014-10-28 00:23:55 +01:00
ca92d2a0d3 Bumped API version to 1.7.0 2014-10-27 20:30:58 +01:00
db82f76c11 Improved network packets allocation 2014-10-27 20:30:33 +01:00
3f5b129cf5 Updated RakLib 2014-10-27 19:39:24 +01:00
f6aac8728b Mark chunk to be saved when removing invalid entities/tiles 2014-10-27 18:43:58 +01:00
809fc44813 Bump API version to 1.6.1 2014-10-27 16:07:00 +01:00
64f1ff066d Fixed /setworldspawn changing sender data 2014-10-27 15:57:26 +01:00
a5a3f4801a Fixed entities not getting ticks on movement 2014-10-27 15:53:14 +01:00
23d1532ff9 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-10-27 15:44:44 +01:00
ecbbcc2e8e Drop invalid entities / tile entities on chunk loading 2014-10-27 15:44:36 +01:00
7abf52e615 Implemented Vector3 List and AxisAlignedBB Pool to decrease object allocation 2014-10-27 15:39:20 +01:00
9e01e2ef49 Merge pull request #2235 from nno88551/patch-2
Update BaseInventory.php
2014-10-26 15:52:08 +01:00
df81b365e5 Update BaseInventory.php 2014-10-26 22:21:21 +09:00
db8ac0b9cb Merge pull request #2225 from PEMapModder/falling-sand
Update FallingBlock to new Anvil formats, possible fix for #2189
2014-10-25 17:58:47 +02:00
ee4f416d93 Fix FallingBlock.php 2014-10-25 18:15:47 +08:00
8feea721e3 Merge pull request #2223 from Falkirks/set-armour-fix
Fix various get and set armour in PlayerInventory
2014-10-25 12:13:28 +02:00
8e7077ff4b Update FallingBlock to new Anvil formats, possible fix for #2189
I don't have time to test yet, so I am not sure if it does fix it.
2014-10-25 12:26:57 +08:00
4f4a6e7446 Fixes get and set armour 2014-10-24 17:11:59 -07:00
1fc066fc37 Updated time steps from x2.5 to x1.25 2014-10-24 12:12:01 +02:00
b565844062 Merge branch 'master' into 0.10 2014-10-24 12:07:35 +02:00
be948f99cc Fixed #2207 Server crashing if players are closed before logging in 2014-10-24 12:06:55 +02:00
5cb428e5cc Updated build number 2014-10-23 17:23:59 +02:00
d2f4a14d66 Merge branch 'master' into 0.10 2014-10-23 17:21:24 +02:00
516bb37a50 Removed some direct type checks on Entity/Tile->closed 2014-10-21 19:28:29 +02:00
580ade9092 Possible fix for entities not closing correctly 2014-10-21 19:26:16 +02:00
8f7dfe0b71 Removed extra ; from if, fixes #2205 2014-10-21 18:37:29 +02:00
5310ba3ae6 Fixed crash when doing var_dump() of anything that contains the Server object 2014-10-20 13:06:53 +02:00
ef97efcd96 Added explosion death message 2014-10-20 13:00:03 +02:00
30c3718ea8 Improved Explosion item drop position 2014-10-20 12:58:05 +02:00
5437567e95 Merge branch 'master' into 0.10 2014-10-20 12:53:14 +02:00
e3e97a4205 Improved Player->onGround checking 2014-10-20 12:52:00 +02:00
fec387d2ec Fixed entities not being pushed out of blocks 2014-10-20 12:37:17 +02:00
481e2b08ee Removed debug call 2014-10-20 12:05:40 +02:00
15de0eece7 Improved inventory and window allocation, fixes #2200 2014-10-20 09:48:11 +02:00
2f8267aa1e Improved Level object deallocation 2014-10-19 20:45:03 +02:00
f2b573c32f Fixed Level->getMetadata() and similar, removed extra references 2014-10-19 19:51:36 +02:00
34946faf94 Remove errors from Utils::getRandomBytes() 2014-10-19 13:44:38 +02:00
3b47513439 Return result directly on Server->getOfflinePlayer() 2014-10-19 02:49:58 +02:00
7d9a98ec6b Updated UseItemPacket 2014-10-18 23:42:41 +02:00
92facc94b9 Added new fences and fence gates to fuel types 2014-10-18 18:02:39 +02:00
d3327f450c Added different Fence Gates, new Fence Gate crafting recipes 2014-10-18 17:56:18 +02:00
570cab9c66 Added different Fences, new Fence crafting recipes 2014-10-18 17:44:24 +02:00
582ba100b0 Bumped protocol version to 19 2014-10-18 17:01:36 +02:00
4c0daa462d Merge branch 'master' into 0.10 2014-10-18 16:54:03 +02:00
2e6366868d Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-10-18 16:53:42 +02:00
245e9b4f18 Fixes inventory changes getting the wrong window, closes #2187 2014-10-18 16:53:06 +02:00
68e73d4e3a Merge pull request #2188 from aodzip/patch-1
Update Skeleton.php
2014-10-18 15:36:02 +02:00
684617d370 Update Skeleton.php
fixed a little wrong
2014-10-18 21:13:35 +08:00
a879104a6f Minecraft: PE version bump 2014-10-17 14:43:10 +02:00
05f71691fc Fixed AxisAlignedBB->setBB() 2014-10-17 09:57:42 +02:00
1c03c3afcf Decreased chunk ordering times 2014-10-17 09:57:18 +02:00
94e9485be9 Improved broadcast packet encoding 2014-10-17 09:36:47 +02:00
9cb27e26ef Fixed #2183 2014-10-16 22:01:32 +02:00
7760559be1 Improved chunk loading and order refresh times 2014-10-16 20:21:06 +02:00
163a37ee23 Optimized Player->orderChunks() and chunk sending ordering algorithm 2014-10-16 14:54:55 +02:00
c73a3e53be Added extra Entity metadata 2014-10-16 12:49:45 +02:00
8637b7f5a3 Fixed Tasks deleting their Timings reports 2014-10-16 12:49:26 +02:00
747fdab389 Fixed Inventory->removeItem() 2014-10-16 12:16:23 +02:00
204915450f Do not wrap text if unknown characters are found. 2014-10-15 18:38:14 +02:00
500a690cd0 Throw CRITICAL error message on unhandled Exception on commands instead of crashing 2014-10-15 18:35:42 +02:00
d473ce13ee Throw CRITICAL error message on unhandled Exception on plugin events instead of crashing 2014-10-15 18:35:30 +02:00
1adf53a81e Fixed error_handler trace generation on higher debug levels 2014-10-15 17:58:03 +02:00
ed942100ec Do not block when killing workers 2014-10-15 17:49:08 +02:00
8abe95309c Fixed RegionLoader not creating default index on first load 2014-10-15 16:59:31 +02:00
5dc5aba42c Match Player pickup area with Minecraft 2014-10-15 14:57:12 +02:00
bda6f03e15 Added BlockUpdateEvent 2014-10-15 13:07:10 +02:00
69d132401e Fixes entities not being saved and tile entities having an incorrect field, closes #1661 2014-10-15 12:15:17 +02:00
e3a9db5d8f Implemented saving modified chunks 2014-10-15 11:42:58 +02:00
b71a4701d9 Fixed player using an invalid spawn chunk 2014-10-15 11:40:41 +02:00
9b85abd75e Micro-optimizations 2014-10-15 10:44:01 +02:00
7b7b91ea0d Fixed Entity updates not firing 2014-10-15 10:13:49 +02:00
18f6bad48d Implemented scheduled and partial entity updates 2014-10-14 22:49:35 +02:00
fbe548c611 RakLib update, PING/PONG handling 2014-10-14 16:13:32 +02:00
4e793199fa Deprecated EntityMoveEvent 2014-10-14 16:11:10 +02:00
43a97c407d New PlayerMoveEvent, improved player movement event firing 2014-10-14 16:10:50 +02:00
07dcbdb9b0 Fixed Level->getNearbyEntities(), fixes item drops not being picked up 2014-10-14 16:03:14 +02:00
60ca24fe0e Updated PluginManager event deprecation message 2014-10-14 14:11:58 +02:00
6e8144d5d9 Improved player movement event firing & corrections 2014-10-14 00:11:17 +02:00
464afb949e Increased Player->forceMovement check radius 2014-10-13 23:44:28 +02:00
823dc933b8 Improved Entity extinguish operations and packet spam 2014-10-13 23:44:11 +02:00
883f93cc8c Improved item drop spawning 2014-10-13 22:45:04 +02:00
b26ee09f76 Removed a bunch of TODO and fixed item drops on block update 2014-10-13 18:54:34 +02:00
1eec333501 Save block bounding boxes, improves block cache 2014-10-13 18:38:00 +02:00
5448a48f67 Fixed Level->getCollidingEntities() 2014-10-13 18:36:13 +02:00
a10ad42a13 Removed Generic block class 2014-10-13 18:12:34 +02:00
da23cf685d Added PlayerBucketEvent and children, improved Bucket usage and Liquid placing 2014-10-13 18:04:40 +02:00
79e4b3e3a9 Removed old Player->timeout property 2014-10-12 17:12:59 +02:00
8472349caf Improved global block cache 2014-10-12 17:02:27 +02:00
96b61fbb92 Made Wheat crops extend Crop class 2014-10-12 16:20:30 +02:00
6246ad19c4 Added global block cache 2014-10-12 16:16:19 +02:00
9b69cc4288 Removed debug code 2014-10-12 15:40:14 +02:00
114153ae97 Added EntityBlockChangeEvent 2014-10-12 13:37:45 +02:00
ebb844fa52 Removed unused code, fixed undefined variables 2014-10-11 22:22:51 +02:00
bf89ea1cf6 Added BlockGrowEvent 2014-10-11 20:19:46 +02:00
4076fb4657 Added BlockSpreadEvent 2014-10-11 19:27:43 +02:00
312f377483 Added LeavesDecayEvent 2014-10-11 19:01:27 +02:00
0af3dfedd5 Improved Living entity ticking 2014-10-11 17:35:13 +02:00
6f1f201c41 Workaround for entities glitching through the floor on the client-side 2014-10-11 17:02:41 +02:00
48f591e5ce Removed workaround on flying check due to physics calculation fix, closes #2169 2014-10-11 16:43:14 +02:00
7f85e37540 Worked on scheduler 2014-10-11 16:36:38 +02:00
341717c89d Increased Player->stepHeight to 0.6, closes #2156 2014-10-11 16:36:17 +02:00
afdf7bc2b9 Added proper TextWrap width 2014-10-11 00:17:31 +02:00
24c76acf30 Submodule update 2014-10-11 00:04:17 +02:00
baf06dc363 Revert "Use Collectable class on AsyncTask, removed task collection workaround on ServerScheduler"
This reverts commit 0dba14074a.
2014-10-11 00:03:46 +02:00
645c00b2f7 Added TextWrapper 2014-10-11 00:01:53 +02:00
0dd46c835c Made ExplosionPrimeEvent accept setting block breaking settings 2014-10-10 22:39:06 +02:00
0dba14074a Use Collectable class on AsyncTask, removed task collection workaround on ServerScheduler 2014-10-10 20:53:28 +02:00
8b585fd9f7 Deprecated Level->getSpawn() in favor of Level->getSpawnLocation() 2014-10-10 11:43:54 +02:00
9ede8177df Fixed Entity->getLineOfSight() 2014-10-10 09:53:58 +02:00
13ec046f0d Removed old OS detection code 2014-10-09 19:37:23 +02:00
5c4e7b6ee0 Added Living->getTargetBlock(), Living->getLineOfSight(), Vector3 side constants, Vector3::getOppositeSide() 2014-10-09 17:57:25 +02:00
6424934df6 Fixed EntityCombustEvent children using a different handlerList 2014-10-09 14:40:52 +02:00
b2ac959083 Added FurnaceSmeltEvent 2014-10-09 12:47:42 +02:00
c67d4dae7b Added FurnaceBurnEvent 2014-10-09 12:36:57 +02:00
22ad75c5a0 Update fuel duration to ticks 2014-10-09 12:21:14 +02:00
b45ef8928c Added Tile->getBlock() method 2014-10-09 12:14:39 +02:00
eccf7b08d2 Added PlayerDeathEvent methods for inventory keeping 2014-10-09 11:06:05 +02:00
94eb9e35e2 Improved liquid performance, update RakLib 2014-10-08 23:24:39 +02:00
79bf1f12f2 API 1.6.0 2014-10-08 17:39:43 +02:00
10b33546ef Added PlayerBedEnterEvent and PlayerBedLeaveEvent 2014-10-08 17:37:11 +02:00
c52dc58d6f Added ProjectileHitEvent 2014-10-08 17:04:35 +02:00
62af784d37 Removed unused imports 2014-10-08 17:00:23 +02:00
aa010b7dea Added ProjectileLaunchEvent 2014-10-08 16:58:17 +02:00
4a3163b4c8 Added ItemSpawnEvent 2014-10-08 16:53:13 +02:00
c750a204e6 Added ItemDespawnEvent 2014-10-08 16:51:10 +02:00
3313981d54 Fixed issues with Entity::heal() method 2014-10-08 16:46:21 +02:00
57f7d57c76 Added ExplosionPrimeEvent 2014-10-08 16:45:55 +02:00
64bf293c69 Improved EntityShootBowEvent 2014-10-08 16:36:43 +02:00
7b09edf048 Improved EntityRegainHealthEvent 2014-10-08 16:28:40 +02:00
4346773e25 Added EntityDamageByBlockEvent (child of EntityDamageEvent) 2014-10-08 16:13:18 +02:00
b0c314526d Added EntityCombustEvent and childs 2014-10-08 15:51:27 +02:00
dd140ce018 Fixed arrow damage not getting overridden by the event result 2014-10-08 15:38:58 +02:00
08aa7808cf Updated RakLib, better player join 2014-10-08 10:45:37 +02:00
582c165479 Implemented Explosion and PrimedTNT, closes #2139 2014-10-07 17:46:01 +02:00
5fb205493a Spawnable->spawnToAll() now uses the actual chunk instead of the entire level to spawn 2014-10-07 12:50:53 +02:00
e346d245e2 Merge pull request #2166 from PocketMine/query-event-implementation
Query event implementation
2014-10-07 11:46:55 +02:00
4fece32ca8 API 1.5.0 2014-10-07 11:02:22 +02:00
0b79d74a2f Implemented QueryRegenerateEvent 2014-10-07 11:02:05 +02:00
b83c6fbfa3 Added Vine blocks, closes #2162 2014-10-07 10:18:02 +02:00
dda9c598f1 Added new Tool type selection constants 2014-10-07 10:16:05 +02:00
8769d2bcd1 Unload entities from chunks, possible fix for #2157, fixes #2165 2014-10-07 09:27:18 +02:00
3b7ece3363 Do not spawn dead entities to players, fixes #2157, possible fix for #2165 2014-10-07 09:24:19 +02:00
b6025e3f2b Removed selectors on Player->sendMessage() 2014-10-06 16:45:11 +02:00
35de331b74 Fixed Level->getCollidingEntities() when called with a null Entity 2014-10-06 13:18:05 +02:00
de11cce154 Improved entity ticking 2014-10-06 13:10:59 +02:00
d53ba52d32 Removed parse errors from AutoReporting 2014-10-06 12:12:54 +02:00
9db2fe40eb Fixed player datta not getting saved, use fall distance on fly calculation 2014-10-06 12:02:36 +02:00
57bb8f14fa Fixed Player movement collision checks 2014-10-06 11:47:28 +02:00
761cd59514 Implemented flying protection 2014-10-06 11:22:59 +02:00
4c2a1c8684 Implement crop growth levels properly, fixes #2002, closes #2160 2014-10-06 09:34:40 +02:00
31bb6d1a68 Changed base block classes to abstract, closes #2159 2014-10-06 09:27:44 +02:00
cd65179aef Fixes #2155 2014-10-06 12:07:48 +10:30
9abd2c63f4 Improved initial chunk loading, do not skip near chunks, fixes world loading getting stuck 2014-10-06 00:45:02 +02:00
376e359577 Moved connected flag up in the Player disconnect process 2014-10-05 22:51:20 +02:00
571e2f8895 Revert "Option to disable hitbox calculation"
This reverts commit fae330d499.
2014-10-05 16:32:49 +02:00
7106ea87e6 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-10-05 16:32:27 +02:00
6b65b68ebc Possible fix for #1661 2014-10-05 16:32:15 +02:00
d4c75ce68a Trim system timezone output 2014-10-05 17:40:17 +10:30
fae330d499 Option to disable hitbox calculation 2014-10-04 20:07:37 -05:00
5e03e157ad Fixed #2153 2014-10-04 23:16:35 +02:00
b0c40dc1ab Fixed Server->unloadLevel() not removing objects from memory 2014-10-04 20:56:27 +02:00
6840589f4e Fix trailing newline 2014-10-04 18:28:42 +02:00
19e4aaa16a Merge pull request #2151 from sekjun9878/master
Timezone for Windows and IP Geolocation TZdata
2014-10-05 01:51:44 +09:30
e0a7944faa Re-use timezone offset parsing 2014-10-05 01:43:33 +09:30
eeda22d0ba Add portable linux timezone detection for incompatible linux distributions. 2014-10-05 01:29:07 +09:30
769f1effb0 Cleaner timezone parsing for Linux and add support for Macs 2014-10-05 01:05:00 +09:30
42c7322273 Reliable timezone detection using systeminfo for Windows and additional IP Geolocation-based detection. Added a warning message for when auto-detection fails. Fixes #2015. 2014-10-05 00:32:01 +09:30
c8cf6b715e Merge pull request #2150 from PEMapModder/patch-2
Fixed PlayerChatEvent::setRecipients() being ignored
2014-10-04 14:49:14 +02:00
41f94f7385 Fixed PlayerChatEvent::setRecipients() being useless 2014-10-04 20:10:12 +08:00
602bdf27a5 Compatibility with pthreads > 2.0.8 2014-10-02 16:58:37 +02:00
539fa232f8 Added individual object timings to Entities / Tile Entities 2014-09-30 16:09:21 +02:00
f8378c09ba Fixed entities getting OnGround default to true 2014-09-30 13:13:31 +02:00
69fb7ae525 Update RakLib, fixes server locking when shutting down 2014-09-30 09:52:50 +02:00
ee8ad6f92a Implement Armor changes as Transactions 2014-09-30 09:37:58 +02:00
f888acbd7c Send PlayerArmorEquipmentPacket instead of ContainerSetContentPacket with id 0x78 2014-09-29 23:43:52 +02:00
215691f1c4 Update RakLib 2014-09-29 23:23:11 +02:00
1252dd65a9 Improved PlayerInventory->setItemInHand() $source call, fixed Tool durability 2014-09-29 17:53:53 +02:00
762c27affe Added armor change $source parameter 2014-09-29 17:50:48 +02:00
706e1099a1 Update raklib 2014-09-29 16:46:19 +02:00
9cd66dc969 Some changes 2014-09-29 16:37:56 +02:00
5b6b789ab3 Improved exponentiation 2014-09-29 13:24:25 +02:00
85ff696ae5 Improved Chunk entity loading 2014-09-29 13:14:14 +02:00
25f8e8318b Fixed Anvil levels duplicating saved entities 2014-09-29 13:09:13 +02:00
61d84c73d0 Implemented Arrow pick up 2014-09-29 13:05:18 +02:00
f5822c6de8 Improved entity movement updates 2014-09-29 12:59:01 +02:00
b0bd927545 Improved entity base ticks 2014-09-29 12:55:10 +02:00
fde61b7d21 Improved single-threaded chunk generation efficiency 2014-09-29 12:48:11 +02:00
886ad8442c Fixed #2055 Extra packet data sent on armor change 2014-09-28 17:31:44 +02:00
7b5869bea8 RakLib submodule update 2014-09-28 16:35:24 +02:00
3063863c65 RakLib update 2014-09-28 16:06:27 +02:00
0dfaa19380 Fixed invalid spawn position setting for plugins 2014-09-28 15:19:09 +02:00
7fea29e874 Updated pthreads version on Travis-CI 2014-09-28 12:50:03 +02:00
2ded2013bf Fixed auto-save configuration, made it global 2014-09-28 10:50:43 +02:00
aa27c28e65 Force new player position on spawn 2014-09-28 01:14:03 +02:00
05a81bebf4 Fixed server crash when Tile Entities / Entities were loaded and requested the same chunk 2014-09-28 00:39:49 +02:00
ce91f2943a Fixed Double Chests 2014-09-28 00:39:11 +02:00
1d8562fb8c Allow setting the player spawnpoint via events before PlayerJoinEvent 2014-09-28 00:14:08 +02:00
1dfb17b932 Fixed #2126 Items drop twice from tile entities 2014-09-27 14:31:41 +02:00
16384c2b20 Improved Player generation queue 2014-09-27 10:31:02 +02:00
48041b2f19 Basic entity motion on water 2014-09-27 00:09:38 +02:00
529bf743db Added torch drop 2014-09-26 23:07:43 +02:00
48bc919a33 Added Liquid flow 2014-09-26 16:56:10 +02:00
474091c013 Improved Level block update scheduling for repeated updates 2014-09-26 16:55:34 +02:00
666e5553c2 Fixed Level->scheduleUpdate() tick calculation 2014-09-26 16:04:51 +02:00
ae6f532b1d Partial Liquid flow 2014-09-26 13:25:52 +02:00
b231eba803 Fixed E_NOTICE error on player movement 2014-09-26 13:23:47 +02:00
82d903733d Fixed #2121 2014-09-26 11:34:06 +02:00
8e2903da86 API version 1.4.1 2014-09-26 11:19:30 +02:00
d720113ac9 Added non-threaded chunk generation, toggleable on pocketmine.yml 2014-09-26 11:18:46 +02:00
5db45222c6 Deprecated Level->getChunkAt() in favor of Level->getChunk() 2014-09-26 10:31:32 +02:00
2975509d0f Improved chunk unload queue, possible fix for #1661 2014-09-25 23:03:56 +02:00
7e49d073fa Improved player movement, check once per tick 2014-09-24 16:58:22 +02:00
ef3674a296 Possible fix for #1661 2014-09-24 16:47:53 +02:00
6cb7e36f8a Improved knockback motion 2014-09-24 16:17:04 +02:00
b88f19bb74 Improved Level::getSafeSpawn() 2014-09-23 20:16:16 +02:00
8c3fcf0798 Send player metadata on respawn 2014-09-23 20:14:01 +02:00
6b312a7826 Fixed players getting Suffocation damage inside transparent blocks 2014-09-23 19:50:44 +02:00
9907e84eee Torches can now be crafted using charcoal 2014-09-23 19:36:30 +02:00
01f299a7f1 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-09-23 15:54:59 +02:00
91f20f6789 Add valid position difference back to Player entities 2014-09-23 15:54:48 +02:00
4c1edc3f7e Re-order RFC section 2014-09-23 20:32:39 +09:30
5fd1e271c5 Merge pull request #2112 from PocketMine/rfc-rfc-and-voting
RFC and Voting
2014-09-22 15:46:03 +02:00
593b0497b0 Fixed #1750 cannot place slabs against blocks 2014-09-22 11:58:15 +02:00
0907aedcef Fixed Entity/Block issues on negative coordinates, closes #2100 2014-09-22 11:48:39 +02:00
0a29e66b62 Fixed #2114 Removed Player collisions with other entities 2014-09-22 11:26:12 +02:00
3cc4afbcd6 Possible fix for #1920 2014-09-22 11:21:54 +02:00
b3ae6eae04 Added RFC ready status, added new label to label list 2014-09-22 09:30:14 +02:00
3b56b536b6 Changed RFC label 2014-09-22 08:46:03 +02:00
9258281546 Fixed missing whitespace 2014-09-21 21:18:37 +02:00
e7897be7cd Merge pull request #2113 from tnpxxsheepdog/rfc-rfc-and-voting
Update CONTRIBUTING.md
2014-09-21 21:08:18 +02:00
5ff01de413 Update CONTRIBUTING.md
Smoothed out wording, fix grammar.
2014-09-21 15:05:08 -04:00
f191ada405 Fixed text typo 2014-09-21 18:33:34 +02:00
addd74d09e Fix typo, added PR: Request for Comments label 2014-09-21 17:51:35 +02:00
4e9d2d0a7f Added 'RFC and Voting' to CONTRIBUTING.md 2014-09-21 17:45:58 +02:00
d04e994d1b Added TPS load to /status 2014-09-21 12:18:51 +02:00
3d870629f2 Fixed ifconfig command typo 2014-09-21 12:18:26 +02:00
8dbe834dc3 Submodule update 2014-09-21 12:18:10 +02:00
36d8100e17 Protect against \0 attacks on name checking 2014-09-20 18:26:17 +02:00
b880bf13f8 Documented tool usage in Level::useBreakOn() 2014-09-20 18:25:53 +02:00
1ac08ce404 Fixed Utils::getUniqueID() on Linux due to /proc/cpuinfo 2014-09-20 12:39:57 +02:00
689b2ea877 Fixed #2104 Can't place blocks where non-solid entities exist 2014-09-20 11:10:46 +02:00
d1f22ee395 Block more player actions when dead, closes #2102 2014-09-19 20:19:27 +02:00
056ed4802f Send project name on usage 2014-09-19 15:08:40 +02:00
bcb65e9a48 Send build number on usage 2014-09-19 15:07:48 +02:00
5404ba77d0 Throw exception when Server::dispatchCommand() is called with an invalid CommandSender 2014-09-19 10:30:35 +02:00
ae54426836 Fixed date_default_timezone_set E_NOTICE 2014-09-19 10:26:44 +02:00
ee7d84dfbd Fixed T_DOUBLE_COLON 2014-09-19 09:48:02 +02:00
3e1ea23036 Fixed CallbackTask name 2014-09-19 09:46:38 +02:00
d312d2a143 Possible fix for #2046, removed embedded class names 2014-09-19 09:44:58 +02:00
8c627bd0af Remove level locks, possible fix for #2046 2014-09-18 11:44:16 +02:00
6fb7170556 Handle force parameter properly on Level::unload() 2014-09-18 11:38:03 +02:00
50f5c6d8ed RakLib patches 2014-09-18 09:22:52 +02:00
f9d5c5bd37 Improved event checking on PlayerInteractEvent 2014-09-16 17:49:44 +02:00
45dbb3f828 Improved block collision check 2014-09-16 12:02:33 +02:00
8a8a95480e Added Cactus damage 2014-09-16 12:02:18 +02:00
34139c7efe Added more death messages 2014-09-16 11:51:43 +02:00
f0e7713dce Added suffocation, drowning damage. Closes #1908 2014-09-16 11:51:31 +02:00
3ba099b309 Cobweb, Ladders and Water won't cause fall damage 2014-09-16 10:52:00 +02:00
c4a0c759dc Show fire to other clients 2014-09-16 10:48:56 +02:00
e9a2f88847 Added Fire, Lava damage 2014-09-16 10:42:29 +02:00
e608acbd1c Improved Player last damage check 2014-09-16 10:42:01 +02:00
42033da08b Fixed #2035 Invalid Fence Gate bounding box 2014-09-16 00:47:04 +02:00
69ab0d433b Removed old trigger_error() 2014-09-16 00:42:36 +02:00
44a30b7fac Added forced position strong check for Player 2014-09-16 00:32:03 +02:00
50b2f55583 Increased movement error range 2014-09-15 23:53:08 +02:00
da084d6908 Fixed door bounding boxes, closes#2075 2014-09-15 23:40:26 +02:00
7d51bc0004 Possible fix for #2077 2014-09-15 22:14:05 +02:00
87dbc18452 Removed position revert message on plugin event cancelled 2014-09-15 20:32:42 +02:00
5b8d4bba11 Fixed issues with placing doors 2014-09-15 20:32:27 +02:00
bb4c54106a Added temporal workaround for pthreads version check 2014-09-15 18:55:15 +02:00
1617b2509e Fixed plugin-related crash 2014-09-15 12:09:30 +02:00
ec293ebd9e Merge pull request #2071 from PocketMine/pthreads-fix
Removed pthreads workarounds, new pthreads version
2014-09-15 10:16:35 +02:00
9f9422f0ed Added Player->forceMovement check on teleport 2014-09-15 01:16:13 +02:00
da715e48e2 Bumped pthreads version 2014-09-13 12:07:04 +02:00
702b2e539c Update RakLib 2014-09-13 12:01:11 +02:00
63fc229c12 Enabled default PHP GC on generator thread 2014-09-12 15:57:02 +02:00
c71689a919 Optimized server sleep times 2014-09-12 15:56:21 +02:00
09428bc8c7 Merge branch 'master' into pthreads-fix 2014-09-12 13:32:53 +02:00
6c7e16d9d4 Added Permission/Permissible calculation timings 2014-09-12 13:08:59 +02:00
315ea2ea3c 64-bit Random optimizations 2014-09-12 12:58:21 +02:00
83eb9f778a Level generators can be set in server.properties 2014-09-12 01:05:32 +02:00
7923c40b33 Removed as Vector3 on Flat generator 2014-09-12 00:12:52 +02:00
d298adabad Merge branch 'master' into pthreads-fix 2014-09-11 22:06:10 +02:00
cfcf515f62 Added type hint to BlockEvent::getBlock() 2014-09-11 21:57:56 +02:00
b5deae7ba0 Added synchronization to GenerationThread::pushMainToThreadPacket() 2014-09-11 19:18:14 +02:00
d991c32435 Fixed Generator Thread as specified on krakjoe/pthreads#349 2014-09-11 19:10:25 +02:00
dbd1f3f96e Use pthreads interface on Chunk Generation THread, remove IPC sockets, improve performance 2014-09-11 18:05:14 +02:00
0bd7ab9def Added .mailmap file, fixes duplicated commiter names 2014-09-11 17:41:07 +02:00
665c275bb7 New improved RakLib version with pthreads changes 2014-09-11 17:18:54 +02:00
7ef2708fca Permission & interface optimization 2014-09-11 16:43:11 +02:00
78b4223795 Added PermissionAttachment::unsetPermissions(), PermissionAttachment::clearPermissions() 2014-09-11 12:43:53 +02:00
0328b4c5f5 Added PermissionAttachment::setPermissions()
This allows bulk permission without recalculating the new permissions until all everything is set. Permission plugins that set a big amount of nodes may want to use this method.
2014-09-11 12:39:01 +02:00
4624dfb472 Fixed Permissible::setPermission() not using the correct order on replacement 2014-09-11 12:17:03 +02:00
fba12c6ddf Fixed EntityMoveEvent not being cancelled correctly on players 2014-09-10 20:06:30 +02:00
60011a5ecf Fixed PermissionAttachment not recalculating its Permissible permissions 2014-09-10 20:05:41 +02:00
f4ae58dda2 Removed pthreads workarounds 2014-09-10 15:11:56 +02:00
8c939feed9 Added Pumpkin & Lit Pumpkin rotation, closes 2014-09-10 12:36:05 +02:00
02ca227085 Normalized Player pitch/yaw 2014-09-10 12:23:23 +02:00
1174b0c45c Added binary reading optimizations, faster 64-bit reading 2014-09-10 12:13:15 +02:00
8940360df4 Possible fix for #2061 2014-09-10 10:43:24 +02:00
bb34e06754 Fix division by zero when the server goes too fast 2014-09-09 19:13:35 +02:00
e06092cb99 Added Server::getTickUsage() 2014-09-09 18:46:20 +02:00
57373b8c5e TPS measurement improvement, moved interface handling to tick 2014-09-09 18:07:27 +02:00
317c6788a6 Updated RakLib path 2014-09-08 10:11:43 +02:00
0a4e0e3228 Fixed Item drop delay 2014-09-08 07:40:19 +02:00
d8c492de4a Merge pull request #2062 from Yosshi999/patch1
Fixed HeldItem were swapped in mining
2014-09-08 07:37:24 +02:00
05d59d587b Merge pull request #2063 from Yosshi999/patch2
Fixed Player's slot[0] disappears on loging in
2014-09-08 07:37:16 +02:00
7d387fe6aa Fixed TravisTest output 2014-09-07 19:54:13 +02:00
4f7a6a06be Fixed TravisTest pipes 2014-09-07 19:47:31 +02:00
344c84cfa6 Added --disable-readline CLI argument 2014-09-07 19:42:36 +02:00
bd721a13a3 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-09-07 19:33:01 +02:00
92b0b4d43c Implemented basic Travis-CI test 2014-09-07 19:32:21 +02:00
d0b0fbf992 Merge pull request #2064 from PEMapModder/patch-2
Fixed wrong cases
2014-09-07 09:02:54 +02:00
ab334e6962 Fixed wrong cases
I know this doesn't matter at all, but it is ugly in IDEs.
2014-09-07 13:21:05 +08:00
1ad6438e60 Fixed Player's slot[0] disappears on loging in 2014-09-07 11:37:54 +09:00
4ecec42c9d Fixed HeldItem were swapped in mining 2014-09-07 11:29:17 +09:00
84e62598ce Implemented attack cooldown 2014-09-06 16:52:52 +02:00
ad7acb93b6 Added cactus neighbour block check 2014-09-05 11:16:24 +02:00
ac4b4b08fd Fixed Level::setBlock() old calls 2014-09-05 11:00:13 +02:00
d3c308c5a8 Fixed possible Player crash on save 2014-09-05 10:50:19 +02:00
98e0583f34 Implemented Falling Sand 2014-09-05 10:50:06 +02:00
020351e20f Fixed #2052 2014-09-05 09:02:45 +02:00
f140fef52d Possible fix for level save issues, related to #1985 #1982 #1758 2014-09-04 12:37:27 +02:00
9980a0780a Fixed Server::getTicksPerSecond() 2014-09-04 12:22:16 +02:00
352497d88c Improves server ticking.
As I was lying in my bed, I came to a solution for the tick problem.
While remembering how most of the time the server is sleeping,
and how the TPS drops once costly operations are ticked,
I reviewed mentally that part of the code, Server::tick().

Then I saw it: I was setting the next execution time
using the time after it was executed as the base, but it should
have been done using the tick start time - that way if something takes
longer, the server will catch up and won't drop the TPS
until the CPU hits its limit.

I got up, got to my computer, and checked that function.
It was exactly as I saw in a near-dream state, so I fixed it
and tested things if they worked right.

Now I'm fully awake and I can't sleep anymore, so I wrote this.
2014-09-04 01:04:09 +02:00
ba08bfaa45 Do not report E_PARSE or E_COMPILE_ERROR crashes 2014-09-03 13:38:24 +02:00
dea4513c34 Possible fix for #2041 2014-09-03 11:55:49 +02:00
0eac084aa7 Added extra documentation to Level::setBlock() 2014-09-03 11:44:30 +02:00
e17ecf5795 Improved Arrow / Item movement 2014-09-03 10:55:14 +02:00
e94ddcabe0 Fixed dropped items going too fast 2014-09-01 23:37:31 +02:00
acf7eb1ce9 Remove scheduled updates from entities 2014-09-01 23:30:35 +02:00
dcfb7a7ac4 Fixed #2037 2014-09-01 17:47:28 +02:00
97c87aa8fa Added __debugInfo() to Server and Level 2014-09-01 17:37:28 +02:00
11f684d803 Improved CallbackTask timings data 2014-09-01 12:44:52 +02:00
ff48eb3d4d Added better Entity/Tile scheduled updates 2014-09-01 11:59:46 +02:00
e047b6a870 Fixed bows not getting damaged 2014-09-01 11:43:48 +02:00
c5626bae34 Do not set Level to null, closes #2032 2014-09-01 11:29:44 +02:00
3eac08f5ba Possible fix for #2027, properly check Player onGround flag 2014-09-01 02:32:16 +02:00
cc2555bb88 Fixed crash when chests are closed with viewers 2014-09-01 02:26:23 +02:00
705e4da789 Tick entities on Level, show correct timing reports 2014-09-01 01:56:13 +02:00
9b7a94b5ee Fixed timings ticks getting reset 2014-09-01 01:50:28 +02:00
bcdb6d8c2e Fixed timings name 2014-09-01 01:28:42 +02:00
eff63a661e Player creative check refactor 2014-08-31 10:49:20 +02:00
5a756d215d Fixed creative players dropping their inventory 2014-08-31 10:45:38 +02:00
422262d585 Fixed infinite Entity recursion on chunk load 2014-08-31 01:06:53 +02:00
b761a97660 Fixed crash due to class name conflict 2014-08-31 01:05:15 +02:00
7579cd763a Added Trapdoor bounding box 2014-08-30 23:57:57 +02:00
6bc5f60011 Added Cobble Wall bounding box 2014-08-30 23:52:06 +02:00
3eb8ca0d13 Added Soul Sand bounding box 2014-08-30 23:47:39 +02:00
a23352be88 Added Ladder bounding box 2014-08-30 23:45:08 +02:00
fa5f00a1ff Added Cake bounding boxe 2014-08-30 23:42:07 +02:00
d3a05adede Added Doors bounding boxes 2014-08-30 23:38:56 +02:00
f9182bd0f8 Added Iron bars bounding box 2014-08-30 23:30:10 +02:00
edad52c6ea Added Glass Pane bounding box 2014-08-30 23:30:01 +02:00
cd5e16f017 Added Fence Gate bounding box 2014-08-30 23:20:59 +02:00
310a7d6c04 Added Fence bounding box 2014-08-30 23:18:37 +02:00
ccea26c978 Added Farmland bounding box 2014-08-30 23:07:55 +02:00
cf542ac73a Added End Portal frame bounding box 2014-08-30 23:06:50 +02:00
3bf39df255 Added cactus bounding box 2014-08-30 23:06:27 +02:00
910e5e6181 Added stairs bounding box 2014-08-30 23:01:33 +02:00
a396b8c220 Fixed #2021 2014-08-30 21:45:32 +02:00
ec1fe6a083 Fixed EntityShootBowEventEvent crash 2014-08-30 19:07:17 +02:00
706c97b9b1 Made shooting bow use its durability 2014-08-30 18:46:09 +02:00
a04516a879 Added EntityShootBowEvent, made bow require an arrow 2014-08-30 18:43:32 +02:00
0f6dfd39b8 Made EntityDamageByEntityEvent call EntityDamageEvent handlers 2014-08-30 18:41:00 +02:00
36ee6d9966 Added arrow and suicide death messages 2014-08-30 18:30:39 +02:00
23793e0fc4 Added check for invalid entity attack 2014-08-30 18:24:24 +02:00
3409d332e7 Added survival check to movements 2014-08-30 17:57:30 +02:00
ca1b67a675 hmm 2014-08-30 17:07:50 +02:00
f5eed4f12b Disable RakLib port checking by default 2014-08-30 16:14:09 +02:00
7a10f91330 Fixed entity partial block moving 2014-08-30 15:31:22 +02:00
6477f4f077 Added Wooden Slab bounding box 2014-08-30 02:14:48 +02:00
3731e74696 Added Slab bounding box 2014-08-30 02:14:24 +02:00
c774e4c203 Added Carpet bounding box 2014-08-30 02:09:15 +02:00
d4907a2688 Added Chest bounding box 2014-08-30 02:07:50 +02:00
793520926b Added Bed bounding box 2014-08-30 02:06:46 +02:00
bf839e821c Added proper arrows and damage 2014-08-30 01:22:46 +02:00
7aeacf2705 Fixed armor crafting recipes 2014-08-29 14:49:41 +02:00
fc62c91c90 Fixed double physics calculation 2014-08-29 13:33:59 +02:00
98dd7f8c15 Use Entity::move() as player movement, protect against noclip cheat 2014-08-29 13:33:25 +02:00
7a1d25617f Fixed physics sneak flag 2014-08-29 13:02:08 +02:00
69b3ef326b Merge pull request #1994 from PocketMine/nbt-array
Added NBT <-> PHP array/type conversion methods
2014-08-29 12:17:10 +02:00
fadff2cc5b Removed debug code 2014-08-28 23:59:18 +02:00
43a0ef433e API version bump 2014-08-28 23:44:19 +02:00
9a1e7ca83c Implemented NBT::getArray() and NBT::setArray() 2014-08-28 23:43:04 +02:00
b9111b6f52 Fixed #1992 2014-08-28 23:19:44 +02:00
be70121f3a Renamed Item\Block to Item\ItemBlock 2014-08-28 22:28:32 +02:00
e2986992c7 Fixed AxisAlignedBB infinite expansion 2014-08-28 21:11:49 +02:00
9fb46d8fe8 Fixed entity physics 2014-08-28 18:26:37 +02:00
eab86f5f90 Replaced array() with [] 2014-08-28 17:04:22 +02:00
2f2afe2336 Fixed #1966 Face Lit Pumkins correctly 2014-08-28 11:00:41 +02:00
f7de1ede3f Made PocketMine loader backwards-compatible 2014-08-27 21:30:36 +02:00
812ae09a06 Merge branch 'php-5.6' 2014-08-27 21:24:52 +02:00
e473cd5e67 Improved unloaded tile entity handling 2014-08-27 18:18:33 +02:00
9e5e4fb362 Fixed possible Level::getBlock() crash 2014-08-27 18:11:23 +02:00
afa98866e0 Fixed Item after-clone behaviour 2014-08-27 18:11:02 +02:00
90fa40de34 Added entity id names 2014-08-27 17:42:38 +02:00
e6234c4c4d Removed cli_set_process_title() check 2014-08-27 12:45:14 +02:00
8f66d03d99 Improved Item::get() 2014-08-27 12:43:54 +02:00
8e9da9c84e Improved safe_var_dump(), Inventory::addItem() Inventory::removeItem() using argument unpacking 2014-08-27 12:29:04 +02:00
759d7e2545 Initial PHP 5.6 features support 2014-08-27 12:21:01 +02:00
f4b92bcdfc Fixed #1980 2014-08-27 11:41:00 +02:00
f7e2d31f0a Check player online status, closes #1983 2014-08-27 11:28:49 +02:00
e0fc3784ad Throw exception when saving an already-closed player, closes #1981 2014-08-26 22:02:43 +02:00
bf5630dc0d Fixed #1926 Teleport to non-generated chunks 2014-08-26 16:45:51 +02:00
472431752b Dropped items and arrows get deleted on Y < 0 2014-08-26 16:19:45 +02:00
c40f9f65a5 Optimize imports 2014-08-26 11:54:24 +02:00
f74af12914 Improved chunk ticking, enabled again. Disable it setting chunk-ticking.per-tick to 0 2014-08-26 11:52:45 +02:00
d169734781 Improved chunk sending 2014-08-26 11:50:51 +02:00
35b86af2af Fixed furnace achievement check 2014-08-26 10:56:33 +02:00
706bc8e8db Fixed undefined index on furnace recipes 2014-08-26 00:05:40 +02:00
b542c5b9bd Added Furnace progress fire 2014-08-26 00:05:18 +02:00
69800c6d79 Fixed #1911 Implemented FurnaceInventory callback 2014-08-26 00:03:16 +02:00
ea9fc3c72e Fixed #1879 Tile entities were not saved on chunk unload 2014-08-26 00:02:20 +02:00
8b90281355 Fixed #1953 Increased item PickupDelay to 2.5 seconds 2014-08-25 23:38:35 +02:00
92cabced97 Ctrl+C handling and kill signals are working again 2014-08-25 23:24:18 +02:00
cb645fa288 Moved spl to PocketMine-SPL 2014-08-25 21:02:33 +02:00
bda597a71e Moved spl to PocketMine-SPL 2014-08-25 20:54:53 +02:00
d6a0e284e3 Workaround BaseChunk::setBlock() recursion issues 2014-08-25 17:08:02 +02:00
1795c8c5e3 Fixed Chests/Furnaces not dropping contents when broken 2014-08-25 16:59:04 +02:00
c3b1b59118 Fixed #1970 Breaking blocks does not remove tile entities 2014-08-25 16:55:52 +02:00
a0df0a8fff Fixed player fall damage 2014-08-25 16:53:20 +02:00
049103ab7a Improved Block selection and construction performance 2014-08-25 16:39:47 +02:00
84c63c48ca Improved NBT IntArray read/write 2014-08-25 16:28:46 +02:00
20e11bd408 Improved player onGround collision check 2014-08-25 15:48:12 +02:00
456760b334 Removed unloaded chunk check 2014-08-25 15:43:48 +02:00
46e502430e Added teleport flag to MovePlayerPacket, improves player movement 2014-08-25 13:01:39 +02:00
87b800ebb9 Fixed #1967 Glowstone dust -> Glowstone recipe 2014-08-25 11:33:47 +02:00
9fdafb87b4 Fixed #1962 Fake client-side player entities 2014-08-24 23:12:12 +02:00
1fcfef20b0 Implemented beds 2014-08-24 20:34:24 +02:00
6109505786 Implemented correct time offsets and speed 2014-08-24 20:34:06 +02:00
764937dda4 Fixed #1961 2014-08-24 18:08:14 +02:00
8bf36315ae Updated RakLib 2014-08-24 17:21:05 +02:00
1ea0531ec7 Added RakLib port checking option 2014-08-24 17:16:37 +02:00
c47e359262 Updated blocks bounding boxes 2014-08-24 16:30:56 +02:00
f0f9bccb4b Fixed #1960 2014-08-24 15:57:13 +02:00
214dcef1ea Improved Air block collision check 2014-08-24 15:55:34 +02:00
4edadd764c Improved Level::getBlock() 2014-08-24 14:30:43 +02:00
01ebe74974 Performance improvements in blocks and Entities 2014-08-24 14:08:17 +02:00
84ce5f1c73 Performance improvements in NBT reading/writing 2014-08-24 13:59:37 +02:00
93a2bd36e0 Require PHP >= 5.5 2014-08-24 13:33:03 +02:00
fdd59e4506 Fixed default memory-limit values 2014-08-23 20:14:41 +02:00
9b86b1d45b Added --enable-profiler parameter to use with @krakjoe profiler 2014-08-23 20:14:04 +02:00
1a38003bc4 Fixed /version 2014-08-22 19:39:24 +02:00
60ea4d0e96 Removed hardcoded Server name from source 2014-08-22 18:31:17 +02:00
6077190a62 Deprecated Server::loadPlugin(Plugin) in favor of Server::enablePlugin(Plugin) 2014-08-22 17:43:29 +02:00
57299b9a29 Fixed #1948 /whitelist list is now working 2014-08-22 13:23:56 +02:00
bb08da701b Fixed header logo in PR #1944 2014-08-22 11:30:15 +02:00
ee593fe5e4 Merge pull request #1944 from PEMapModder/patch-2
Cleaned Mycelium.php and fixed its potential crash
2014-08-22 11:22:10 +02:00
e8b1b0fab6 Cleaned Mycelium.php and fixed its potential crash
Crash report: http://crash.pocketmine.net/view/27500
2014-08-22 11:05:47 +08:00
4858c7d82e Merge pull request #1912 from Intyre/feature/block
EndPortal, EndStone, MonsterSpawner, Mycelium and Podzol blocks added
2014-08-21 19:34:51 +02:00
ecc9e1d223 EndPortal meta and Endstone breaktime 2014-08-21 19:26:41 +02:00
a3cc676ac6 Improved player spawn, closes #1890 2014-08-21 19:18:06 +02:00
db7222976e Code cleanup 2014-08-21 17:26:41 +02:00
e1ef86074e Merge pull request #1937 from Yosshi999/patch
Fixed #1923 sending NULL to Level::getXZ()
2014-08-20 16:03:52 +02:00
9f4582349d Fixed #1923 sending NULL to Level::getXZ() 2014-08-20 22:32:19 +09:00
5dc3fe4fe9 Fix backwards-incompatible change 2014-08-19 16:26:37 +02:00
8446bd2ba5 Added thread stop message 2014-08-19 12:55:21 +02:00
9f34d22013 Detach invalid Workers on shutdown 2014-08-19 12:46:44 +02:00
973d6b5869 Removed 'unhandled data packet' debug message 2014-08-19 12:30:12 +02:00
40d2f8a373 Save level data automatically, closes #1927 2014-08-19 11:54:12 +02:00
b66f49dc5e Fixed infinite recursion when setting a block on an EmptyChunkSection 2014-08-19 11:37:02 +02:00
5c150f696c Fixed task not being freed from player on close 2014-08-19 11:31:23 +02:00
0246648a2c Possible solution for #1703 in-game action lag 2014-08-18 23:25:46 +02:00
532b12c6c0 Mycelium spreads like grass and MonsterSpawner breaktime added 2014-08-18 20:06:18 +02:00
34711dc346 Fixed #1889 Players drop their inventory when they die 2014-08-18 14:49:53 +02:00
3c231118a6 Fixed #1674 Wooden tools only craft with Oak wood 2014-08-18 14:43:08 +02:00
a816234ee8 Merge pull request #1917 from Yosshi999/patch2
creative & survival hotbar bugfix
2014-08-18 14:33:05 +02:00
baa34a7cca creative & survival hotbar bugfix
:P
2014-08-18 21:18:14 +09:00
daf1a8266d Merge pull request #1906 from PocketMine/MoreEvents
Added more events, API 1.3.0
2014-08-18 13:55:35 +02:00
4e6ff81674 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-08-18 13:51:21 +02:00
84a1b319c8 Modified chunk generation garbage collector 2014-08-18 13:49:43 +02:00
16774e66e6 Fixed crashes when default level is not loaded 2014-08-18 13:42:20 +02:00
67b97ade8b Workaround crash when placing paintings 2014-08-18 13:36:59 +02:00
0f04f4bc8a creative & survival hotbar bugfix 2014-08-17 21:55:31 +09:00
4c7b172cbe creative & survival hotbar bugfix
Supports Air
Bug fix
2014-08-17 21:51:32 +09:00
e91781cbf2 EndPortal, EndStone, MonsterSpawner, Mycelium and Podzol blocks added 2014-08-17 02:00:17 +02:00
cf0dc95a76 Merge pull request #1910 from Falkirks/master
Improve behaviour of showPlayer()
2014-08-16 20:26:56 +02:00
9fa7b9b5ea Fixed indent 2014-08-16 11:03:40 -07:00
badbe75d58 Check if player is online before showing 2014-08-16 11:00:57 -07:00
5eee4f9771 Fixed AddEntityPacket, added base Arrow 2014-08-16 16:37:57 +02:00
52d28795fa Added Villager spawn egg 2014-08-16 14:25:58 +02:00
c675605014 Added item activation, zombie spawn egg 2014-08-16 14:01:07 +02:00
758a6af678 Added Chiseled stone brick, red sand, end stone 2014-08-16 13:34:58 +02:00
6f30cd8a22 Removed PHP_VERSION constant on pocketmine namespace 2014-08-16 13:17:05 +02:00
8455e89784 Bump API version to 1.3.0 2014-08-16 13:08:46 +02:00
eee0eb5458 Added RemoteServerCommandEvent 2014-08-16 13:05:20 +02:00
7e4a191593 Added SignChangeEvent 2014-08-16 12:58:16 +02:00
8725ad522f Remove player unset limitations 2014-08-16 12:47:19 +02:00
a610a86579 Fixed #1901, EmptyChunkSection gets replaced by invalid Section 2014-08-16 11:54:08 +02:00
24134a06b8 Alternate chunk generation between multiple levels 2014-08-16 11:49:37 +02:00
de6f5309dc Fixed #1882 Race-condition on multiple world generation, causing lock of the geneartion thread 2014-08-16 11:18:26 +02:00
a2e231101e Added extra information to CONTRIBUTING.md about issue titles 2014-08-16 10:58:41 +02:00
918024e466 Load later plugins with custom loader, fixes API 2014-08-16 00:30:37 +02:00
9e74169d74 Better Anvil chunk loading 2014-08-15 17:04:16 +02:00
ec93ed3e3d Fixed crash on tile unloading 2014-08-15 16:37:39 +02:00
a7b44e3892 Stop submission of plugin syntax error crashes 2014-08-15 16:18:54 +02:00
31b92b392e Throw invalid event exception when a plugin tries to declare an abstract event 2014-08-15 16:15:12 +02:00
2f9494ed52 Fixed crash caused by a race condition on Query 2014-08-15 16:07:04 +02:00
7a5c583407 Throw exception when null chunk is passed to a Tile/Entity 2014-08-15 16:04:48 +02:00
f60e2860e8 Release strong weak references on close, closes #1883 2014-08-15 13:41:13 +02:00
9c95441402 Force despawn of players on quit 2014-08-13 20:43:46 +02:00
1f902d814e Move only own player from eye level 2014-08-13 20:25:43 +02:00
0ab3da88be Send player movements as direct packets 2014-08-13 19:32:25 +02:00
e6edace944 Move players from eye level, not top of head 2014-08-13 19:26:45 +02:00
3ee61d5ebb Improved chunk cache, clean invalid chunks 2014-08-13 19:21:42 +02:00
19d391b9b2 Added Exception handling on level loading 2014-08-13 10:48:53 +02:00
e462a89189 Order chunks to be generated 2014-08-13 09:51:43 +02:00
d616e73242 Fixed chunk sending 2014-08-13 09:41:13 +02:00
5ec6ccefda Merge pull request #1875 from KnownUnown/patch-1
Fixed AddMobPacket's Type - (is now int)
2014-08-12 19:34:42 +02:00
58d7599d6f Fixed AddMobPacket's Type - (is now int)
Thanks @Intyre!
2014-08-12 12:31:07 -05:00
0c5f920dfd Level formats can send chunks without creating an AsyncTask, API 1.2.1 (small fix, no changes) 2014-08-12 17:39:39 +02:00
67f6482c76 Implemented circular chunk sending 2014-08-12 17:30:01 +02:00
7b141b0b73 Remove head offset from client-side MovePlayerPacket 2014-08-12 17:16:31 +02:00
b17ce16262 Fixed RCON usage 2014-08-10 18:35:01 +02:00
fee7f5060b Made AsyncTask::onCompletion() implementation optional 2014-08-10 18:15:06 +02:00
76cd164aa4 Fixed source servers getting invalid AutoUpdater notifications 2014-08-10 13:25:15 +02:00
582f1540a7 Players are now moved using the head, closes #1842 2014-08-10 13:22:12 +02:00
4d7c953572 Possible fix for 'Invalid Chunk given' crash 2014-08-10 13:09:41 +02:00
06c01f14c6 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-08-10 12:28:03 +02:00
c43431c921 Fixed #1826 Block damage values were swapped in McRegion 2014-08-10 12:27:49 +02:00
4e1805ae02 Merge pull request #1859 from PEMapModder/patch-2
Update CONTRIBUTING.md
2014-08-10 12:09:32 +02:00
ac34b9eda0 Update CONTRIBUTING.md
PocketMine namespaces are all in lowercase letters.
2014-08-10 18:08:09 +08:00
3495c79c0c Fixed crashes related to ChunkEvent 2014-08-09 10:42:03 +02:00
77799d8f3d Fixed AsyncWorker includes 2014-08-08 18:06:07 +02:00
dfdf9ddb45 Merge pull request #1846 from milo1000/issue_1843
Issue 1843 - RCON worker threads synchronization corrected
2014-08-08 16:26:47 +02:00
86d423ae4d Hide timezone guess errors 2014-08-08 12:53:31 +02:00
eff454d103 Fixed AsyncWorker not getting the proper path and not using the correct class 2014-08-08 11:51:36 +02:00
51120fdd4f Added ThreadManager, removed PHP self-kill 2014-08-08 11:36:55 +02:00
5242e87026 Issue 1843 - RCON worker threads synchronization corrected 2014-08-07 10:19:23 +02:00
269a10fadd Modified Level and Chunk deprecated methods 2014-08-06 16:22:55 +02:00
232bf5ebe4 Modified Chunk provider saving 2014-08-06 16:22:49 +02:00
2904aa06ef Merge pull request #1838 from PEMapModder/patch-2
Fixes Position::fromObject() $strong parameter neglected
2014-08-06 11:12:53 +02:00
e10c70e776 A typo fix 2014-08-06 11:06:30 +08:00
2cead226db Fixes Position::fromObject() $strong parameter neglected 2014-08-05 23:45:09 +08:00
2784925a5e Merge pull request #1822 from LukeDarling/patch-1
fixed tell command so itdoesn'tlooklikethisanymore
2014-08-03 22:38:21 +02:00
d2a14e8303 fixed tell command so itdoesn'tlooklikethisanymore 2014-08-03 13:22:41 -04:00
071033ad5c Added new installer languages 2014-08-02 18:00:36 +02:00
1e3ed8640c Updated Installer wizard language 2014-08-02 17:54:48 +02:00
60a576e541 Added proper Entity->__toString() 2014-08-02 17:48:56 +02:00
eee7e659e9 Added ChunkLoadEvent, ChunkUnloadEvent, ChunkPopulateEvent 2014-08-02 17:19:33 +02:00
7ddfd4394d Merge pull request #1818 from 64FF00/master
Added getExecutor() and setExecutor() method to PluginCommand
2014-08-02 14:43:12 +02:00
f0f2eb9a01 ... 2014-08-02 10:17:27 +09:00
839f6621eb Added getExecutor() and setExecutor() method to PluginCommand
:D
2014-08-02 10:11:36 +09:00
7fcaa78de4 Catch uncatched thrown Exceptions to get useful backtraces 2014-08-01 17:04:16 +02:00
915443b508 Disabled chunk ticking until it is stable 2014-08-01 15:25:40 +02:00
e17a7005a1 Throw exception on invalid chunk 2014-08-01 14:33:50 +02:00
c1846e3bcf Improved chunk serialization 2014-08-01 13:22:48 +02:00
81feff6d0d Merge pull request #1813 from PocketMine/revert-1748-enabled-builtin-php
Revert "Enabled built-in PHP"
2014-08-01 12:50:05 +02:00
9b84d8c248 Revert "Enabled built-in PHP" 2014-08-01 12:49:53 +02:00
26ec562fbf Added worlds directive to pocketmine.yml to load extra worlds or use a plugin-provided generator 2014-08-01 12:24:08 +02:00
d10274ca7c Improved memory usage when chunks are saved/generated 2014-08-01 11:53:24 +02:00
7c68e42a86 Fixed chunk rotation on McRegion-based worlds 2014-08-01 11:52:13 +02:00
171de939cd Fixed crash on chunks that are used by an entity after generation 2014-07-31 20:05:07 +02:00
58bded4988 Merge pull request #1801 from PocketMine/McRegion
Added multiple level formats support, implemented McRegion
2014-07-31 19:28:39 +02:00
cb4a970631 Tuned generator to use a better way to process chunks, closes #1807 #1794 #1740 #1741 #1685 2014-07-31 19:27:01 +02:00
95b5979351 Removed SimpleChunk from generator, core, use binary representation of chunks 2014-07-31 14:28:17 +02:00
18d13fdc32 Added threaded chunk sending for all formats 2014-07-31 10:19:44 +02:00
1a442b793c Fixed Tiles/Entities not using the correct chunk type 2014-07-30 18:24:59 +02:00
765d4f30c7 Added caching to non-converted network chunks 2014-07-30 17:30:22 +02:00
2eced89e6f Do not send crash reports generated from a source PM installation 2014-07-30 17:05:46 +02:00
293102d8c4 Fixed typo, BLockLight -> BlockLight 2014-07-30 16:59:52 +02:00
25f5d409f1 Fixed loading invalid plugins crashing the server 2014-07-30 16:57:31 +02:00
4128b22e85 Reuse McRegion classes on Anvil 2014-07-30 16:38:56 +02:00
487ce00542 Correctly fixed #1659 PvP settings not working 2014-07-30 16:07:21 +02:00
a9cd03da2e Changed @williamtdr syntax 2014-07-30 16:05:36 +02:00
f5fee4c909 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-30 14:10:39 +02:00
016b08ecf2 Added block order detection, added support for non-sectioned level formats 2014-07-30 12:57:00 +02:00
3515a037c5 Merge pull request #1804 from PocketMine/revert-1760-patch-1
Revert API breaking changes "Remove similar player name check from the beginning limit"
2014-07-30 00:36:12 +02:00
d6e413e8ca Revert "Remove similar player name check from the beginning limit" 2014-07-30 00:34:54 +02:00
f991efd5bc Merge pull request #1803 from Falkirks/patch-1
Spelling on crashDump()
2014-07-30 00:12:08 +02:00
913c116e7b Spelling 2014-07-29 15:10:50 -07:00
8fafb85784 Added proper chunk saving in McRegion 2014-07-29 19:36:41 +02:00
b0aad89e7a Fixed a few typos in McRegion 2014-07-29 19:11:09 +02:00
ce018fd7c8 Bumped API version to 1.2.0 (backwards-compatible changes, related to level formats) 2014-07-29 18:55:27 +02:00
afe44e6c6f Added setting to select the default level format 2014-07-29 18:54:40 +02:00
e9311f5ceb Added base McRegion classes 2014-07-29 18:43:52 +02:00
b2978133f7 Added McRegion detection to Anvil 2014-07-29 17:21:07 +02:00
6b331535c6 Merge pull request #1748 from MinecrafterJPN/enabled-builtin-php
Enabled built-in PHP
2014-07-29 09:56:05 +02:00
3370052fac Do not send crash reports from non-phar plugins 2014-07-28 23:14:29 +02:00
7d8a961374 Throw exception when an invalid chunk is set as the parent of a Tile/Entity 2014-07-28 21:40:50 +02:00
e97139919a Added new exception when a plugin creates an orphaned PluginTask 2014-07-28 20:28:50 +02:00
81faddafb0 Fixed crash when using Level scheduled block update ReversePriorityQueue 2014-07-28 19:18:28 +02:00
d0936329aa Fixed crash reports using invalid lastError data 2014-07-28 15:41:13 +02:00
9124513584 Added RakLib version to crash information 2014-07-28 14:48:26 +02:00
e860c339e2 Fixed crash when cactus was updated 2014-07-28 14:46:52 +02:00
10c67a57a7 Added extra crash dump settings, added way to disable parts of it or change the host 2014-07-28 14:42:51 +02:00
b10e63b951 Removed debug values on Crash dump 2014-07-28 13:47:38 +02:00
409eeda6ee Added plugin crash detection 2014-07-28 13:20:13 +02:00
bf09c48d62 Fixed build number on crash dumps 2014-07-28 12:57:08 +02:00
aac646d343 Fixed full path phar on logs 2014-07-28 12:20:16 +02:00
ed90d58e32 Fixed crash when placing water or lava 2014-07-28 12:18:17 +02:00
e219f4784c Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-28 12:12:14 +02:00
b5a1c23c50 Moved rtfd documentation 2014-07-28 12:11:01 +02:00
14817df2c7 Merge pull request #1793 from Intyre/bug/inventory
player creative inventory bugfix
2014-07-28 11:36:32 +02:00
cc87064915 player creative inventory bugfix 2014-07-28 02:24:08 +02:00
aded24e6c6 Updated error path replace (again\!) 2014-07-27 23:05:49 +02:00
a95f8b45f1 Updated error path replace 2014-07-27 22:55:45 +02:00
7a3703d8b1 Fixed undefined $fullFile on CrashDump 2014-07-27 21:25:24 +02:00
ca59546ace Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-27 21:01:06 +02:00
2330f363bd Fix for thrown EmptyChunkSection modification exception 2014-07-27 20:54:28 +02:00
042861b51f Merge pull request #1790 from RobertClarke/patch-1
Small typo fix on main language file
2014-07-27 18:40:04 +02:00
98f42a936e Small typo fix 2014-07-27 17:36:40 +01:00
6d77b0883e Fixed getTrace() on crash with xdebug 2014-07-27 17:31:39 +02:00
f53d513894 Merge pull request #1789 from PocketMine/CrashDump
Added Crash Dumps and automatic reporting
2014-07-27 15:26:36 +02:00
e6e15ceffa Fixed typo in crash text 2014-07-27 14:09:34 +02:00
9d75baf212 Added automatic reporting 2014-07-27 14:00:00 +02:00
7b45df680e Added time and plugin cause 2014-07-27 12:39:38 +02:00
f93d5339bc Use correct syntax 2014-07-26 17:06:22 +02:00
677071e7cb Merge pull request #1782 from Yosshi999/master
Updated Stick crafting recipe to give x4
2014-07-26 16:22:12 +02:00
4fa6fb0546 Updated Stick crafting recipe to give x4 2014-07-26 22:48:41 +09:00
0ca614a2c3 Merge pull request #1781 from Intyre/versionbump
Support for MCPE v0.9.5
2014-07-26 15:47:59 +02:00
bdfa6c0bc5 link to docs added to README 2014-07-26 15:08:48 +02:00
ccb7e86cf1 changed version and protocol to support v0.9.5 2014-07-26 15:07:32 +02:00
03a970e91f Merge pull request #1777 from Striker209MPE/patch-5
Fixed an error related to AIR constant
2014-07-25 07:51:27 -05:00
b3e9bb8fec Fixed an error related to AIR constant
A E_NOTICE error happened: "Use of undefined constant AIR - assumed 'AIR'"

should be fixed
2014-07-25 11:44:08 +02:00
48b99486b0 Merge pull request #1775 from Intyre/docs
docs for pocketmine-mp.readthedocs.org
2014-07-25 07:03:06 +02:00
6921e6f2aa docs for pocketmine-mp.readthedocs.org 2014-07-25 06:58:57 +02:00
987f54ba08 Edit syntax to confirm with rest of document. 2014-07-24 15:13:12 -05:00
09ef1f1721 Merge pull request #1772 from Striker209MPE/patch-3
Fixed error with useBreakOn parameters
2014-07-24 15:11:59 -05:00
3eae7a1875 Fixed error with useBreakOn parameters
A E_RECOVERABLE_ERROR error happened: "Argument 1 passed to pocketmine\block\Block::getDrops() must be an instance of pocketmine\item\Item, null given

AND

A E_RECOVERABLE_ERROR error happened: "Argument 1 passed to pocketmine\block\Generic::onBreak() must be an instance of pocketmine\item\Item, null given

are fixed
2014-07-24 22:10:33 +02:00
21587ae3eb Merge pull request #1760 from PEMapModder/patch-1
Allow player names contained in existing online player list.
2014-07-23 09:48:11 -05:00
e5337d8949 Make Fire check more efficent - by @Tschrock 2014-07-23 09:46:30 -05:00
c92a1ba7fe Release similar player name check from the beginning
For example, some would like to write `map` for `pemapmodder`, and this is what existed in amai beetroot when we used `SQLite3::query("SELECT ... ALIKE")`.
2014-07-23 22:33:45 +08:00
2066e92f84 Revert "Proper Fire ID checking. Fix #1756."
This reverts commit cd943f52a1.
2014-07-23 09:08:18 -05:00
cd943f52a1 Proper Fire ID checking. Fix #1756. 2014-07-23 08:58:26 -05:00
c3424beda9 Revert "Update Level.php"
This reverts commit da9dfabae4.
2014-07-22 13:59:23 -05:00
b6506d1db8 Revert "Corrected parameters for setBlock()"
This reverts commit 2f3a011ed3.
2014-07-22 13:59:16 -05:00
4cec3e7e37 Merge pull request #1749 from Falkirks/patch-1
Fixed fire issue
2014-07-22 13:29:12 -05:00
2f3a011ed3 Corrected parameters for setBlock() 2014-07-22 07:05:13 -07:00
da9dfabae4 Update Level.php 2014-07-21 18:15:54 -07:00
4c83e9bb56 Update Level.php 2014-07-21 20:04:58 -05:00
090d159766 Enabled built-in PHP 2014-07-22 09:46:47 +09:00
14d86339fc Fixed previous error. 2014-07-21 18:27:50 -05:00
ccf34a9db8 #1745 part 2! 2014-07-21 15:29:40 -05:00
97af1b6008 Fix #1745 2014-07-21 13:02:24 -05:00
16d33b01f4 Fix #1663 2014-07-21 10:51:30 -05:00
fa318ce706 Merge pull request #1736 from swagking47/patch-5
Fix unintentional typo in InventoryTransactionEvent.php.
2014-07-21 10:15:19 -05:00
accea03d52 Merge pull request #1741 from PEMapModder/patch-6
Added count(Enum)
2014-07-21 10:10:40 -05:00
adcdf650a3 Added count(Enum) 2014-07-21 19:25:20 +08:00
e8e825322b Update InventoryTransactionEvent.php 2014-07-20 15:28:53 -04:00
1b36b10520 Merge pull request #1729 from PEMapModder/patch-5
Fixed wrong doccomment for Vector3::add()
2014-07-19 10:32:16 +02:00
0d37e96678 Fixed wrong doccomment for Vector3::add()
Yes I know it was me who wrote it wrong.
2014-07-19 11:59:31 +08:00
2448405e3a Fixed rcon password being shown 2014-07-18 11:58:39 +02:00
2e773a32ff Removed crash() 2014-07-18 11:55:24 +02:00
d8cba4f045 Implemented new crash dumps 2014-07-18 11:54:11 +02:00
07c1ed1c36 Moved pthreads check before its usage 2014-07-18 10:49:38 +02:00
d6711125a9 Bumped MCPE version to v0.9.4 2014-07-18 10:44:14 +02:00
b8802edd6d Only allow one thread per property, fixes #1668 2014-07-17 21:22:48 +02:00
71bf984e9e Better fix for shared STONE constant, closes #1711 2014-07-17 21:20:15 +02:00
9c9d786194 Fix #1659 2014-07-16 13:07:26 -05:00
bd2cb4b851 Fixed #1614, possible solution for #1678 2014-07-15 13:17:29 +02:00
6e77901453 Fixed inventory being sent before spawning 2014-07-14 16:54:29 +02:00
ebe8a902e5 Fixed being killed on teleport 2014-07-14 15:55:16 +02:00
304524f6d8 Fixed crash on /stop 2014-07-14 14:41:19 +02:00
cb879977d2 Use Player::getDisplayName() on more commands 2014-07-14 14:12:03 +02:00
096e238242 Fixed #1628 invalid sender x,y,z on /spawnpoint, closes #1671 2014-07-14 14:07:43 +02:00
f2d5daffc0 Whoops, Markdown spacing issue 2014-07-14 20:23:46 +09:30
12275125d2 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-14 12:48:09 +02:00
3d3b6826e4 Merge pull request #1669 from sekjun9878/master
Android issues to the correct repo @PEMapModder
2014-07-14 20:18:20 +09:30
3a8adfe2b8 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-14 12:47:34 +02:00
14116b6730 Android issues to the correct repo @PEMapModder 2014-07-14 20:17:30 +09:30
241d3d72af Merge pull request #1664 from sekjun9878/master
Issue Tracking Guidelines
2014-07-14 12:47:11 +02:00
79e864f4f1 Added far-generated loaded chunk to garbage collection 2014-07-14 12:46:03 +02:00
7812a3c4fc Added Won't Fix and Invalid as per @shoghicp's suggestion. Renamed PR: RFC to PR: Contribution 2014-07-14 20:15:26 +09:30
dbe5e9b4e9 Remove informal language from Contributing Guidelines 2014-07-14 17:25:28 +09:30
d743888b8d Issue Tracking Guidelines 2014-07-14 17:11:25 +09:30
0db009b08f Improved chunk generation queue 2014-07-14 03:10:25 +02:00
7cdf5a73eb Bumped MCPE version to 0.9.1 2014-07-14 02:21:04 +02:00
6c442551f7 Fixed client crashing (temp.), fixed clients not spawning. (Fixes #1640 #1636 #1590 #1573) 2014-07-14 02:19:14 +02:00
eccd82ca4b Moved player attack filter from Living to Player 2014-07-13 19:04:00 +02:00
6fbfa1836f Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2014-07-13 22:04:41 +09:30
5dfb1fb9d5 Fix bug where a double quote would show when kick reason is not specified. 2014-07-13 22:03:54 +09:30
4a615f03b5 Merge pull request #1649 from PEMapModder/patch-2
Added doccomment for Vector3::add() and Vector3::subtract()
2014-07-13 12:26:46 +02:00
47503d84c2 Added doccomment for Vector3::add() and Vector3::subtract()
This is to avoid IDEs thinking that argument 1 for `Vector3::subtract()` must be an int. (But the fact is `Vector3` is OK too)
2014-07-13 13:43:09 +08:00
fdb7fa36b8 Fixed #1641 2014-07-13 01:10:16 +02:00
e29ddadd2f Fixed #1642 2014-07-13 01:04:10 +02:00
d2ed0aa9f0 Merge pull request #1634 from PocketMine/timings
Implemented Timings
2014-07-12 19:30:41 +02:00
a7944502cd Added small things 2014-07-12 19:27:51 +02:00
063d14ba63 Merge pull request #1638 from KnownUnown/master
Fix formality mistake
2014-07-12 18:42:11 +02:00
35ea9708a5 Fix formality mistake
Contractions such as "I've" should not be used in formal writing.
2014-07-12 11:36:03 -05:00
9a4ead54e3 Added more timings 2014-07-12 15:23:06 +02:00
0d55d5c653 Fixed typo 2014-07-12 14:36:22 +02:00
94bc817756 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-12 14:18:12 +02:00
52b0e8b1ee Updated RakLib, fixes random upload increase 2014-07-12 14:17:35 +02:00
9bdd294a66 Implemented global, tasks timings 2014-07-12 14:09:29 +02:00
0bfa9506d1 Updated API version to 1.1.0 (backwards-compatible) 2014-07-12 02:26:41 +02:00
67b0c4bc2e Added base timings 2014-07-12 02:26:06 +02:00
dd729ced68 Revert "Possible fix for #1628"
This reverts commit a6e22de6a3.
2014-07-11 10:21:58 -05:00
a6e22de6a3 Possible fix for #1628 2014-07-11 10:19:28 -05:00
7624eda7b1 Update damage sources for creative mode players 2014-07-11 16:24:04 +02:00
5e47dda0a8 Enable death through void, suicide 2014-07-11 09:18:15 -05:00
61043d2e0d Fix #1615
Players in creative cannot die from non-magic (plugin/console) causes.
2014-07-11 09:14:49 -05:00
3e882ef40d Revert "Fix #1615"
This reverts commit a8359f29a8.
2014-07-11 09:12:19 -05:00
a8359f29a8 Fix #1615
Players in creative cannot die from non-magic (plugin/console) causes.
2014-07-11 09:07:24 -05:00
167ee97569 Fix kick command broadcast message. 2014-07-11 22:14:57 +09:30
53214005cd Kick message reflects Vanila MCPC not Bukkit 2014-07-11 22:05:50 +09:30
6e74bb7faf Kick reason grammar 2014-07-11 21:52:57 +09:30
f60fdb5e61 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-07-11 12:47:19 +02:00
4bd2f3aea8 Use the world spawn by default for players, fixes #1616 2014-07-11 12:45:43 +02:00
dcba580115 Merge pull request #1626 from PEMapModder/patch-2
Fix #1622 /kick on unknown players crashes the server
2014-07-11 12:16:44 +02:00
63008c4ebb Fix #1622 2014-07-11 17:24:25 +08:00
c16f45ce39 Fixed unsigned fields being read as signed 2014-07-11 02:55:29 +02:00
f2fa13119a Added upload/download speed on title bar, referenced ChunkRequestTask 2014-07-11 02:23:40 +02:00
756a8fead6 Fixed #1604 2014-07-11 01:34:49 +02:00
7ed6ac2341 Fixed #1609 2014-07-11 01:18:37 +02:00
4a072b4163 Better chunk unload queues 2014-07-11 01:15:52 +02:00
91b2f81f3c Updated RakLib version 2014-07-11 00:53:48 +02:00
5c826cb9ab Fixed /list not showing the proper player count 2014-07-10 20:40:56 +02:00
20b0df4b57 Added deprecation warning on plugin events 2014-07-10 17:39:20 +02:00
1fab6bd589 Added settings.query-plugins setting 2014-07-10 17:24:12 +02:00
7dd4a843c6 Fixed #1598 spawning on a index-corrupted Anvil chunk 2014-07-10 16:52:59 +02:00
828f7f1590 Fall damage is now working 2014-07-10 16:16:11 +02:00
c9535162bd Added more damage sources 2014-07-10 14:02:56 +02:00
99c5ad789b Improved entity attack push 2014-07-10 13:29:29 +02:00
e6c510e7fd Fixed #1595 Undefined variable on QueryHandler 2014-07-10 13:15:24 +02:00
d3789d4fed Fixed /kick player name 2014-07-10 13:05:15 +02:00
8fbc63c14e Fixed /kill player name 2014-07-10 13:05:04 +02:00
4d0b184ca4 Fixed #1591, handle player disconnect and level change killing 2014-07-10 12:35:19 +02:00
589fde27c0 Reorder chunk unloading to leave chunks in memory for the GC time before removal 2014-07-10 01:32:18 +02:00
6cb55da9c7 Added correct save parameters to chunk unloading 2014-07-10 01:30:59 +02:00
0251ae93d8 Fixed #1578 Chunk garbage collection not marking chunks as unused 2014-07-10 01:17:51 +02:00
5b69f07a55 Tuned CPU usage on main lop and RakLib 2014-07-09 23:39:25 +02:00
9604907566 Fixed #1584 duplicated death messages 2014-07-09 20:25:40 +02:00
1f882f42d3 Save and restore entity health 2014-07-09 20:23:58 +02:00
981796fd4c Fixed #1583 not repeated Tasks getting repeated 2014-07-09 20:07:35 +02:00
3e53ecdfb3 Merge pull request #1585 from PEMapModder/master
Let plugin enable/disable events extend PluginEvent
2014-07-09 19:28:13 +02:00
cd324c3247 Let plugin enable/disable events extend PluginEvent 2014-07-10 00:40:16 +08:00
99d4ff5bdb Merge remote-tracking branch 'origin/master' 2014-07-09 18:43:33 +09:30
88bcaea292 Fixes #1570. Removed isValidPharFilename check as the function is very unreliable. 2014-07-09 18:42:57 +09:30
ff90b83a9f Merge pull request #1581 from PEMapModder/patch-1
Update cause of lava and fire damage
2014-07-09 16:38:12 +09:30
f3079f8444 Update cause of lava and fire damage 2014-07-09 14:40:50 +08:00
65523972c2 Implemented health, events, damage, motion push 2014-07-06 23:10:11 +02:00
25ecdcf6e2 Fixed physics BoundingBox 2014-07-06 12:59:41 +02:00
6b361389ad Fixed mirrored chunk sending 2014-07-06 12:36:23 +02:00
643a4c1ef5 Fixed motion, physics 2014-07-06 12:08:05 +02:00
0503adc08c Fixed PHP installation reading wrong php.ini 2014-07-06 02:40:13 +02:00
892119f791 Updated RakLib version, Query works again 2014-07-06 01:19:09 +02:00
1b6fcf7942 Added LevelLoadEvent 2014-07-06 00:07:42 +02:00
cbbdb42092 Added LevelUnloadEvent 2014-07-06 00:06:03 +02:00
81492acb0c Added LevelSaveEvent 2014-07-06 00:02:27 +02:00
6576c88a08 Added LevelInitEvent 2014-07-06 00:01:05 +02:00
637d9da5a6 Fixed worker pool AsyncTask storage 2014-07-05 22:02:14 +02:00
22552cdd72 Improved chunk sending, moved chunk encoding and compression to another thread 2014-07-05 20:41:44 +02:00
417cb94ea3 Use chunk unload queues in Level 2014-07-05 16:28:49 +02:00
4db97a007c Fixed typo on updater 2014-07-05 14:05:56 +02:00
519922b550 Improved chunk ticking 2014-07-05 14:05:39 +02:00
962847ffdf Merge pull request #1561 from PEMapModder/patch-1
Fix HandlerList.php wrong var name
2014-07-05 12:04:13 +02:00
b18783a0e7 Fix HandlerList.php wrong var name 2014-07-05 11:48:13 +08:00
5a8e6619e9 Fixed start.sh script 2014-07-04 01:07:40 +02:00
6b45c16a38 Added quotes to start.sh 2014-07-03 20:02:35 +02:00
8b2440ff96 Fixed ServerScheduler::addTask() period 2014-07-03 19:35:59 +02:00
32f67d7187 Updated build script 2014-07-03 13:52:48 +02:00
43635b501a Made logging better, plugin loggers can be attached by others 2014-07-02 23:33:29 +02:00
aa85993634 Made Server::getLogger() return a AttachableThreadedLogger 2014-07-02 23:23:33 +02:00
2f4fe4751c Merge pull request #1555 from PocketMine/LoggerAttachment
Implement LoggerAttachment (fixes #1547)
2014-07-02 23:13:22 +02:00
c8dd8f02eb Finished #1555 todo list 2014-07-02 23:11:39 +02:00
6c116678d7 Added autoloading of base namespace classes 2014-07-01 23:34:24 +02:00
75d2409a7c Added ThreadedLoggerAttachments 2014-07-01 20:50:51 +02:00
f7c23e89f0 Added move block while being teleported after spawning 2014-07-01 01:19:24 +02:00
f5a74a87e3 Updated composed packets 2014-07-01 01:11:09 +02:00
d4881260da Added check for registered alias command, useful when overriding 2014-06-30 21:14:00 +02:00
6d6059b61f Updated for new build 2014-06-30 21:07:27 +02:00
75bf3023a7 Swapped link order 2014-06-30 17:36:26 +02:00
f62cbcbcfa Removed -Wl,-Bstatic on Android 2014-06-30 17:32:27 +02:00
e5d8993d67 Changed library link order for Android 2014-06-30 17:29:19 +02:00
7bcc6d10b8 Enable assembly on cross-compile 2014-06-30 16:33:43 +02:00
308430c28d Disabled assembly on GMP 2014-06-30 16:03:40 +02:00
692a4fb57b Fixed reason on kick message 2014-06-30 01:17:55 +02:00
3fd18ca4af Updated installer PHP version 2014-06-30 00:53:48 +02:00
ca3fc33708 Added LDFLAGS to Android 2014-06-29 20:55:34 +02:00
e4bc9611f6 Compile GMP and mcrypt statically 2014-06-29 20:43:49 +02:00
3184a8e7d5 Added DNS lresolv MacOS 2014-06-29 18:24:09 +02:00
ff91113b81 Added flock_type patch for MacOS 2014-06-29 18:02:21 +02:00
f02fc664ba Removed ./buildconf for mcrypt (fails on MacOS) 2014-06-29 17:42:28 +02:00
e504421515 Added realloc env. variables for ARM to compile script 2014-06-29 17:33:31 +02:00
b80bae3352 Added realloc patch for ARM to compile script 2014-06-29 17:30:01 +02:00
311961f3aa Export compat. variables for malloc in compile script 2014-06-29 17:24:45 +02:00
1aa45500c0 Fixed mcrypt and malloc 2014-06-29 17:17:34 +02:00
58df00fa86 Fixed mcrypt having older config files 2014-06-29 17:10:20 +02:00
67baaf5308 Fixed GMP ABI 2014-06-29 17:04:22 +02:00
f20c862123 Fixed syntax error in compile script 2014-06-29 17:00:01 +02:00
a321aeca96 Compile fixes 2014-06-29 16:53:16 +02:00
487015d332 Updated to PHP 5.5.14, updated OpenSSL, updated cURL, added mcrypt and GMP to compile scripts 2014-06-29 16:28:18 +02:00
b064f1e71a Removed collision check crash on Slab 2014-06-28 02:38:04 +02:00
2ec0d86126 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-06-27 23:26:46 +02:00
cc36f8f997 Fixed kick messages 2014-06-27 23:26:35 +02:00
44f8541331 Merge pull request #1544 from Darunia18/patch-1
Update Explosion.php
2014-06-27 13:44:13 +02:00
87308d1c51 Update Explosion.php
Fixed bugs on lines 75 and 141.
2014-06-27 02:45:32 -04:00
84f9516f24 Merge pull request #1542 from MCMrARM/master
Fixed PlayerMetadataStore
2014-06-26 21:15:03 +02:00
fadf1a5d40 Fixed PlayerMetadataStore 2014-06-26 21:12:03 +02:00
401d7342dd Added nether reactor block to classes 2014-06-26 12:09:38 +02:00
7067c09228 Removed old code 2014-06-26 12:03:29 +02:00
3abec0a3c0 Modified Level::useBreakOn() to use events for creative block breaking 2014-06-26 12:03:02 +02:00
c2d760e6d9 Added RotateHeadPacket 2014-06-25 23:09:22 +02:00
de5e9df82b Fixes for chat formatting 2014-06-25 22:32:57 +02:00
b506ab349f Fixed TextFormat::toJSON() on nested formatting 2014-06-25 22:20:50 +02:00
e2f7cf61e3 Added TextFormat::toJSON() 2014-06-25 21:57:34 +02:00
03b1385f26 Fixed teleport command with a single target not teleporting correctly 2014-06-25 20:58:59 +02:00
2302a37311 Updated for build 9 2014-06-25 20:50:22 +02:00
9877271d70 Fixed kick messages 2014-06-25 20:50:16 +02:00
873e35f416 Fixed SendUsageTask 2014-06-25 13:06:44 +02:00
80aebf2932 Added AsyncTask::onCompletion() 2014-06-25 13:01:39 +02:00
f9d9d2b0e5 Updated for build 8 2014-06-25 02:21:25 +02:00
c8ee1da262 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-06-25 02:06:05 +02:00
79cc6ca559 Multiple fixes 2014-06-25 02:03:58 +02:00
a299b5f904 Update Furnace.php 2014-06-24 17:41:37 +02:00
fd9fdc30cb Allow changing gamemode without restarting the game (buggy) 2014-06-24 12:38:01 +02:00
ecbfff9b0f Added force-gamemode property 2014-06-24 12:18:51 +02:00
0e679139d2 Merge pull request #1532 from PEMapModder/patch-1
Fixed undefined variable $name notice for /pardon
2014-06-24 11:49:22 +02:00
f30922f439 Fixed undefined variable $name notice for /pardon 2014-06-24 17:48:32 +08:00
c775c3905d Added ServerCommandEvent::getSender() 2014-06-24 11:25:51 +02:00
a4593d4668 Fixed #1531 2014-06-23 23:24:27 +02:00
df68853c76 Fixed #1530 Container tiles not getting imported right when they are empty 2014-06-23 22:40:14 +02:00
88157d6e99 Added workaround for #1527 2014-06-23 22:35:02 +02:00
22533458ed Updated for MCPE 0.9.0 build 7 2014-06-23 21:50:07 +02:00
38a958ed08 Fixed #1526 $player->getPosition() returns a WeakRef error 2014-06-23 16:31:22 +02:00
396a3ff225 Limited block change packets to players using that chunk 2014-06-23 16:09:51 +02:00
bcb401c0c3 Added yaw/pitch on spawn 2014-06-23 16:07:59 +02:00
4b3addb8a0 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-06-23 15:26:51 +02:00
7cfeeae413 Send held item when changed 2014-06-23 15:26:20 +02:00
31a7410acd Fixed players and entities getting despawned 2014-06-23 15:25:44 +02:00
6c8f189499 Merge pull request #1525 from PEMapModder/patch-1
Fix /plugins crash
2014-06-23 14:00:26 +02:00
2e50fbbda4 Fix /plugins crash 2014-06-23 19:27:27 +08:00
fd4fc4ff94 Fixed Entity & Player loaded chunk indexes 2014-06-23 11:57:47 +02:00
496c004efc Changed default view-distance 2014-06-22 23:25:43 +02:00
6f9becdbb3 Added Empty chunk detection 2014-06-22 22:29:46 +02:00
36cdfd969d Fixed #799 Added Grass growth algorithm 2014-06-22 22:26:36 +02:00
0be2bd911f Fixed block updates not getting broadcasted 2014-06-22 21:56:58 +02:00
0e36107878 Fixed update ticks 2014-06-22 21:32:49 +02:00
279a438ae6 Fixed spawning of Tile entities via chunk packets 2014-06-22 18:05:42 +02:00
0d5eb149ab Fixed Level not saving chunks on auto save 2014-06-22 16:20:00 +02:00
557618c87d Fixed Level not saving chunks on unload 2014-06-22 16:15:37 +02:00
e0dda934ec Fixed Anvil region indexes in setChunk() 2014-06-22 16:15:23 +02:00
21f764590b Changed chunk-sending.per-second to chunk-sending.per-tick 2014-06-22 15:46:42 +02:00
bf49cafeae Added settings.async-workers to tune the amount of AsyncTask workers 2014-06-22 12:55:08 +02:00
7f795bc041 Fixed #1501 executing AsyncTasks blocks other threads 2014-06-22 12:50:24 +02:00
e381313747 New player chunk load queues with ACK notification 2014-06-21 19:41:06 +02:00
be0a31697a Fixed Double Chest inventory holder 2014-06-21 19:16:33 +02:00
14c558163e Updated languages 2014-06-21 18:21:16 +02:00
57437d3a06 Updated for MCPE 0.9.0 build 6 2014-06-19 17:26:03 +02:00
a0ce4b1d01 Updated Sign crafting recipe to give x3 2014-06-19 17:25:34 +02:00
a0ac660d57 Throw exception when a plugin tries to change the cancel event of a non-Cancellable event 2014-06-18 19:36:32 +02:00
825656feed Fixed installer language strings, bumped MCPE build to 5 (already compatible) 2014-06-18 19:23:14 +02:00
89a90c00fd Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-06-18 18:29:24 +02:00
83081456f2 Merge pull request #1508 from LegendOfMCPE/master
Fixed Explosion.php WeakRef issue
2014-06-18 18:28:32 +02:00
20e419a9c4 Fixed Explosion.php WeakRef issue 2014-06-18 11:42:41 +08:00
dda57f7b0f Signs can be placed again. TODO: spawn tile entities after chunk has been received and ACKed 2014-06-17 19:48:14 +02:00
85007a9dfe Fixed NBT compression, Anvil generated worlds are readable by Minecraft and other tools 2014-06-17 19:32:09 +02:00
f073a5b837 Fixed a few things 2014-06-17 18:46:16 +02:00
9e8f015dc0 Changed commands to use CommandSender::getServer() 2014-06-17 18:41:10 +02:00
f14fecbb5f Added /time command 2014-06-17 18:36:39 +02:00
b27637c926 Fixed default kick message 2014-06-17 17:27:17 +02:00
552c934486 Merge pull request #1506 from PEMapModder/master
Multiple permissions checked in Server::getInstance()
2014-06-17 16:15:39 +02:00
f202c9902a Multiple permissions checked in Server::getInstance()
This is done like the one in `Command::testPermissionSilent()`, where permissions are connected via semicolons (`;`) and they are checked with `OR`, where the player must have at least one permission to read.
2014-06-17 22:14:15 +08:00
3bd33a129f Added Player::getRemoveFormat() and Player::setRemoveFormat(bool) to choose showing colors in chat and nametags 2014-06-17 15:54:06 +02:00
79bc42c995 Added Player::getNameTag() and Player::setNameTag($name) 2014-06-17 15:28:57 +02:00
032710a2de Added integrated command aliases 2014-06-17 15:21:06 +02:00
e8cc52f99e Added chunk-sending.compression-level property 2014-06-17 14:34:14 +02:00
266b78aa31 Fixed warning on TickScheduler thread 2014-06-16 23:20:21 +02:00
8a89aee75d Added method to get info from the AutoUpdater 2014-06-16 23:20:07 +02:00
169c55443a Fixed #1213 2014-06-16 23:00:54 +02:00
77e914238c Fixed updater 2014-06-16 20:17:32 +02:00
73b9b2491f Added custom settings, update notification 2014-06-16 19:34:47 +02:00
89c61bb05e Fixed #1500 blocks cannot be placed in creative mode 2014-06-16 17:01:34 +02:00
6983ddf509 Added new implemented blocks to Creative menu 2014-06-16 16:41:49 +02:00
8bc3ff5726 Added Emerald ore, Emerald, Emerald block 2014-06-16 16:24:09 +02:00
b4e502be13 Added Diorite, Granite, Andesite, and polished versions 2014-06-16 16:16:21 +02:00
778ec96d72 Added Hardened Clay and Stained Clay 2014-06-16 16:02:01 +02:00
28926832df Added new Wood slabs, stairs, crafing recipes 2014-06-16 15:46:45 +02:00
b3820bedbc Added Acacia wood and Dark Oak wood 2014-06-16 15:30:43 +02:00
6722540bdc Added Red sand 2014-06-16 15:25:30 +02:00
2d5e98b6a3 Added new Saplings 2014-06-16 15:23:40 +02:00
bbb69429f3 Fixed setting biome color 2014-06-16 03:32:55 +02:00
e47198deaf Fixed Level methods 2014-06-16 03:14:18 +02:00
36ddbc6cb4 Fixed setBiomeColor() bug 2014-06-16 01:20:53 +02:00
a371890962 Fixed Chest and Furnace placing, Furnace open 2014-06-16 00:30:51 +02:00
e1c0976927 Fixed block placing in creative mode 2014-06-16 00:19:46 +02:00
40bf7fd22a Fixed player being kicked on death 2014-06-16 00:01:09 +02:00
214de28808 Player join message will be only shown if not empty (modified by plugins) 2014-06-15 23:53:31 +02:00
530b81674b Updated RakLib, improved network stream 2014-06-15 23:39:05 +02:00
e6224be46f Faster generation, ticks catch up when slower 2014-06-15 16:54:28 +02:00
ed5325c069 Fixed setting chunks on non-loaded regions 2014-06-15 14:50:49 +02:00
a5e78d775b Temp. fixed /status 2014-06-15 00:23:17 +02:00
c4673addf7 Added server-side join message (removed from client-side MCPE) 2014-06-15 00:14:28 +02:00
cb1c4da4ea Fixed chunk unload on level change 2014-06-15 00:07:21 +02:00
6f36e9af24 Fixed chunk unloading on same level 2014-06-15 00:03:35 +02:00
6977833b1a Fixed thread generator crashing, added thread generator garbage collector, fixed generation queues 2014-06-14 23:59:31 +02:00
30318569e1 Fixed player spawnpoint not being restored 2014-06-14 22:15:07 +02:00
429f7ffe8d Fixed SimpleChunk metadata 2014-06-14 22:11:19 +02:00
4354d76cae Fully fixed metadata sending 2014-06-14 21:44:02 +02:00
f3e6c726b0 Added BlockMetadataStore to Level and Block 2014-06-14 20:06:42 +02:00
694ccf2bc5 Fixed /reload 2014-06-14 18:46:40 +02:00
392f0110bb Updated build number 2014-06-13 23:26:52 +02:00
b0775e3e0c Fixed EntityMoveEvent cancellation for Player 2014-06-13 21:59:10 +02:00
ab2fb24fe5 Fixed PluginEvent 2014-06-13 20:15:53 +02:00
cbaeec54ff Added biomeIds and biomeColors to Anvil format 2014-06-13 20:04:07 +02:00
20759dcf07 Fixed block data network sending (Anvil::getBlockDataColumn() 2014-06-13 19:10:12 +02:00
189accc0d6 Fixed furnace processing bug 2014-06-13 18:45:53 +02:00
4e075987ab Merge pull request #1487 from PocketMine/master
Fixed FurnaceInventory crash
2014-06-12 17:53:55 +02:00
303c947d2a Fixed FurnaceInventory crash 2014-06-12 17:43:46 +02:00
b6ef52e89c Updated Normal generator 2014-06-11 00:29:01 +02:00
109b6dbf44 Updated to v0.9.0 build 2, now using Anvil worlds 2014-06-11 00:06:46 +02:00
fa50cbf4b3 Working Threaded Generation 2014-06-10 20:45:09 +02:00
392eb74901 Merge branch 'Level-Rewrite' into 0.9.0 2014-06-10 16:08:34 +02:00
5f163133ee Added grass color test 2014-06-10 15:24:33 +02:00
9be231fbca Made levels infinite 2014-06-10 15:05:59 +02:00
b6caad289d Faster chunk loading 2014-06-10 11:27:30 +02:00
3fbc411e17 0.9.0 clients can join 2014-06-09 23:47:09 +02:00
fb46faa320 Updated protocol changes from MCPE-6865 2014-06-09 15:19:24 +02:00
c180534f21 Bump protocol version 2014-06-09 11:52:12 +02:00
926e7ac0b1 Disabled Travis CI 2014-06-09 11:49:52 +02:00
409efcbb03 Updated raklib 2014-06-09 11:43:20 +02:00
115b4cf4ac Updated Levels :D 2014-06-09 11:35:52 +02:00
920e2a7c7e Merge branch 'Level-Rewrite' 2014-06-07 23:33:49 +02:00
2566f2c4cb Worked on chunk loading 2014-06-07 22:29:45 +02:00
d8f9f9231f Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-06-07 04:22:07 +02:00
93b236811a Updated RakLib 2014-06-07 04:22:00 +02:00
e4c7564e3e Delete mainLogger.php 2014-06-07 04:20:03 +02:00
41fe4a527a Update MainLogger.php 2014-06-07 04:19:19 +02:00
1c20fcc8c7 Fix for log file 2014-06-06 02:23:14 +02:00
5355a95d1d Fix for player->CID 2014-06-06 02:22:53 +02:00
e37b731e88 Fixed player block breaking 2014-06-05 18:27:50 +02:00
370a1a0041 Fixed seed generation 2014-06-05 18:13:33 +02:00
310ebb9817 Fixed timeout 2014-06-05 18:04:00 +02:00
fdc2edc421 Updated to new RakLib 2014-06-05 17:52:42 +02:00
c434961dfc Some fixes 2014-06-05 01:44:16 +02:00
ddf3e149c9 Merge branch 'Core-Rewrite'
Conflicts:
	src/API/PlayerAPI.php
	src/build/compile.sh
	src/build/jenkins.sh
2014-06-05 01:39:43 +02:00
3c4e35ff8d Updated default PHP version 2014-06-05 01:23:24 +02:00
2674902eaa Preparing to merge 2014-06-05 01:22:04 +02:00
596f4ddb0e Added lots of new events, enabled old features 2014-06-05 01:05:52 +02:00
2b73da5412 Added Animation 2014-06-05 00:41:24 +02:00
9884fe6473 Updated RakLib 2014-06-05 00:31:36 +02:00
2877f026ec Added item drop 2014-06-05 00:31:16 +02:00
99a0117a33 Implemented RakLib 2014-06-04 20:29:25 +02:00
cce9499a61 Merge branch 'Core-Rewrite' of github.com:PocketMine/PocketMine-MP into Core-Rewrite 2014-06-04 17:09:53 +02:00
905d572d42 Added RakLib library 2014-06-04 17:08:09 +02:00
e4cdfdf6e9 Update Logger 2014-06-04 02:15:29 +02:00
ea9e0b917b Moved $EXTRA_FLAGS 2014-06-04 02:07:38 +02:00
a76f56d0a9 Update compile.sh 2014-06-04 02:04:18 +02:00
ee0ab63202 Updated PHP version 2014-06-04 02:02:15 +02:00
2f6f851715 Updated PHP version 2014-06-04 02:00:48 +02:00
97f3959e83 Check for class loaded on SplClassLoader 2014-06-03 19:24:34 +02:00
ff48b0be53 Fixed Loggers 2014-06-02 22:59:56 +02:00
24d95fb7fd Added \ThreadedLogger abstract class 2014-06-02 14:47:38 +02:00
a17d847a82 Moved Logger interface to root 2014-06-02 14:41:43 +02:00
857c79cc05 Update pointer to track master 2014-06-01 02:24:26 +02:00
35551246d2 Linked PocketMine-MP GUI submodule 2014-06-01 02:18:15 +02:00
5117bbf7f4 Fixed ContainerSetContentPacket being spammed before join 2014-05-30 01:26:57 +02:00
0925898d8d Temporal fix for extra commit spam due to bug 2014-05-30 00:31:35 +02:00
325bcc367d Fixed motion update spam 2014-05-29 23:07:48 +02:00
97a687c03a Replaced PHPDoc on Config 2014-05-29 20:19:15 +02:00
c6632da159 Removed debug code from player data saving 2014-05-29 18:48:38 +02:00
96445c4613 Fixed item in hand in creative mode, player files are now readable by Minecraft PC 2014-05-29 18:45:49 +02:00
a45f8782b1 Fixed collision against other entities 2014-05-29 18:03:17 +02:00
61ce7f11d6 Implemented bounding box limits for item placing 2014-05-29 17:04:37 +02:00
49370c21d1 Removed locks from MainLogger 2014-05-29 04:11:20 +02:00
441b47e744 Fixed Logger getting paths relative to soruce code 2014-05-29 04:04:00 +02:00
8d40f843cf MainLogger can now have debug level disabled 2014-05-29 00:08:02 +02:00
7bd6f2ed91 Added Logger interface, threaded MainLogger and updated PluginLogger 2014-05-28 23:46:56 +02:00
9df56295f6 Removed debug message for Transactions 2014-05-28 19:44:50 +02:00
dafa4f1b1c Fixed null Items with id < 256 not working correctly 2014-05-28 17:58:09 +02:00
f66560ccd4 Update ContainerInventory on Transaction refused 2014-05-28 17:11:06 +02:00
f795a3f565 Fixed DroppedItems not being restored after save 2014-05-28 16:09:57 +02:00
130b2c4910 Fixed Chests and Furnaces not droping their contents when broken 2014-05-28 15:34:34 +02:00
c778e0467e Fixed touching items with an empty hand 2014-05-28 15:22:25 +02:00
70e340086d Fixed Inventory::addItem() not adding items properly 2014-05-28 15:08:07 +02:00
b9ec63f016 Fixed getting Entities by area 2014-05-28 14:41:09 +02:00
9aed430fda Added Furnace recipes 2014-05-28 00:29:36 +02:00
d5f160ea3d Added Stonecutter recipes 2014-05-27 23:59:59 +02:00
3ac60f9860 Added Normal and Big crafting recipes, fixed CraftingTransactionGroup count 2014-05-27 23:26:07 +02:00
6746987ce5 Added CraftItemEvent, Crafting system now uses Transactions 2014-05-27 17:49:22 +02:00
3fc1be1262 Fixed crash when removing Tiles 2014-05-27 16:15:23 +02:00
96b1831229 Fixed Tile entities not being read correctly 2014-05-27 16:02:03 +02:00
a669797ccb Fixed breaking Spawnable tiles and cancelling it 2014-05-27 12:12:45 +02:00
5e97da2e11 Added InventoryTransactionEvent 2014-05-27 01:56:25 +02:00
d92c5332da Added InventoryOpenEvent and InventoryPickupItemEvent 2014-05-27 01:44:56 +02:00
e1ccd7f9ea Added InventoryCloseEvent 2014-05-27 01:30:24 +02:00
6fcd5322d0 Implemented Transactions 2014-05-27 01:20:18 +02:00
160c633c08 Updated trigger_error to Exceptions, fixed bug in Plugin task deletion 2014-05-26 12:22:28 +02:00
ffa3e8a0aa Fixes for Chest & Furnace 2014-05-26 10:46:30 +02:00
274f972b58 Items can be picked up 2014-05-25 21:57:58 +02:00
03d7127e33 Finally, physics 2014-05-25 18:14:01 +02:00
933a28537b Fixed giving large amount of items, updated player inventory to correct size 2014-05-25 16:26:46 +02:00
4f2856dc09 Added base physics 2014-05-25 12:31:00 +02:00
ec055fd8d1 Items spawn, Tiles spawn, both are saved, blocks drop 2014-05-24 17:25:37 +02:00
f2dc9cdff7 Removed _ split from SplClassLoader 2014-05-24 17:25:02 +02:00
d8ea2e744f Added methods to add/remove Entities/Tiles from Levels 2014-05-24 13:49:58 +02:00
f9353a0ecd Fixed Events being called with reversed priority 2014-05-24 13:40:05 +02:00
abff932d8f Moved Entity::get() to Level::getEntity() and removed Entity::getAll() 2014-05-24 13:30:37 +02:00
ef6ca9d2cd Added Tile::saveNBT(), moved Player::broadcastPacket() to Server 2014-05-24 13:21:55 +02:00
1fd7e0431b Added CustomInventory, StoneCutter inventory type, network IDs, fixed viewer list bugs 2014-05-24 01:30:58 +02:00
f9103772c3 It works. (Inventory, windows, block placement) 2014-05-24 00:32:29 +02:00
5460ccf41c Server can be joined, again! (fixed weak references and blocks) 2014-05-23 23:12:15 +02:00
a2b3a4bb90 Removed not valid TimeCommand 2014-05-23 22:46:08 +02:00
683ab8d2cd Fixed invalid metadata and updated weak references on PluginManager 2014-05-23 22:30:37 +02:00
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
27e82ea60a Updated Inventory classes 2014-05-22 23:13:46 +02:00
48af130269 Fixed things 2014-05-22 20:48:17 +02:00
98e9b5594c Fixed slots overfilling (like on Armor slots) 2014-05-22 20:32:56 +02:00
9b950a98c7 Added BaseInventory 2014-05-22 20:25:58 +02:00
34c2510f0f Allow setting null damage on items 2014-05-22 19:33:10 +02:00
6cbd39de9b Added Inventory interfaces and types, updated long array() to [] 2014-05-22 18:59:16 +02:00
0be679c9d5 Updated method names: getMetadata() & setMetadata() to getDamage() & setDamage() on Block and Item classes 2014-05-22 18:37:28 +02:00
387677e957 Level rewrite middle step 2014-05-22 17:53:56 +02:00
c1546aac9c Updated Position to use Weak / strong references for Level objects 2014-05-22 04:14:06 +02:00
6328834681 Make PluginBase::getResource() return a file pointer instead of the file contents 2014-05-19 20:14:31 +02:00
99818a26f5 Added object metadata for Plugins, use WeakMap on perms 2014-05-19 20:07:27 +02:00
88f9347093 Updated PHP to 5.5.12 (added to jenkins.sh) 2014-05-19 18:11:38 +02:00
1fc475860d Updated PHP to 5.5.12, uopz to 2.0.4 2014-05-19 18:10:33 +02:00
e45bcf06fe Updated pthreads to 2.0.7, fixed WeakRef 2014-05-19 18:04:42 +02:00
29caf1363f Merge branch 'Core-Rewrite' of github.com:PocketMine/PocketMine-MP into Core-Rewrite 2014-05-19 17:34:30 +02:00
c15f05622e Added WeakRef as default extension 2014-05-19 17:33:04 +02:00
b9502b9c2c Merge pull request #1453 from onebone/Core-Rewrite
Added time command
2014-05-18 15:59:17 +02:00
3e575ad505 Added time command 2014-05-18 22:56:01 +09:00
f668a41f57 Merge pull request #1440 from PEMapModder/cr-br-6
Fixed a typo at PermissibleBase
2014-05-17 21:38:36 +02:00
dcd4af9dd0 Merge pull request #1451 from wiezz/patch-1
Little fix for generateLevel()
2014-05-17 21:38:23 +02:00
d01a82cf9f Little fix for generateLevel()
Check if $generator is the default value NULL instead of false
2014-05-17 21:34:27 +02:00
92169f4288 Fixed a typo
(Is this really a typo? But it seems so...)
2014-05-12 19:23:37 +08:00
c455c84d15 Update installer.sh 2014-05-04 17:59:30 +02:00
15c5dacab3 Removed old PluginManager::getInstance() 2014-04-28 01:42:20 +02:00
1001a47cd6 Typo fix to crash dump 2014-04-27 15:17:52 +09:30
46464eb504 Update installer.sh 2014-04-20 19:16:51 +02:00
1fd773486e Reverted to 03d46020ec 2014-04-20 18:11:13 +02:00
50c0bf424a Revert 25b98a5480 2014-04-21 00:50:20 +09:30
9644088b5d Added username sharding for player yaml saves. 2014-04-21 00:43:39 +09:30
25b98a5480 Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2014-04-21 00:13:43 +09:30
3729c5b603 Faster aligned read/write 2014-04-14 12:34:57 +02:00
59392ac4e9 Fix small spelling typo. 2014-04-12 19:06:55 +09:30
346d267e4e Merge pull request #1387 from PEMapModder/patch-1
pocketmine\command\Command implements the __toString() magic method
2014-04-12 18:59:18 +09:30
e9aba34e6b Added /setworldspawn 2014-04-10 18:50:41 +02:00
1dc3d42b78 Working Anvil region format parsing 2014-04-10 16:52:53 +02:00
f23a05d42e Anvil garbage collector won't run if not needed 2014-04-10 06:02:33 +02:00
a1a1f1b8e4 Added Anvil in-place garbage cleaner 2014-04-10 05:58:31 +02:00
aa1de79337 New Chunk objects / structure, Anvil region loader [WiP] 2014-04-10 05:05:36 +02:00
abccfeac37 Updated Vector-related classes 2014-04-10 05:04:58 +02:00
9859333aae Edited tests since now everything goes faster 2014-04-09 04:16:17 +02:00
5ca4f50703 removed C extension by default 2014-04-09 04:10:12 +02:00
96e36dbcb3 better Binary 2014-04-09 04:09:39 +02:00
8da3aced07 Lowered microtime() 2014-04-09 03:17:47 +02:00
ab84be7f6a Added microtime() operation to benchmark 2014-04-09 03:16:48 +02:00
88fb84edc5 Lowered file operations 2014-04-09 03:05:25 +02:00
5e8ea04e52 Fixed tests and one-byte packet reading 2014-04-09 03:00:33 +02:00
3136c23795 Added small benchmark 2014-04-09 02:37:37 +02:00
366fa0e05d fixed version 2014-04-09 01:48:35 +02:00
42b34d55e0 fixed... 2014-04-09 01:41:30 +02:00
5070866fe0 Updated extension to 0.0.3 2014-04-09 01:12:56 +02:00
db15ae49a1 Updated to extension 0.0.2 2014-04-09 00:56:36 +02:00
71737c3e53 Added PocketMine native extension version 0.0.1 2014-04-08 22:08:35 +02:00
9fcbe2698a Modified compile flags 2014-04-08 17:42:54 +02:00
da5853083c crc fake random generator 2014-04-08 16:35:45 +02:00
1d40399b9c hacky things D: 2014-04-08 16:22:52 +02:00
d6f4e77b6c Another patch, added INT32_MASK 2014-04-08 16:05:27 +02:00
cb32a95e60 Why, PHP? 2014-04-08 15:52:34 +02:00
731fbbc8d1 Another 64-bit patch 2014-04-08 15:50:13 +02:00
29ab53a46f Patched... again 2014-04-08 15:46:32 +02:00
4c973ce625 Patched random generator on 64-bit 2014-04-08 15:43:13 +02:00
9d8e6d5f8c New Random generator 2014-04-08 15:41:32 +02:00
5abe5bd43d replaced binary with hexadecimal 2014-04-08 13:02:13 +02:00
89138ae4ce Added a few things 2014-04-08 13:00:52 +02:00
8d14c98da9 Fixed binary reading/writing of longs 2014-04-08 13:00:50 +02:00
669401afd4 Updated PHP extension version 2014-04-08 11:55:36 +02:00
8dbdffa517 Update compile.sh 2014-04-08 02:28:12 +02:00
efeaadf0ba Added PHP C extension version 2014-04-08 02:23:43 +02:00
999990756c Fixed invalid string type in writeMetadata() 2014-04-07 16:24:58 +02:00
c0de004472 Moved binary methods from Utils to Binary 2014-04-07 13:52:01 +02:00
62313d4a84 Update Command.php 2014-04-07 16:38:37 +08:00
ac02185ad0 Fixed start.sh on linux :P 2014-04-07 04:10:26 +02:00
d83b5c3a60 Oops 2014-04-07 03:25:31 +02:00
e405c2bf1c Merge branch 'Core-Rewrite' of github.com:PocketMine/PocketMine-MP into Core-Rewrite 2014-04-07 03:22:07 +02:00
039151c136 Fixed compile.sh :P 2014-04-07 03:21:58 +02:00
40b290739e Fixed compile.sh perms 2014-04-06 21:18:39 -04:00
93c82d5267 Added PocketMine C PHP extension 2014-04-07 03:14:55 +02:00
0000000bab Testing things ;) 2014-04-06 20:07:11 +02:00
4098252ec7 Use CommandExecutor by default on plugins :P 2014-04-05 21:44:29 +02:00
711519d4ff Fixed uopz on installer 2014-04-05 18:50:31 +02:00
0b9896ff5e Updated to PHP 5.5.11 on the installer 2014-04-05 18:43:42 +02:00
41c4c15549 Updated compiler to PHP 5.5.11 2014-04-05 16:33:41 +02:00
1a8cbdd6c7 Fixed players being able to add color codes in names and be shown on console (on kick) 2014-04-05 14:02:35 +02:00
7be9ea68c7 Added Config::getPath() and Config::setPath() 2014-04-05 10:36:18 +02:00
e390374c74 Updated README.md 2014-04-05 00:58:20 +02:00
6d58f32c91 Added PluginLogger 2014-04-05 00:20:09 +02:00
0d91be62cf Improved plugin loading 2014-04-04 22:11:31 +02:00
adcbc67a71 Updated installer to use new Raspberry Pi PHP builds 2014-04-04 15:59:18 +02:00
ddf59b8bee Fixed MySQLnd cross-compilation 2014-04-04 15:50:13 +02:00
5c8747cb87 Set -j on Linux builds to 2 2014-04-04 15:41:46 +02:00
5065fce415 Moved -ftree-parallelize-loops to x86 and x86_64 optimizations 2014-04-04 15:06:09 +02:00
e63f8b93a7 Updated cURL 2014-04-04 03:56:02 +02:00
848b4bc113 Disabled temporaly uopz on compile script 2014-04-04 03:09:24 +02:00
648b23d08f Get correct Phar path if not specified 2014-04-04 02:53:41 +02:00
0f0b866788 Hmm, typo 2014-04-04 02:01:42 +02:00
c6f189f93f Added ability to disallow auto-kick of logged in players without using external properties, and using the event system 2014-04-04 01:59:58 +02:00
076bf2f2fe Added /spawnpoint message 2014-04-04 01:54:38 +02:00
fb6cd22c83 Fixed /tp 2014-04-04 01:52:56 +02:00
327d183bed Disallow duplicate usernames and block new player 2014-04-03 18:14:36 -05:00
7a163f9ea5 Added option to not kick players on duplicate names 2014-04-03 18:06:10 -05:00
0a7d9f1c87 Enabled use of /tp <source> <target> 2014-04-03 18:04:26 -05:00
08c9321a55 Fix error on tapping block with air in hand 2014-04-03 16:40:16 -05:00
cbf1f7a2e8 Fix /spawnpoint from console with no coordinate crash 2014-04-03 16:37:00 -05:00
85f7cdb123 Temporarily fix placing blocks near water crash 2014-04-03 16:34:02 -05:00
d3a912b2ef Added jenkins branch 2014-04-03 22:28:28 +02:00
5173781725 Modified jenkins script 2014-04-03 20:36:15 +02:00
ab1fbae2f2 Added dependency search on loaded plugins 2014-04-03 20:06:18 +02:00
febc6af323 Added uopz doc stub 2014-04-03 17:23:49 +02:00
d972d38b41 Added uopz extension (for monkey patching) 2014-04-03 16:25:42 +02:00
80f9093875 Added /reload command (does not reload source code) 2014-04-03 15:49:00 +02:00
ee6dc989ce Added class not found exception to SplClassLoader 2014-04-03 14:01:44 +02:00
5da68059ee Added file_exists check to SplClassLoader 2014-04-03 13:59:26 +02:00
5052e58bd0 Added /status memory 2014-04-03 13:22:04 +02:00
2ad9e1fe29 Added /status title 2014-04-03 13:19:34 +02:00
908210969e Added permissions for /status 2014-04-03 13:17:10 +02:00
0865381881 Moved /status into debug.commands 2014-04-03 13:16:15 +02:00
b50d58e46f Merge branch 'Core-Rewrite' of github.com:PocketMine/PocketMine-MP into Core-Rewrite 2014-04-03 13:12:30 +02:00
4841e105d3 Added debug.level 2014-04-03 13:12:15 +02:00
6c938944e6 Merge pull request #1376 from williamtdr/Core-Rewrite
Re-enable support for debug information with /status
2014-04-03 13:11:13 +02:00
04917ecd5a Added correct PluginIdentifiableCommand 2014-04-03 13:08:11 +02:00
3d80362560 Re-enable support for SIGTERM for clean exit 2014-04-02 21:24:49 -05:00
48f2927e08 Re-enable support for debug information with /status 2014-04-02 21:14:22 -05:00
27fcf0286e Fixed terminal colors 2014-04-03 04:10:20 +02:00
2ab1997f21 v1.5.0 added /extractplugin 2014-04-03 03:38:16 +02:00
61192b172b Removed FolderPluginLoader, allow loading of plugins by other loaders 2014-04-03 02:34:57 +02:00
f71f10da0b Added entry on .gitignore for Netbeans 2014-04-03 01:14:59 +02:00
a2536ed308 Fixed Server::isLevelgenerated() 2014-04-03 00:35:38 +02:00
83eb032393 Fixed plugin resources 2014-04-02 23:48:00 +02:00
36027f1073 Removed TimeAPI 2014-04-02 20:29:38 +02:00
95628227b0 Removed ServerOld, ServerAPI 2014-04-02 20:27:34 +02:00
0f42cd9243 Added Asynchronous tasks, usage sending 2014-04-02 20:20:14 +02:00
11356b68ba Added RCON 2014-04-02 19:33:49 +02:00
379b70eca7 Removed PlayerAPI 2014-04-02 19:07:29 +02:00
c81266d1da Added /tp 2014-04-02 19:04:07 +02:00
8c4afcd21a Added /spawnpoint 2014-04-02 18:40:24 +02:00
5cadc665d1 Added /kill, base entity health methods 2014-04-02 18:27:49 +02:00
bec642310a Removed BlockAPI 2014-04-02 06:07:21 +02:00
df3e456162 Added /give, /gamemode 2014-04-02 05:59:26 +02:00
7cd29f0fcf Added block updates, correct block placing 2014-04-02 05:36:45 +02:00
a4630372fa Added /save-on, /save-off, /save-all 2014-04-02 04:37:58 +02:00
9a5ffbe56c Added Tool for Items, new items 2014-04-02 04:26:53 +02:00
ee23b42e23 Added Spawn protection, including item usage, added /whitelist 2014-04-02 03:37:51 +02:00
502c27273d Moved Level methods to Server 2014-04-02 02:58:20 +02:00
5865f17c75 Faster plugin filter loading 2014-04-01 21:57:32 +02:00
7e9304a0c9 Formatting 2014-04-01 19:48:28 +02:00
b4cc3bbd43 Added /op, /deop, /kick, OfflinePlayer, moved player list to Server instead of static Player 2014-04-01 19:46:48 +02:00
e60ea2eb15 Fixed event names 2014-04-01 13:13:43 +02:00
a38d300616 Updated PluginBase::getResources() for Phar plugins 2014-04-01 12:18:27 +02:00
e3ee317924 Fixed detection 2014-04-01 12:09:18 +02:00
=
c688039047 Removed ghost dirs 2014-04-01 05:13:36 +02:00
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00
05a42712bf Added non-packaged plugins & pocketmine warnings 2014-04-01 04:59:44 +02:00
207c2c4aba Fixed namespaces paths 2014-04-01 04:47:04 +02:00
3605bc36c5 Fixed PluginManager::parseYamlCommands() 2014-04-01 02:12:05 +02:00
9cae532d7e Remove compile script DEBUG trap on php.ini generation 2014-04-01 01:47:28 +02:00
e8477fec53 Added /difficulty, removed old API files 2014-04-01 01:37:43 +02:00
760695e4bc Added Phar plugins 2014-03-31 23:49:43 +02:00
e8c4507ac6 Re-added kill 2014-03-31 22:51:00 +02:00
c167defa72 Fixed plugin dataFolder 2014-03-31 22:35:42 +02:00
5dafe8e7f0 Fixed lots of errors, added auto-save 2014-03-31 20:42:58 +02:00
8571796611 Load correct plugin permissions 2014-03-31 18:24:59 +02:00
b03ef8b61c More flexible match on plugin registration 2014-03-31 17:29:47 +02:00
0422540114 New automatic event listener plugin declaration 2014-03-31 17:01:56 +02:00
00d777a68d Fixed commands, NBT Player saving 2014-03-31 15:42:08 +02:00
2f03251795 Added /list, Player::canSee(), Player::showPlayer(), Player::hidePlayer(), removed RealHuman 2014-03-31 15:18:50 +02:00
f9a7385b47 Added /me and /say, fixed a bunch of things, chat working 2014-03-31 06:51:34 +02:00
22b5255421 Formatting 2014-03-31 05:53:51 +02:00
befe1c606f Added /ban, /ban-ip, /pardon, /pardon-ip 2014-03-31 05:51:42 +02:00
1ff381ebf4 Things are working ヽ༼ຈل͜ຈ༽ノ 2014-03-31 05:04:36 +02:00
2b8df410d1 Player is instanceof CommandSender 2014-03-31 02:53:37 +02:00
5bb909adf1 Fixed case 2014-03-30 23:51:41 +02:00
f789e6e6e3 Lots of new things added 2014-03-30 18:04:56 +02:00
ccec74076b Fixed PluginBase::getServer() 2014-03-30 14:35:58 +02:00
03d46020ec Update compile.sh 2014-03-29 06:11:24 +01:00
19efa5e8d9 I need a Mac 2014-03-29 05:16:17 +01:00
08c6265762 Added libcurl MacOS install_name_tool dynamic path patch 2014-03-29 05:08:14 +01:00
4098e5e3b8 Fixed invalid MacOS arch for 64-bit 2014-03-29 05:03:20 +01:00
829069b0c8 Removed WeakRef 2014-03-29 04:40:10 +01:00
de6e8f6fe1 Removed WeakRef 2014-03-29 04:39:45 +01:00
7599fb436d Fixed #1365 2014-03-29 04:35:12 +01:00
66cea2f8ea Update compile.sh 2014-03-29 04:14:29 +01:00
9cab86540b Update compile.sh 2014-03-29 04:10:52 +01:00
d9ce4f119f Update compile.sh 2014-03-29 04:05:10 +01:00
35511aa30e Update compile.sh 2014-03-29 04:01:50 +01:00
5ce7b57cac Update compile.sh 2014-03-29 03:54:28 +01:00
fc053d9d75 Update jenkins.sh 2014-03-29 03:30:16 +01:00
cb1b8c6c68 Update compile.sh 2014-03-29 03:30:02 +01:00
e03c8ed32e Updated compiler 2014-03-29 03:27:29 +01:00
0d30dca5aa Updated pthreads to 2.0.4 2014-03-28 23:50:09 +01:00
7e03109576 Moved default level registration 2014-03-28 13:07:36 +01:00
38809f7da2 Reformatting, removing unused imports 2014-03-28 12:57:08 +01:00
fd8e5b27e5 Added new global autoloader 2014-03-28 05:04:34 +01:00
b59926bece Added Recursive class loading in FolderPluginLoader 2014-03-28 04:25:17 +01:00
a7269c7900 Added /tell 2014-03-28 03:40:12 +01:00
2f20d95e5d Added new Event system 2014-03-28 02:13:03 +01:00
9e8cf2d42c Update CONTRIBUTING.md 2014-03-27 22:32:00 +01:00
926afa3903 New Task scheduler 2014-03-27 22:16:09 +01:00
9a2934b85b More unloading 2014-03-27 19:40:05 +01:00
1c341337a3 Set default console color at start 2014-03-27 18:58:36 +01:00
f60b526c9e Changed default log path 2014-03-27 18:53:20 +01:00
3bc3db0740 Added /stop, plugin disable / unload, remaining TaskCanceller classes 2014-03-27 18:49:43 +01:00
2385b94ba3 Added PluginBase::getCommand() 2014-03-27 14:56:02 +01:00
605231251a Fire plugin onLoad() 2014-03-27 14:35:44 +01:00
1c7be84703 Added CommandExecutor interface to PluginBase 2014-03-27 05:25:47 +01:00
530d705d39 Fully loadable plugins 2014-03-27 04:59:18 +01:00
120efad01f Colors fix D: 2014-03-26 20:23:04 +01:00
9fe68003eb Added Help command 2014-03-26 20:11:53 +01:00
76438e78d2 Changed Command inheritance 2014-03-26 18:10:49 +01:00
2112de42ad removed travis on Core-Rewrite 2014-03-26 16:50:36 +01:00
92a0ddb4fe Threaded networking :D 2014-03-26 16:48:27 +01:00
7ea9e4c862 It runs :O (Added more Permissions, executors and such things) 2014-03-26 04:14:53 +01:00
b1b8c89227 Removed SQLite3 from Recipe, converted to a lookup table 2014-03-25 18:53:39 +01:00
b6e0905c3e Implemented scheduler classes 2014-03-25 13:19:15 +01:00
af80c056c7 Added pthreads / yaml documentation stubs 2014-03-25 01:13:35 +01:00
5b90c4a716 safe_var_dump() now supports any amount of parameters 2014-03-23 21:56:50 +01:00
1429a74beb Player event 2014-03-23 15:14:11 +01:00
ee265d44bd Added more new Events 2014-03-23 13:41:45 +01:00
fd0fcecb46 Oops, seems like Utils::readInt() is reading an unsigned long because of PHP silliness 2014-03-23 01:55:26 +01:00
d18952a06e Removed not necessary code from Utils::readInt() and Utils::readLInt() 2014-03-23 01:50:15 +01:00
86f9d3e233 Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2014-03-23 10:37:44 +10:30
f03ab9a587 Removed Deprecation 2014-03-23 00:43:45 +01:00
80cfa7cc84 Formatting code 2014-03-23 00:32:05 +01:00
af14c87572 Added new Plugin and Permissions stuff :D 2014-03-23 00:22:14 +01:00
28c5443b0d Changed player achievement method names 2014-03-23 00:21:51 +01:00
08c6c1c1ac Updated compile scripts 2014-03-23 00:19:54 +01:00
cb2b08b248 Fixed Level generators 2014-03-23 00:19:11 +01:00
63f1f7581f Renamed Stackable to Threaded 2014-03-18 01:00:35 +01:00
d53656b2a8 pthreads 2.0.2 \(^.^)/ 2014-03-18 00:50:03 +01:00
28e17fe808 Added PHP WeakRef 2014-03-15 13:19:48 +01:00
c266cb991c Fix /list adding a trailing comma. 2014-03-14 16:45:54 -05:00
6f0f86dc0c More docs 2014-03-14 03:11:23 +01:00
3ff8ddc652 Fixed a few errors in new Events 2014-03-14 02:02:31 +01:00
68abafef7a Added multiple Player events using the new system 2014-03-14 01:51:10 +01:00
279472b01a Added generic block relative place/break on Level 2014-03-13 23:04:49 +01:00
91c4cbfedb Moved Player::buffer 2014-03-13 10:51:38 +01:00
b24120a863 Updated all undefined constants/classes, place resent packets to the recovery queue for NACK 2014-03-13 10:48:33 +01:00
3c3b346fd3 Use NBT Compounds instead of a NBT codec in PMF level data 2014-03-12 22:54:32 +01:00
63542a2f13 Updated NBT library to remove read overhead 2014-03-12 22:40:19 +01:00
cc5a30a0c2 Fixed ANSI color codes on Windows 2014-03-12 14:07:14 +01:00
8f990472c6 Fixed PHP 5.4 issues 2014-03-12 14:03:42 +01:00
18117b91ed Fixed issues with CPU loop 2014-03-12 03:25:50 +01:00
e033af0e72 Added -s (static) flag to compiler 2014-03-12 02:41:49 +01:00
69c829c302 Use pthreads 1.0.1 2014-03-11 21:58:40 +01:00
a84f756fd5 Optimize Imports 2014-03-11 20:47:31 +01:00
b3a2d3164f Finally, I can spawn AGAIN! 2014-03-11 20:45:53 +01:00
b28bc3ae9b Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2014-03-09 20:01:02 +10:30
b4df7c9456 Moved compile scripts 2014-03-08 18:16:55 +01:00
e0705c80e2 Fixed getopts on compile.sh 2014-03-08 18:14:43 +01:00
5d2884716d Update jenkins.sh 2014-03-08 13:53:27 +01:00
45ee209c58 Update jenkins.sh 2014-03-08 06:21:22 +01:00
564a504ef7 Update compile.sh 2014-03-08 05:49:27 +01:00
ba21d7f661 Update compile.sh 2014-03-08 05:35:31 +01:00
19d98869fd Modified compile.sh 2014-03-08 05:33:11 +01:00
099716920b Updated permissions 2014-03-08 04:43:15 +01:00
cbc64462e6 New directory structure. More powerful startup scripts 2014-03-08 04:41:43 +01:00
8d75bff34b Merge branch 'master' into Core-Rewrite
Conflicts:
	src/level/LevelImport.php
	src/pmf/LevelFormat.php
2014-03-08 03:34:53 +01:00
ababc879b5 Removed warning message about not-bundled PHP 2014-03-08 03:28:00 +01:00
a817234aa8 Do not generate Phar utilities by default, only generate extension 2014-03-07 23:29:28 +01:00
e246e10a82 Added NEON optimizations to iOS 2014-03-07 20:04:18 +01:00
5ad511cd11 Disabled phar cmdtools generation on crosscompile 2014-03-07 19:12:06 +01:00
47ad8b6fac Added PHP_VAR_NAME to crosscompile 2014-03-07 18:26:12 +01:00
a74f5809c7 Added -lresolv 2014-03-07 17:38:36 +01:00
8c02555a8d Added sed -i ".backup" 2014-03-07 17:02:05 +01:00
612cf98a08 typo fix 2014-03-07 16:42:18 +01:00
971e18d9b0 Added php.ini Phar directives 2014-03-07 16:33:29 +01:00
4a2dea4e45 Added correct toolchain for iOS 2014-03-07 16:25:40 +01:00
2916b0f049 Added Phar extension to PHP 2014-03-07 16:22:16 +01:00
bfe746235f Removed iOS -arch 2014-03-07 16:20:17 +01:00
604f068112 Added iOS flags 2014-03-07 15:41:08 +01:00
c7854a3417 Added arm flags 2014-03-07 15:33:32 +01:00
8bfd22c9ac Added arch-specific compile optimizations 2014-03-07 13:34:31 +01:00
052f641715 Fixed levels not being read properly 2014-03-07 06:29:35 +01:00
ee51f75c78 Fixed issues with zlib 2014-03-07 05:15:01 +01:00
73b78e1455 Updated helper scripts PHP version to 5.5.10 2014-03-07 04:49:26 +01:00
7ad7398f2b Updated PHP version to 5.5.10 2014-03-07 04:47:15 +01:00
e81f4430cb Fixed mac 32-bit compilation 2014-03-07 04:29:47 +01:00
c12c6f1f18 Added remaining env. vars to compile.sh 2014-03-07 04:24:41 +01:00
a375a17d17 New compile script 2014-03-07 04:21:21 +01:00
801e924783 Comments 2014-03-06 23:38:46 +01:00
993620341a Added Villager class and NPC interface 2014-03-06 23:33:35 +01:00
59246dd5ec Added API Docs link 2014-03-06 22:03:30 +01:00
f7c7eac05a Updated README.md 2014-03-06 21:48:06 +01:00
331a26931f It staaaarts! 2014-03-06 20:41:04 +01:00
56d3b89f57 Updated class constants 2014-03-06 19:31:41 +01:00
80356d8794 fixed syntax error 2014-03-06 19:29:33 +01:00
028adce245 Used namespacer to identify moved files 2014-03-06 19:28:20 +01:00
a54d33957e Added multiple comments and info 2014-03-06 18:52:23 +01:00
5c00b415a5 typos 2014-03-06 17:24:26 +01:00
18443c0cd7 Reformatted code 2014-03-06 17:17:45 +01:00
6a736aa822 Used namespacer on Blocks and Items 2014-03-06 17:16:05 +01:00
d490972a42 fix typo 2014-03-06 17:14:54 +01:00
6f74ef80f9 Added Block and Item namespaces 2014-03-06 17:14:15 +01:00
2e0d9153b3 used namespacer 2014-03-06 15:15:50 +01:00
64a9650765 fixed typo 2014-03-06 15:12:52 +01:00
419f246e68 Added Item namespace 2014-03-06 15:11:46 +01:00
e3f1db0f45 Added Network\Handler namespace 2014-03-06 13:19:00 +01:00
c08bf3ef86 Removed code remove comments 2014-03-06 13:16:44 +01:00
bbd66e6ad1 Removed code remove comments 2014-03-06 13:05:54 +01:00
a14deae634 Removed code remove comments 2014-03-06 12:58:54 +01:00
42ae544d0d Used namespacer tool 2014-03-06 05:47:00 +01:00
c9c6d5a5f4 Added Ores to objects 2014-03-06 05:43:40 +01:00
eeb8244f26 Fixed Normal generator name 2014-03-06 05:35:17 +01:00
e0267799fb Fixed class namespaces 2014-03-06 05:33:04 +01:00
da4bc302c4 Fixed Utils endianness 2014-03-06 04:10:07 +01:00
5109566c9f Updated .gitignore 2014-03-06 03:53:59 +01:00
5de9fa77d7 Moved objects 2014-03-06 03:16:03 +01:00
ee53e21159 small fixes 2014-03-06 03:03:42 +01:00
dd2d229f74 renamed PocketMine\PMF\Level to PocketMine\PMF\LevelFormat 2014-03-06 02:45:09 +01:00
e3c0ea6be5 fixed typo 2014-03-06 02:40:19 +01:00
5b02666828 fixed typo 2014-03-06 02:38:57 +01:00
bc0c185cb5 fixed typo 2014-03-06 02:36:30 +01:00
928519f226 fixed typo 2014-03-06 02:30:16 +01:00
edf0d44416 fixed typo 2014-03-06 02:27:28 +01:00
3465a5f7e8 fixed typo 2014-03-06 02:26:17 +01:00
024e219292 fixed typo 2014-03-06 02:22:52 +01:00
42b5af23db Moved files 2014-03-06 01:18:55 +01:00
5ea31b57ce First step to namespaces 2014-03-05 23:43:16 +01:00
23b8fc32ff removed DocBlock header for logo 2014-03-05 11:15:47 +01:00
5f53f61121 Faster NBT parsing 2014-03-05 10:37:14 +01:00
98c0dfef43 Removed entity.motion from Player 2014-03-05 10:17:22 +01:00
d69fe5d5e7 New events, item methods 2014-03-05 10:16:08 +01:00
2bdc8c400e EventHandler code cleanup 2014-03-05 03:42:22 +01:00
ccdf587135 go away E_NOTICEs 2014-03-05 02:53:20 +01:00
b00da18f41 faster packet decode using pure-PHP functions instead of core-PHP ones :P. WTF PHP 2014-03-05 02:49:40 +01:00
9c38ead76d fixed time not being sent correctly on creative mode the first time 2014-03-05 01:25:53 +01:00
274f8a6113 Block placement fixes 2014-03-05 01:19:05 +01:00
a529e7566a Removed not needed network steps, corrected slot methods 2014-03-05 00:54:12 +01:00
bf412b1c20 Do not sleep on main Thread when actions are being done 2014-03-04 20:37:15 +01:00
980ee223d0 Save correct NBT Compound tag on Level chunk save 2014-03-04 19:52:52 +01:00
5241d8ff13 Fixed derp x3 2014-03-04 19:49:39 +01:00
c6c0b75eae Fixed derp x2 2014-03-04 19:46:47 +01:00
547ca74feb Fixed derp 2014-03-04 19:46:06 +01:00
4697d9d4ed Added player NBT save format, auto-upgrade 2014-03-04 19:41:56 +01:00
4449af2213 Implemented InventorySourceEntity into HumanEntity 2014-03-04 19:40:30 +01:00
f6589db064 Send Entity motion, update on schedule 2014-03-03 00:27:44 +01:00
c904e8bc0e Remove ANSI characters on clean 2014-03-03 00:26:33 +01:00
12ddf530b1 Added AxisAlignedBB::getMixedBoundingBox() (?) 2014-03-02 23:32:48 +01:00
df20467f3b Added Player block place/break (to be rewritten soon) 2014-03-02 17:56:54 +01:00
9cc9de8dae New Random block update tick 2014-03-02 17:56:24 +01:00
f6daaf76c8 Update CONTRIBUTING.md 2014-03-02 02:05:40 +01:00
ca308f8159 Merge branch 'master' into Core-Rewrite
Conflicts:
	src/pmf/PMFLevel.php
2014-03-01 22:12:22 +01:00
11f5691104 Fixed Pocket format importing 2014-03-01 22:08:28 +01:00
c8deefdb12 derp 2014-03-01 21:55:10 +01:00
75b34b6c2a Merged master into Core-Rewrite 2014-03-01 21:48:09 +01:00
5bf440d820 Fixed level upgrade and direct save on load 2014-03-01 21:45:07 +01:00
4d9e781f27 Tuned PMFLevel version upgrade 2014-03-01 21:43:55 +01:00
2a23eadbb6 Fixed things 2014-03-01 21:42:40 +01:00
573fe0e5cc Save player position, removed several methods from PluginAPI 2014-03-01 20:32:49 +01:00
f8d91b5888 Rolling chunk load 2014-03-01 19:13:08 +01:00
fdbefa0571 Added index to Level::getUsingChunk() 2014-03-01 19:04:18 +01:00
c2ad811451 Added chunk move spawning logic 2014-03-01 19:01:24 +01:00
dad2f21888 Players are fully spawnable and can see each other! 2014-03-01 18:23:38 +01:00
9d02ed9a28 New chunk indexing and sending algorithm 2014-03-01 17:35:44 +01:00
8403a34eb3 Removed entities, tiles, players SQLite3 tables 2014-03-01 14:07:27 +01:00
648b02bc79 Added Entity level switch, global Player static container 2014-03-01 14:05:45 +01:00
914098310c Guess NBTTag_List components type automatically 2014-03-01 11:26:19 +01:00
734b066131 removed debug messages 2014-02-28 22:03:09 +01:00
5651fc1cb1 Fixed level block and chunk sending 2014-02-28 20:39:59 +01:00
f08bedf2fe Added Biome methods to Level 2014-02-28 20:04:41 +01:00
6ac5647e2c Fixed load order 2014-02-28 20:04:31 +01:00
c488c19db9 I can spawn!! 2014-02-28 19:47:08 +01:00
f1d6726615 Added TextFormat::toHTML() 2014-02-28 16:08:33 +01:00
573c3ea377 Added /msg alias to /tell :P 2014-02-28 16:08:19 +01:00
16eb45925a Remove non-implemented chat colors from player messages 2014-02-28 00:12:57 +01:00
6d5e2648cf extra changes 2014-02-28 00:00:04 +01:00
2bf3f0de73 Removed EntityAPI 2014-02-27 16:47:49 +01:00
e314f46b5b Added biome saving to PMFLevel version 2 2014-02-27 15:34:00 +01:00
dc8cc2ab9f fixed empty world generation 2014-02-27 15:17:45 +01:00
6bd91cf39e fixes, new Tile update algorithm 2014-02-27 15:12:05 +01:00
c9dfdc288d Updated global Tile code 2014-02-27 12:23:22 +01:00
44b9d33b65 removed debug code 2014-02-27 00:24:43 +01:00
9acc867a94 fix 2014-02-27 00:14:05 +01:00
103d0bf2ea Updated TextFormat constants 2014-02-27 00:11:06 +01:00
4a2852bb90 Reworked Level things to handle new NBT structure 2014-02-27 00:03:53 +01:00
398fbbfb31 Added array things to NBT 2014-02-27 00:03:27 +01:00
4ffdb029f0 Removed TileAPI 2014-02-27 00:02:59 +01:00
b7ca8aac5c New Tile structure 2014-02-27 00:02:28 +01:00
b374783486 Allow direct property naming on NBT TAG_Compound 2014-02-26 17:55:17 +01:00
3864630bcd New PMF level (uses NBT Entity and TileEntity) 2014-02-26 17:15:31 +01:00
38c5174da7 Merged branch master into Core-Rewrite (includes new NBT changes) 2014-02-26 16:26:59 +01:00
21671b133a New NBT library finished 2014-02-26 15:20:16 +01:00
9cfa49c112 Added core NBT modifications 2014-02-26 15:12:58 +01:00
0231bf406e new NBT fixes 2014-02-26 13:53:50 +01:00
28d1da1286 New NBT tags 2014-02-26 13:08:53 +01:00
85f8613803 Fix RCON packet structure #1278 2014-02-24 20:13:15 +01:00
8e1cd2d6bd Check for block changes each 2 ticks instead of each 15 ticks 2014-02-23 13:47:30 +01:00
24722e3c9a Added #1196 async function queuing
Type ID: ASYNC_FUNCTION
Params: array("function" => $functionName, "arguments" => array
$argumentArray)
2014-02-23 13:39:57 +01:00
13274ebefa send-usage is now an advanced property :P 2014-02-23 13:39:56 +01:00
378e9c8720 Merge pull request #1274 from iksaku/patch-1
/sudo param help more descriptive
2014-02-23 13:37:49 +01:00
ba761faf74 Update BanAPI.php
/sudo help more descriptive?
2014-02-22 22:43:58 -06:00
734abf2fbb Fix E_STRICT errors 2014-02-20 23:43:42 +01:00
46ff7d43f4 Forgot to remove crash debug code. Fix #1260 2014-02-20 23:41:36 +01:00
8208fd2389 Changed class name 2014-02-20 17:22:51 +01:00
fded039485 Fixed #1258 2014-02-20 13:13:46 +01:00
9bc69f4c17 Update memory data on crash 2014-02-20 11:24:48 +01:00
eb40c34547 Fix error dump not dumped on memory problems 2014-02-20 10:57:42 +01:00
772fa2b9e3 Query token now depends on the source IP 2014-02-20 09:00:17 +01:00
7bdc48509e things 2014-02-19 17:41:12 +01:00
be13d0a921 Merge remote-tracking branch 'origin/PluginAPI-Rewrite' into Entities 2014-02-19 15:59:01 +01:00
7a44e8041f Entity $chunkIndex 2014-02-19 15:37:59 +01:00
b36d754e5b Merge remote-tracking branch 'origin/master' into Entities 2014-02-19 15:28:23 +01:00
62ef1f6b20 Added more entities 2014-02-19 12:41:19 +01:00
d12ce8fd6c small fixes 2014-02-19 02:23:45 +01:00
dd177b689b Added -mmacosx-version-min=10.5 to compile.sh 2014-02-19 02:09:02 +01:00
b4c6a0bf22 oops, typo 2014-02-19 01:56:25 +01:00
f1b5f83fd4 Lots of typos fixed, undefined variables, unused code 2014-02-19 01:55:42 +01:00
3d3111fef6 Changed preg_match() code in Player username handling 2014-02-19 00:49:07 +01:00
a1b2cf4b34 Added -undefined dynamic_lookup 2014-02-18 21:36:52 +01:00
1961e82645 Downgrade OpenSSL to 0.9.8y 2014-02-18 21:31:04 +01:00
15881d328d Added -weak-lSystem to MacOS x86_64 2014-02-18 20:41:54 +01:00
80e2a7e486 Update installer.sh 2014-02-18 19:46:39 +01:00
08c1dbe3a7 fix fix* 2014-02-18 18:52:27 +01:00
0cfb5aa720 fixed typo 2014-02-18 18:42:41 +01:00
60cf2c824f This should do for MacOS x86 2014-02-18 18:22:27 +01:00
f8dc01ccb3 Fixed things compile.sh 2014-02-18 17:47:40 +01:00
2c9337f200 Revert "Added $WITH_OPENSSL again to PHP"
This reverts commit c290b07382.
2014-02-18 17:31:12 +01:00
c290b07382 Added $WITH_OPENSSL again to PHP 2014-02-18 17:26:36 +01:00
0e5c532f5e Changed Android OpenSSL target 2014-02-18 17:24:46 +01:00
9006e5afad Added custom zlib to OpenSSL 2014-02-18 17:13:36 +01:00
bd3544e917 Added DYLD_LIBRARY_PATH 2014-02-18 16:28:30 +01:00
f384dfc40a Changed @loader_path to @executable_path on MacOS 2014-02-18 15:33:32 +01:00
2ee76182ad Compile OpenSSL on MacOS 2014-02-18 15:16:10 +01:00
c7acc3f221 Updated -rpath for MacOS 2014-02-18 15:00:29 +01:00
4573389840 Use Github URL for zlib 2014-02-18 14:48:51 +01:00
ea2fc1fb03 MacOS 32-bit compilation 2014-02-18 14:37:56 +01:00
0245ebe9f6 Update jenkins.sh 2014-02-18 13:00:33 +01:00
d38ae3c230 Added tar.gz files to jenkins.sh 2014-02-18 11:58:34 +01:00
daf27f46be Update installer.sh 2014-02-18 11:54:33 +01:00
2e2990fe33 Update compile.sh 2014-02-18 11:25:01 +01:00
aae66930b6 Update compile.sh to remove unused data 2014-02-18 10:27:32 +01:00
7472238510 Updated installer to handle full paths right and discard warnings on PHP checking 2014-02-17 19:10:28 +01:00
943e038772 Remove OpenSSL from PHP build :P 2014-02-17 18:37:37 +01:00
42e7467dba Added OpenSSL to Jenkins 2014-02-17 18:32:02 +01:00
697d96e60c Updated compile script to handle shared libraries 2014-02-17 18:30:18 +01:00
5b5dcd6d77 Removed not used code in compile.sh 2014-02-17 14:43:58 +01:00
0e39131e76 *fix 2014-02-17 13:26:51 +01:00
109f97ae00 Added ODROID detection to installer.sh 2014-02-17 13:20:28 +01:00
8b4abcc558 Generate OpenSSL shared binaries 2014-02-17 03:09:58 +01:00
5f3772d14a fixed cURL SSL for Darwin 2014-02-17 02:13:35 +01:00
98c50f9a9c OpenSSL is now not enforced compile.sh 2014-02-17 01:46:28 +01:00
6b2bca10a3 Added PHP check on installer.sh 2014-02-16 22:51:25 +01:00
5f6c9b7fad Normal compile.sh 2014-02-16 20:47:32 +01:00
696792cd2a Pre-sed 2014-02-16 20:21:42 +01:00
7e979f40cb Use full path on compile.sh 2014-02-16 20:05:21 +01:00
b0a6631b8e Update jenkins.sh 2014-02-16 19:45:09 +01:00
bb680e6e67 Fix compile.sh things 2014-02-16 18:52:55 +01:00
e999de22d5 oh my god. well, this should do. works for 32 and 64 bit FINALLY 2014-02-16 18:16:17 +01:00
bab5a36d39 Well, I found what broke everything 2014-02-16 17:10:04 +01:00
1a7cdc5cea No OpenSSL for PHP :( 2014-02-16 17:03:36 +01:00
7497e32042 Update jenkins.sh 2014-02-16 16:56:19 +01:00
d0c5f27ed3 OpenSSL make depend :S 2014-02-16 16:54:48 +01:00
65940719c2 OpenSSL + cURL 2014-02-16 16:44:07 +01:00
9847f38a9f Include OpenSSL in builds 2014-02-16 16:10:05 +01:00
e22b70296f Update compile.sh 2014-02-16 13:52:10 +01:00
5725b5a1a8 Update compile.sh 2014-02-16 13:36:13 +01:00
e7565e4183 Update jenkins.sh 2014-02-16 13:34:41 +01:00
878c3a3e3a Update compile.sh 2014-02-16 13:27:29 +01:00
0915e751c4 Update jenkins.sh 2014-02-16 13:11:15 +01:00
e740124b43 Update jenkins.sh 2014-02-16 13:03:31 +01:00
b6ad889057 Trying to fix libssl.so.10 error, re-added libedit 2014-02-16 12:46:26 +01:00
0e4b7f85c4 */ 2014-02-15 20:19:33 +01:00
905fa23d18 methods* 2014-02-15 12:17:17 +01:00
d699a97bb7 small things 2014-02-15 01:39:37 +01:00
9301c04e1f Added pre-compiled Linux binaries to installer 2014-02-14 23:09:29 +01:00
12141fe2b1 Updated jenkins.sh 2014-02-14 22:41:50 +01:00
5d1c79379b *and 2014-02-14 21:49:26 +01:00
08149fa4b3 Fixed #1229 2014-02-14 20:56:00 +01:00
dfe7269019 Fixed #1193 using #1194 2014-02-14 20:53:15 +01:00
2b15c440ee Send inventory on invalid crafting/invalid movement of item 2014-02-14 19:54:14 +01:00
daf3198136 Tall Grass can be replaced 2014-02-14 19:37:57 +01:00
fdf519398a Do not unload spawn chunks 2014-02-14 19:37:39 +01:00
f0ff420659 Fixed negative chunk indexes on PMFLevel 2014-02-14 18:25:06 +01:00
4acb4541ab Infinite player chunk sending (not yet visible :( ) 2014-02-14 17:59:34 +01:00
7ea0bf5067 Merge remote-tracking branch 'origin/master' into Entities 2014-02-14 17:16:51 +01:00
cbe07a1fa0 Fixed PMFLevel infinite loop 2014-02-14 14:21:28 +01:00
47893ed765 Generate backtrace on error/crash 2014-02-14 14:21:13 +01:00
63f4f87d37 Fixed PMFLevel bugs, crashes and weird methods 2014-02-14 13:17:05 +01:00
c1251a25bd Removed water PMFLevel update that caused locks 2014-02-14 01:36:10 +01:00
da554fbf23 Fixed Trees 2014-02-14 00:25:44 +01:00
715e51b7c5 Automatic population on side loading 2014-02-14 00:19:26 +01:00
5d7198396d Added TallGrassPopulator 2014-02-13 22:39:53 +01:00
4fecbc2dbc Added water sand and gravel 2014-02-13 22:05:50 +01:00
9600d61454 Modified max-chunks-per-second default value 2014-02-13 20:48:50 +01:00
5929b510d5 Better, faster world generation. Needs more things 2014-02-13 20:44:15 +01:00
4eebbba5bf PHP 5.4, PHP 5.5 and PHP 5.6 on Travis CI 2014-02-13 11:06:55 +01:00
1bbf211a37 Set a world spawnpoint using /spawnpoint w:WORLD x y z 2014-02-13 09:47:30 +01:00
acece47a37 Merge remote-tracking branch 'origin/master' into Entities 2014-02-13 09:30:21 +01:00
4d1adb98a8 Removed $i on WorldGenerator 2014-02-13 09:29:50 +01:00
c3a6149b29 added protocol number to /version 2014-02-13 08:52:27 +01:00
89e556755d Updated WorldGenerator to use correct generation variables 2014-02-13 08:38:23 +01:00
ab5c6341fe Added /plugins and /version 2014-02-13 08:37:54 +01:00
d0af367395 Use integers instead of booleans 2014-02-13 01:59:08 +01:00
4523b15991 do not send chunk updates on chunk generation 2014-02-13 01:53:30 +01:00
bd73cced6e Do not send block changes during chunk generation 2014-02-13 01:47:18 +01:00
e4c8142681 Removed var_dump() 2014-02-13 01:41:40 +01:00
c9a2a0ea50 Updated API version 2014-02-13 01:34:42 +01:00
268e8c1164 Force PMF save on PMF Level upgrade 2014-02-13 01:34:41 +01:00
e83e424671 Removed entity limits 2014-02-13 01:34:39 +01:00
3e68972253 fix an include 2014-02-13 01:34:37 +01:00
7f86746cbe woo :D 2014-02-13 01:34:36 +01:00
1ab90b1409 PMFLevel upgrade tested 2014-02-13 01:34:35 +01:00
b7ed2f765c Added PMFLevel upgrade 2014-02-13 01:34:33 +01:00
f7b8ad0e37 Infinite generation, in-place chunk creation working. New PMF Format 2014-02-13 01:34:32 +01:00
8377416f48 Nice generation :D 2014-02-13 01:34:30 +01:00
f91e2a5cfe Better parameters ^^ 2014-02-13 01:34:29 +01:00
2d88739005 normalize 2014-02-13 01:34:27 +01:00
4e820ab89f Use single Perlin noise 2014-02-13 01:34:26 +01:00
1bc54dbc44 Such noise 2014-02-13 01:34:24 +01:00
26772082da Random generator with signed int/float methods 2014-02-13 01:34:23 +01:00
3cbcb4871a Changed a few packet things 2014-02-13 01:14:14 +01:00
ac50577255 Typo and fixed a filename 2014-02-12 19:28:33 +01:00
aff2b9882a Merge pull request #1214 from nno88551/patch-2
fixed disconnected message
2014-02-12 11:14:29 +01:00
4352fce82d fixed disconnected message 2014-02-12 19:12:07 +09:00
df865d3456 Entity changes 2014-02-11 20:50:09 +01:00
b392a357e9 More classes 2014-02-11 20:49:38 +01:00
aab0cfb0d8 Added AxisAlignedBB bounding box for entities 2014-02-11 19:37:04 +01:00
a373a581c5 Better fix for #1201 (case-insensitive) 2014-02-11 16:57:45 +01:00
fccca5827f Moar 2014-02-11 16:20:51 +01:00
1206cbf993 Basic Entity structure 2014-02-11 13:31:48 +01:00
89a0e84404 Fixed handlerPriority order 2014-02-11 12:47:28 +01:00
755cafa600 Alpha_1.4dev 2014-02-11 12:47:18 +01:00
c09bc259fc Added #1142 OP players can bypass the player limit 2014-02-11 10:27:53 +01:00
8b23568fe7 Changed codename to new scheme. Alpha_1.3.12 ready \o/ 2014-02-11 02:31:41 +01:00
ad3bf0998f Halt NBT parsing if end of data is found 2014-02-11 01:41:04 +01:00
9cd5c1581b oops x4 2014-02-10 21:38:32 +01:00
94f2da1e38 Oops x3 2014-02-10 20:52:10 +01:00
b635a54b13 Oops x2 2014-02-10 20:47:21 +01:00
5057a3965e Ooops, ;) 2014-02-10 20:46:47 +01:00
5bdb61117f Merge pull request #1188 from PocketMine/Faster-Network
Merge Faster-Network into master. Added new Networking system, new Event system
2014-02-10 19:07:12 +01:00
0bf74d4139 Two packet event types ;) 2014-02-10 18:46:58 +01:00
a2ec9d6688 Moved a file 2014-02-10 18:10:51 +01:00
4b14d5d900 Final structure with example events 2014-02-10 18:08:25 +01:00
a4cbb2f938 Added PluginEvent 2014-02-10 17:33:12 +01:00
9ab993c817 Basic event system written 2014-02-10 17:23:35 +01:00
830530d868 Basic Event types (extended from Bukkit) 2014-02-10 16:09:32 +01:00
7c12f6ce8a Implemented QueryPacket and QueryHandler 2014-02-10 15:05:12 +01:00
b9aa3a0e70 Removed old code for property migration 2014-02-10 13:29:21 +01:00
d925640f03 Moved max-chunks-per-second to server.properties, increased to 8 2014-02-10 13:28:54 +01:00
7e174eac5a Decreased SO_SNDBUF 2014-02-10 13:26:09 +01:00
d5ff5d0066 Merge branches 'Faster-Network' and 'master' of https://github.com/PocketMine/PocketMine-MP 2014-02-10 19:20:37 +10:30
8de39db59d Updated chunk packet field names 2014-02-09 14:39:17 +01:00
f1245a551e Increased UDP buffer size 2014-02-09 13:30:06 +01:00
11c9972eb9 Fixed RotateHeadPacket not having pitch 2014-02-09 05:53:16 +01:00
8739017002 Check if the specified length is correct 2014-02-09 05:37:40 +01:00
5c1550e116 Set max movement distance, disallows teleport cheat 2014-02-09 05:30:15 +01:00
072d0589d2 Fixed undefined $data on RotateHeadPacket 2014-02-09 05:08:32 +01:00
7ebaf7e552 Added Android, BSD detection to Utils::getOS() 2014-02-09 04:44:45 +01:00
0e1c099906 Added iOS detection to Utils::getOS() 2014-02-09 03:20:09 +01:00
c2d4dd093a Updated repo name on installer 2014-02-09 03:19:39 +01:00
6046b263dd Possible fix #1189 2014-02-08 23:44:58 +01:00
dfa28d9a9e WTF null packets crash the server?? 2014-02-08 23:29:42 +01:00
7f0693e7e7 Updated packet handling to eliminate loops 2014-02-08 23:01:22 +01:00
3fed63b248 Split packet handling verified 2014-02-08 22:49:13 +01:00
a8b26a3caf Halt parsing when invalid packets are found 2014-02-08 21:16:51 +01:00
296c6904b9 Hide leave messages from non-spawned players 2014-02-08 20:54:50 +01:00
dfd5733969 Handle unknown packets more gracefully 2014-02-08 19:21:45 +01:00
0ff647015c Handle all kind of unknown data packets 2014-02-08 19:17:49 +01:00
f255948eb6 Updated Query to new packet format 2014-02-08 17:56:48 +01:00
d8aea544f3 Fixed DoorBlock crashing the server 2014-02-08 16:55:20 +01:00
1c7539b51a Fixed data packets being sent on player disconnect 2014-02-08 14:52:06 +01:00
1f8e25710d Fixed set up wizard not updating the memory 2014-02-08 14:46:08 +01:00
b107191fdb Renamed ExplosionPacket to ExplodePacket 2014-02-08 13:39:41 +01:00
f77d5dcefd Fixed UseItemPacket 2014-02-08 13:34:05 +01:00
2c3ab612f2 Fixed AddEntityPacket 2014-02-08 13:02:10 +01:00
b8ff5716c7 Packets are cloned on broadcast 2014-02-08 11:47:52 +01:00
8b87733082 Faster-Network now usable! 2014-02-08 01:30:08 +01:00
1f5ff78f06 Fixed a few wrong fields 2014-02-08 01:25:03 +01:00
f6ecf51516 Added RakNetDataPacket::reset() to all the packets 2014-02-08 00:48:00 +01:00
580ef46513 Added packet pid to buffer by default 2014-02-08 00:36:30 +01:00
c40b00288b Merge remote-tracking branch 'origin/master' into Faster-Network 2014-02-08 00:31:14 +01:00
28a753ba60 Fixed split packet sending 2014-02-08 00:29:20 +01:00
5dd7727548 Reverted 8e37627bc0 2014-02-08 00:05:36 +01:00
61953b5507 Fixed online functions on Android - do not use DNS 2014-02-07 22:56:15 +01:00
d4791ceb6c removed time warning 2014-02-07 20:53:29 +01:00
bcee4e7c21 bypass a few errors on installer.sh 2014-02-07 19:23:16 +01:00
af6174508d MacOS fix 2014-02-07 19:15:00 +01:00
d8e34e9ac5 Added iOS support 2014-02-07 18:46:50 +01:00
951ac08703 Updated installer.sh 2014-02-07 18:13:19 +01:00
2562d8fc41 Fixed position error 2014-02-07 18:06:50 +01:00
ac3472eff4 Fixed spawning problems because of packets 2014-02-07 18:03:11 +01:00
84638098d0 Entity spawn packets 2014-02-07 17:24:50 +01:00
083bfcc83c More classes updated 2014-02-07 17:07:57 +01:00
95bff304e4 Changed all Player packets to new network 2014-02-07 16:44:10 +01:00
20f2ef0e82 Updated PHP binaries on the installer 2014-02-07 11:45:12 +01:00
1728656836 PHP 5.5.9 2014-02-07 11:21:31 +01:00
eb375be550 PocketMinecraftServer client join protocol 2014-02-07 01:06:49 +01:00
dbbfbdffaa RakNet data packet codec 2014-02-07 00:56:40 +01:00
c048564981 Server listing working 2014-02-07 00:46:04 +01:00
45a3b54d32 Fixed basic stuff around 2014-02-07 00:16:39 +01:00
0af197a0f7 New packet writing done 2014-02-06 23:30:09 +01:00
415c9f16f4 wow. much packet. many code. such classes 2014-02-06 22:49:13 +01:00
82a486169f Merge remote-tracking branch 'origin/master' into Faster-Network 2014-02-06 15:22:08 +01:00
14a7e0a201 Call Plugin::__destruct() on PluginAPI::__destruct() 2014-02-06 15:21:12 +01:00
84cdc3bde1 RakNetInfo 2014-02-06 15:19:15 +01:00
5700235f80 Merge remote-tracking branch 'origin/master' into Faster-Network 2014-02-06 14:48:00 +01:00
85438aff0d Added verbose error level names 2014-02-06 14:14:08 +01:00
a5efe15030 Fixed #1173 #486 #466 #483 ignore E_NOTICE unpack() errors 2014-02-06 14:13:37 +01:00
55216ae65b Typo 2014-02-06 14:06:08 +01:00
e4b475218b Fixed #1152 get correct timezone from abbr. 2014-02-06 14:02:27 +01:00
bf6e759d97 Added multiple player selection and exact match by default (fixes #1167) 2014-02-06 13:14:10 +01:00
8e37627bc0 Change spawnpoint to setspawn for bukkit compatibility 2014-02-06 21:31:04 +10:30
e2a77b05b7 Remove redundant closing tag 2014-02-06 21:20:29 +10:30
1694e8622d Updated installer languages 2014-02-06 11:45:31 +01:00
112c35c3a1 Fixed #1171 2014-02-05 18:50:04 +01:00
1b5dc2db4d Reset cache timer when used 2014-02-05 17:29:11 +01:00
61ecf3418e fix installer :s 2014-02-05 12:10:32 +01:00
838147c4eb Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-02-05 12:08:46 +01:00
3ac90dec47 New Raspbian build, fixes #1168 #1165 2014-02-05 12:07:03 +01:00
5030dc0bd1 Updated cURL 2014-02-05 11:57:27 +01:00
c80a64650b Merge pull request #1172 from pemapmodder/master
Added BOOK id
2014-02-05 11:11:39 +01:00
77ab494b70 BOOK ID missing? 2014-02-05 16:42:15 +08:00
5762d70414 Updayed ARMv7 Android flags 2014-02-04 14:08:54 +01:00
96d579e90f why is this so hard! 2014-02-04 14:04:07 +01:00
1ac14dba29 new -mtune 2014-02-04 14:01:42 +01:00
fc6515c37f -mtune=none 2014-02-04 12:58:09 +01:00
8bc60ca36f Removed -mtune 2014-02-04 12:56:23 +01:00
28af0e9f87 Updated compile.sh Android parameters 2014-02-04 12:40:16 +01:00
3bf812b3b3 Updated march for Android 2014-02-04 10:11:27 +01:00
0aeed7f458 Updated ARM toolchain to arm-unknown-linux-uclibcgnueabi 2014-02-04 07:50:28 +01:00
6325a2298e Fixed #1161 PluginAPI::readYAML() and PluginAPI::writeYAML() 2014-02-03 19:13:39 +01:00
34378b5776 Show player name on bad username kick 2014-02-03 01:10:30 +01:00
5cd2362c13 Added libtool 2014-02-02 19:12:51 +01:00
24ac7aa931 Added --target=arm-apple-darwin10 2014-02-02 19:09:03 +01:00
e39dad15e5 Added iOS sdk path 2014-02-02 19:06:35 +01:00
a1996063b6 llvm-? 2014-02-02 19:03:33 +01:00
11593ac96c Added experimental iOS cross-compile support 2014-02-02 19:02:29 +01:00
f9adbf33ec Fixed undefined chunk on PMFLevel::getMiniCHunk() 2014-02-02 12:05:35 +01:00
8bbc0af9b5 Fixed #1150 invalid Entity positions on startup 2014-02-02 02:30:21 +01:00
d299e39649 Fixed invalid array when a player has been kicked 2014-02-02 02:27:59 +01:00
5f3829692d Fixed unknown and impossible crash 2014-02-01 16:26:40 +01:00
dbde770fce Fixed typo o.O 2014-02-01 16:19:56 +01:00
cf1c2b3633 nope 2014-02-01 13:19:42 +01:00
df41f04d0f arm-none-linux-uclibceabi, maybe? 2014-02-01 12:53:59 +01:00
4ae7ccff9f Try with arm-none-linux-uclibcgnueabi 2014-02-01 12:50:41 +01:00
17d565e950 Added --enable-static-link for Android 2014-02-01 12:42:18 +01:00
ca99d60f53 Static uclibc linking 2014-02-01 12:32:12 +01:00
b867be9c9d Save install_data on jenkins 2014-02-01 12:15:22 +01:00
60a43df5c7 Removed gcc -pipe on normal build 2014-02-01 12:12:42 +01:00
fbbb114fc6 Removed gcc -pipe on test 2014-02-01 12:11:26 +01:00
e2b9e3d665 Fixed ARMv7 compilation 2014-02-01 11:28:10 +01:00
25d5ea367d Updated installer binaries 2014-02-01 11:27:56 +01:00
0329735712 Added $HAVE_MYSQLI 2014-02-01 01:27:59 +01:00
a9d0716bde Added $CONFIGURE_FLAGS to YAML compilation 2014-02-01 01:21:30 +01:00
6ba6aa5b61 Fixed jenkins script on places where cURL is not installed 2014-02-01 01:11:47 +01:00
9cc624b74e Force Entity health change on respawn 2014-02-01 01:06:05 +01:00
e619ebad61 such fix ¬¬ 2014-01-31 23:55:43 +01:00
e69da264dc Added prefix to libtool compilation 2014-01-31 23:53:48 +01:00
33bbbba806 Move libtoolize ¬¬ 2014-01-31 23:50:06 +01:00
666418752f fix 92dcb90804 2014-01-31 23:45:19 +01:00
92dcb90804 Added libtoolize env. variable 2014-01-31 23:42:48 +01:00
80376d3a4d Move libtool to correct location on jenkins Mac 2014-01-31 23:36:26 +01:00
0a10e76ff9 fixed typo 2014-01-31 23:31:42 +01:00
d313f82984 Added export to libtool 2014-01-31 23:30:59 +01:00
ab845c5dab Added libtool compilation on Mac for install.sh 2014-01-31 23:30:23 +01:00
951e9efb5e Updated installer.sh to include OPCache 2014-01-31 23:14:50 +01:00
329788e506 Save artifacts even when the build fails jenkins.sh 2014-01-31 21:15:12 +01:00
74ad2ddcdd Added cURL on Mac OSX Jenkins build 2014-01-31 21:05:13 +01:00
09cf39b9d5 Added quotes to URLs 2014-01-31 21:03:28 +01:00
d00b489e1d Added universal installer.sh 2014-01-31 17:51:48 +01:00
cf554c67f2 Be sure to respawn players correctly 2014-01-31 17:24:03 +01:00
331904691d Added cURL shared extension to php.ini 2014-01-31 16:21:07 +01:00
dd7c2c850b Updated jenkins.sh to include all binary files generated 2014-01-31 16:09:52 +01:00
263c580fe1 Removed curl from jenkins.sh for Mac 2014-01-31 16:00:36 +01:00
b9ee3fb185 Updated curl path 2014-01-31 16:00:09 +01:00
5e079b740c Modified cURL building 2014-01-31 15:55:16 +01:00
74d4b95a70 Changed jenkins.sh 2014-01-31 14:31:55 +01:00
ee3b1dc11a Added jenkins.sh 2014-01-31 13:55:06 +01:00
126f149f0b Increased hearts restored by Apples 2014-01-31 13:33:49 +01:00
e12290202b Fixed #1135 Entity despawn race condition 2014-01-31 13:30:30 +01:00
974862996b replaced download_file 2014-01-31 13:26:04 +01:00
bcd312ea16 Removed OPCache when cross-compiling 2014-01-31 01:50:59 +01:00
5ff34b22b5 Include OPCache and generate default php.ini 2014-01-31 01:43:57 +01:00
8a9dcbb646 Calculate time offset only if date.timezone is not set 2014-01-31 01:19:51 +01:00
b7c0e08b7d such debug. much fix 2014-01-31 00:45:16 +01:00
13bf17925f compile.sh now supports cURL client 2014-01-31 00:43:47 +01:00
b56a56df2b Merge remote-tracking branch 'origin/master' into Faster-Network 2014-01-30 10:10:20 +01:00
7403516aab Added extra machine data to Utils::getUniqueID() 2014-01-30 01:13:58 +01:00
7560a5416e Replaced printf with echo 2014-01-30 00:42:10 +01:00
eca8fbce30 Fixed undefined index on Slab 2014-01-30 00:42:01 +01:00
f7af625407 Well... printf "\n" | 2014-01-30 00:39:32 +01:00
e15509c352 Removed Spyc 2014-01-30 00:36:51 +01:00
b481c94f45 Added new PHP YAML extension 2014-01-30 00:36:44 +01:00
d8f4e88e5d Fixed Entities not being despawned on restart if they were off-limits 2014-01-29 23:53:58 +01:00
60bc72c6cb Fixed undefined indexes on cases where plugins did things wrong 2014-01-29 20:41:57 +01:00
cd52cb9ae6 Added exec to start.sh 2014-01-29 20:02:16 +01:00
eeeb6d42c2 Added --with-mysqli=mysqlnd to compile script 2014-01-29 19:43:26 +01:00
e799376559 such fail :S 2014-01-29 19:11:47 +01:00
e7aea41f80 More changes ;). Start.sh now supports the new compile path 2014-01-29 19:07:43 +01:00
55f4811847 Oops ;) 2014-01-29 18:56:21 +01:00
ac2abccf41 Compile all PHP binaries 2014-01-29 18:43:13 +01:00
09720a59ec Added Utils::getUniqueID(), returns a machine ID and a even more variable machine ID 2014-01-29 17:07:01 +01:00
7e8ae3a1e1 Main source for ticks is in the packet loop, and PHP ticks as a secondary backup one 2014-01-29 16:22:58 +01:00
73db6cbb96 Removed BitDeli 2014-01-29 12:43:59 +01:00
f2703f5cfb Move BitDeli Badge. 2014-01-29 20:49:53 +10:30
0703145155 Merge pull request #1129 from bitdeli-chef/master
Add a Bitdeli Badge to README
2014-01-29 02:18:42 -08:00
aadef6e2d3 Add a Bitdeli badge to README 2014-01-29 10:20:50 +00:00
edd2331b40 Added GCC -pipe and changed optimization to -O2 2014-01-29 03:27:31 +01:00
079db8d234 Added option to skip save in ServerAPI::serProperty() 2014-01-29 02:36:21 +01:00
c88b1c97b3 Added advanced caching (enable-advanced-cache) 2014-01-29 02:24:02 +01:00
b4971abe91 Added base Cache class for integrated caching 2014-01-29 02:23:27 +01:00
a297574656 Level::unloadChunk() now uses the saveEnabled property 2014-01-28 21:46:29 +01:00
4bcea9b3e5 ¬¬ world 2014-01-28 12:57:46 +01:00
0a27783604 Fixed offset calculation 2014-01-28 12:50:53 +01:00
9a4bae7d64 Improved crash dumps 2014-01-28 12:50:42 +01:00
f8b270e33f such fix. I even made a regular expression to find these 2014-01-28 12:50:24 +01:00
1526c6cae9 Fixed "Take this ridiculously retarded IF formatting!" by @sekjun9878 2014-01-28 11:37:29 +01:00
4002d3013d More OCD 2014-01-28 11:36:18 +01:00
763adb0360 OCD. Blame @sekjun9878 for making me shout in the train 2014-01-28 11:27:55 +01:00
439c0e8280 Removed obsolete Java Random 2014-01-28 11:25:12 +01:00
4aa7b3eaf8 Allow custom arch. build on compiler 2014-01-27 19:28:29 +01:00
cdefcbd72a Fixed #823 /help outputs ansi colors 2014-01-27 18:19:45 +01:00
101402fe56 Fixed #854 return not-safe spawn when safe spawn is not available 2014-01-27 18:16:28 +01:00
c52f6c9376 Fix #1117 fix 2014-01-27 17:46:41 +01:00
76e4bf6d5f Fixed #1117 enforce new pthreads version 2014-01-27 17:41:42 +01:00
431c06073d Updated Travis-CI to PHP 5.5.x and pthreads to 0.1.0 2014-01-27 15:22:12 +01:00
ac8f2646a7 pthreads 0.1.0 and Thread::kill(). Needs fix 2014-01-27 15:18:20 +01:00
b7cf5d08cc Save and send hotbar history 2014-01-27 14:00:53 +01:00
624eb93058 Save and send last slot used by player 2014-01-27 04:00:26 +01:00
01015d0db3 Fixed #1114 Furnace item duplication cheat 2014-01-27 01:13:59 +01:00
f95e8a2c51 Merge pull request #1109 from pemapmodder/master
Include level in $data for event item.drop
2014-01-26 15:36:24 -08:00
d94239771e Merge pull request #1112 from JWhy/patch-2
/op command: Show usage info if no user specified
2014-01-26 11:27:11 -08:00
49e5d930f1 Level included in data for event item.drop 2014-01-26 20:44:26 +08:00
1b227153a9 /op command: Show usage info if no user specified 2014-01-26 13:21:51 +01:00
ec70dd476a Updated Korean, Dutch and Chinese set-up wizard translations 2014-01-25 01:15:56 +01:00
f432f110a4 Fixed invalid Position object on teleport 2014-01-23 19:02:09 +01:00
9f4b5a40e1 Merge remote-tracking branch 'origin/master' into Faster-Network 2014-01-22 23:13:43 +01:00
4ae1709196 Fixed #1100 Item multiplication cheat 2014-01-22 22:11:54 +01:00
edfcdd0c17 Fixed #1031 Correct face when block is replaced 2014-01-22 17:31:23 +01:00
dcd9dbd1dd Fixed #1032 undefined index on PrimedTNT entities 2014-01-22 17:29:23 +01:00
f4d96e3a9b Temp. fix for Ladders popping out 2014-01-22 13:09:27 +01:00
cfb3bbfbf2 Fixed #1058 2014-01-22 01:36:30 +01:00
e659f435df Merge pull request #1099 from repeat83/patch-1
Fixed invalid indexes for Tile Entities
2014-01-21 12:28:55 -08:00
c7d33ee267 hmmm it's feature? 2014-01-21 23:04:02 +03:00
bede216762 Added Chinese to the language list 2014-01-19 01:07:57 +01:00
c13cc7c91d Added Chinese, updated Korean, Russian 2014-01-18 20:48:04 +01:00
0977daa3b4 Fixes #519 #861 #940 #505 #590 #761 #129 compilation on 64-bit systems 2014-01-18 12:44:17 +01:00
218fb5df3e Trying to fix issue #519 2014-01-18 12:23:45 +01:00
c9ab5ee0e9 API version is now 12 2014-01-17 22:31:22 +01:00
cc57475f91 Added player.block.place.bypass and player.block.break.bypass 2014-01-16 23:09:56 +01:00
6cf8698826 Updated German 2014-01-16 22:33:50 +01:00
718c858632 Added French, updated Korean and German 2014-01-16 16:27:04 +01:00
7a2d90c6d0 Updated German, Korean and Japanese 2014-01-16 12:52:10 +01:00
ee7d2f4ebf Updated Japanese 2014-01-16 00:33:39 +01:00
b5406af32e Updated Russian 2014-01-15 23:30:19 +01:00
0949734d38 Updated Russian and Italian 2014-01-15 22:36:24 +01:00
a3d62056d8 Fixed extra \n 2014-01-15 20:53:10 +01:00
40bdfd33ac Added Japanese, Italian 2014-01-15 20:51:38 +01:00
c0b247dd72 Update nl_NL.ini
Dutch translation fixed
2014-01-15 20:26:34 +01:00
f7ac3f5e8a Updated German 2014-01-15 20:10:57 +01:00
36c416fada Use DejaVu Sans Mono for the MinTTY console 2014-01-15 19:57:46 +01:00
81d938cc53 Removed wizard from Travis 2014-01-15 18:09:09 +01:00
609544b1ec Removed debug instruction 2014-01-15 18:07:55 +01:00
e2c678c8a6 Added set-up Wizard 2014-01-15 18:07:35 +01:00
5fe8141ba0 Alpha_1.3.12 "Henteko Minecart" Development 2014-01-15 18:07:23 +01:00
6a7b03e1bf Updated PHP and cURL 2014-01-13 04:35:36 +01:00
8c648fc6f7 PocketMine-MP Alpha_1.3.11 「甘いビートルート」 Added CODENAME 2014-01-13 04:16:38 +01:00
6c5356fc80 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-01-13 03:35:56 +01:00
70445bdeba Added timeout to Utils::getOnline(), fixes #1071 [gh#1071] 2014-01-13 03:34:40 +01:00
65767312a3 Merge pull request #1064 from wrewolf/patch-2
Update Lava.php
2014-01-12 18:28:54 -08:00
2551bd64ca Merge pull request #1063 from wrewolf/patch-1
Update Water.php
2014-01-12 18:28:43 -08:00
1f360c8bfb Update Lava.php 2014-01-12 12:05:17 +03:00
65a7560185 Update Lava.php
Fix Remove for Left Lavas
2014-01-10 09:45:21 +03:00
860f723518 Update Water.php
Fix Remove for Left Waters
2014-01-10 09:43:31 +03:00
969f0f05b0 Fix #1037 2014-01-04 11:59:07 +09:00
1ce7366cc3 Merge pull request #1025 from InusualZ/patch-1
Level::getAll()
2014-01-03 18:52:44 -08:00
3ed2155c5b Merge pull request #1030 from wallace/patch-1
Update compile.sh
2013-12-27 20:44:43 -08:00
1cc12616e8 Update compile.sh
Properly escape nested double quotes.
2013-12-25 21:46:04 -05:00
e3d3f91c54 Level::getAll() 2013-12-23 20:15:53 -05:00
039edead18 Merge remote-tracking branch 'origin/master' 2013-12-19 18:42:58 +10:30
a141ea5018 Config Object PHPDoc 2013-12-19 18:42:45 +10:30
b63e49acf8 Fixed slot AIR offset 2013-12-18 18:01:06 +01:00
5dc52ad97d Add PHPDoc Documentation to block types. 2013-12-18 20:05:04 +10:30
5eed43ddd0 Added Level::startTime() and Level::stopTime() 2013-12-18 09:45:00 +01:00
9137a36b55 MCPE 0.8.1 version change 2013-12-18 09:44:42 +01:00
5623fa3601 Even more grammar! 2013-12-17 15:45:56 -06:00
78d72201ce (ノಠ益ಠ)ノ彡┻━┻ 2013-12-17 22:30:45 +01:00
a0019bfa73 redeclare fix ;) 2013-12-17 12:03:01 +01:00
de5a3175bc Data Packet initial parsing 2013-12-17 12:00:26 +01:00
e6aeb03ec5 Merge remote-tracking branch 'origin/master' into Faster-Network 2013-12-17 11:01:12 +01:00
d4057a2113 Fixed #997 carrots converting to potatoes [gh#997] 2013-12-17 10:34:24 +01:00
1eab1e382a Merge pull request #1007 from InusualZ/fix
Fixed Event "entity.explosion"
2013-12-16 18:40:04 -08:00
351ac0d7af Fixed Event "entity.explosion"
The event don't listen to the handler
2013-12-16 19:42:35 -05:00
b457e63d20 Reverted Item despawn timer 2013-12-16 17:12:25 +01:00
3ef2471041 More Changes 2013-12-16 15:49:28 +01:00
7bc9500484 Increased error level 2013-12-16 13:06:33 +01:00
6d4472a339 Added Source SHA1 sum 2013-12-16 13:06:31 +01:00
e0b8527560 First changes 2013-12-16 13:06:01 +01:00
050d3424f0 Fix #999. 2013-12-14 16:14:41 +10:30
01e9ca7852 Fix #971. Add lowercase checking of Config. 2013-12-14 16:06:28 +10:30
e2298d861c Fix #996 2013-12-14 15:27:38 +10:30
3248066a37 Increased error level 2013-12-13 15:52:17 +01:00
a0b93ed5ff Added Source SHA1 sum 2013-12-13 15:52:08 +01:00
a8f2225c4c PHP 5.5.7 2013-12-13 13:10:19 +01:00
1a7e916928 Fixed player heads not being rotated 2013-12-13 01:17:55 +01:00
2b0fdd5062 Time syncronized again 2013-12-13 00:52:55 +01:00
af8b380d10 Added Cobweb to Creative Inventory 2013-12-13 00:34:37 +01:00
90e598bb2c Added minecart item (not placeable) 2013-12-13 00:33:07 +01:00
4d0eb5e529 Fixed #988 2013-12-09 21:55:49 +01:00
02dc06c58b Fixed plugin path 2013-12-09 21:50:58 +01:00
c23fc0057a PHP plugins are now included using include() 2013-12-08 17:17:47 +01:00
1693f5655e Updeted to protocol 14 MCPE v0.8.0 build 8 2013-12-08 13:25:21 +01:00
565fe70c7e v0.8.0 alpha version 2013-12-07 13:50:14 +01:00
7cf662fb81 Only show private messages in console when the sender or the target is the console 2013-12-07 12:44:23 +01:00
894325aef6 ¬¬ 2013-12-06 01:50:48 +01:00
423ead6b64 Added item pickup animation 2013-12-06 01:49:47 +01:00
a0a7042d43 Look! New PluginAPI! 2013-12-06 01:24:41 +01:00
14e1dda327 Removed KiwiIRC chat, use official freenode webirc 2013-12-04 18:19:39 +01:00
3cffa66490 added Entity::setHealth() force 2013-12-03 22:25:25 +01:00
2b28e26392 Fixed map chunks bug 2013-12-03 20:39:28 +01:00
8543c06db4 Merge pull request #975 from wiezz/master
Allow chat plugins to work with eachother
2013-12-03 10:04:43 -08:00
adcf95f486 Fix
Send the normal message when $data["message"] is removed by a plugin.
2013-12-03 18:33:37 +01:00
736c233e76 Allow chat plugins to work with eachother 2013-12-03 18:26:38 +01:00
fd2eb7b230 OOPS! 2013-12-03 02:10:43 +01:00
bad8365e28 Fixed zero-length packets spamming the console 2013-12-03 02:07:33 +01:00
e9e59c33cc Fixed 969 2013-12-02 17:45:01 +01:00
8532f53f8e Schedule player kick so it can read the reason 2013-12-02 01:00:11 +01:00
230a3c00fc Removed LevelAPI::isLoaded()
Not needed, everything can be obtained with current methods
2013-12-01 22:01:04 +01:00
d515da8963 Fixed Level::setMiniChunk() parameter bug 2013-12-01 21:37:33 +01:00
f5d69e6905 Fixed Level::getMiniChunk() parameter bug 2013-12-01 21:32:35 +01:00
bcf6571cc2 Delete PermissionsAPI. 2013-12-01 23:52:31 +10:30
7d0ff5e073 Formatting OCD
Please refer to CONTRIBUTING.md
2013-12-01 14:16:38 +01:00
5e2de356bf Modified update system to check the Github API 2013-12-01 14:14:37 +01:00
2d67af6fbd Sugarcane now grows when using bonemeal 2013-12-01 14:14:36 +01:00
bd8110edab MCPE v0.8.0 alpha build 5 2013-12-01 14:14:35 +01:00
25cd58bd99 Merge remote-tracking branch 'origin/master' 2013-11-30 13:10:27 +10:30
a6cd8ece1b Added isLoaded function to LevelAPI. Fixes #959. 2013-11-30 13:10:02 +10:30
0bac7418db Updated StackableArray 2013-11-29 00:18:38 +01:00
a4e38689db Added REDSTONE constant 2013-11-27 23:19:48 +01:00
f3f61e7a4a Cobblestone Walls height handling 2013-11-27 17:41:39 +01:00
bc48e70d6c Remove fire effects on Creative mode 2013-11-27 17:24:33 +01:00
b21ee37c07 MCPE v0.8.0 alpha build 4 2013-11-27 17:22:41 +01:00
2f7e5688e2 Fixed #418 Placing blocks on top of Snow replaces it now 2013-11-27 15:28:10 +01:00
0d6ae6067c Fixed #956 BEETROOT_BLOCK typo 2013-11-27 12:10:26 +01:00
3337e5980e Added ZIP to compile script 2013-11-27 00:18:13 +01:00
493b7532df Removed debug code 2013-11-26 17:28:48 +01:00
bd0d708274 Fixed Packet of Death 2013-11-26 17:23:45 +01:00
5ad72b4f49 Return a bowl when eating stew or soup 2013-11-26 15:29:34 +01:00
7b9edffa47 Mushroom Stew and Beetroot Soup are no longer stackable 2013-11-26 15:23:39 +01:00
6e9b70c9cb Better Tall Grass generation with bonemeal 2013-11-26 13:32:19 +01:00
0f01570d01 "Better" Tall Grass drops 2013-11-26 13:20:19 +01:00
cf5bc916c0 Reordered Creative inventory 2013-11-26 13:15:56 +01:00
35119befd9 Tall Grass now drops Melon and Pumpkin seeds with a probability of 1/15 2013-11-26 12:46:30 +01:00
02150da862 Tall Grass can now drop Carrots, potatoes, beetroot seeds 2013-11-26 12:45:27 +01:00
2044269d86 Added Shears, bedrock and Dyes to creative inventory 2013-11-26 12:42:09 +01:00
2d3ba111e0 Rewrote Generic Explosion drop 2013-11-26 12:28:05 +01:00
98097b0703 Check for $newPermissions is_array 2013-11-26 21:38:48 +10:30
c4ba06b58c Add Restriction Interface 2013-11-26 21:32:08 +10:30
3e12a41a91 permissions.request function use instead of additional argument for player variable. 2013-11-26 21:20:44 +10:30
daaa9394c4 PermissionsAPI Basic Structure Complete. Now uses restrictions. Player dedicated emitEvent functions. Use more anonymous functions. 2013-11-26 21:17:44 +10:30
71a1986980 Add EventRestriction 2013-11-26 20:00:15 +10:30
3352c36ba4 Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2013-11-26 15:15:30 +10:30
d2fa06cb64 More comments. 2013-11-26 15:15:24 +10:30
0e9458fafc Merge pull request #950 from InusualZ/test
Fixed #332. Temporary Silk Touch fix. Replace this system with class-based silk touch variable.
2013-11-25 20:32:58 -08:00
75e4174a2b Repaired 2013-11-25 19:31:40 -05:00
509e67bfb7 No More Silk Touch On Explosion 2013-11-25 19:28:59 -05:00
0d25118eef Fixed gh#332
Crafting with buckets (milk) returns the bucket
2013-11-25 18:53:36 -05:00
c798a33363 Fixed gh#332
Crafting with buckets (milk) returns the bucket
2013-11-25 18:53:02 -05:00
5fc192b730 Fixed gh#332
Crafting with buckets (milk) returns the bucket
2013-11-25 18:27:34 -05:00
286b30cf4e Giant typo 2013-11-25 18:36:03 +01:00
a0fac71385 Added coding standards by request of @sekjun9878. Fixed #949 [gh#949] 2013-11-25 18:34:06 +01:00
273a74d566 Added Beetroot Soup food value 2013-11-25 18:01:19 +01:00
aefcab9a49 Really minor changes. 2013-11-25 22:37:30 +10:30
f5989d461c Fix possible variable bug with /tell. 2013-11-25 22:06:25 +10:30
68076fedc8 Some PHPDoc comment updates. 2013-11-25 22:05:07 +10:30
2339525478 Merge remote-tracking branch 'origin/master' 2013-11-25 20:34:57 +10:30
62f5f0d325 Add PHPDoc information to sub-APIs. 2013-11-25 20:34:48 +10:30
0ac81968b7 OCD 2013-11-25 11:02:33 +01:00
b8763a7a3f Add PHPDoc information for API parsing. 2013-11-25 20:28:19 +10:30
249e83db91 Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2013-11-25 20:11:57 +10:30
e6f855abbd Add Default permission, and remove construct restriction in Permission interface. Note that all changes on permission API are untested therefore not enabled by default. 2013-11-25 20:11:38 +10:30
75e1a6e97e Added bowl crafting 2013-11-25 09:52:28 +01:00
fb9f7891c7 Added Beetroot soup, beetroot seeds, crafting 2013-11-25 09:42:41 +01:00
03e71ee3ff Added comment in Player.php 2013-11-25 09:35:54 +01:00
9cf91ca3fa Added beetroot IDs
TODO: Beetroot Soup ID
2013-11-25 09:34:57 +01:00
fc7c14ae16 BeetRoot soup doesn't need a class 2013-11-25 09:34:36 +01:00
5ac0907aeb Added $permissions property to Player so pthreads doesn't crash 2013-11-25 09:31:02 +01:00
2f3817322b Formatting OCD 2013-11-25 09:28:41 +01:00
624219f680 Merge remote-tracking branch 'origin/master' 2013-11-25 18:57:33 +10:30
646390812a Beetroot Soup Item template. @shoghicp Add in the Item ID to ItemID.php constants file. 2013-11-25 18:57:13 +10:30
7190d444e3 Revert "Remove Achievement API. Alters game play mechanics."
This reverts commit 2621aab2ef.
2013-11-25 09:26:12 +01:00
bfe0d04663 More notes in Contributions.md 2013-11-25 09:25:48 +01:00
44d63c74dd Update some comments on the recipes. 2013-11-25 18:50:01 +10:30
d7d5e66de6 Use interfaces and closures and abstracts and anonymous functions and all the fancy OOP PHP stuff. 2013-11-25 18:33:12 +10:30
eb7d8a3240 Minor Adjustments 2013-11-25 18:05:21 +10:30
698feccd54 Minor Adjustments. 2013-11-25 18:04:47 +10:30
d3e8cba132 Basic PermissionsAPI template for others to improve. 2013-11-25 18:02:31 +10:30
2621aab2ef Remove Achievement API. Alters game play mechanics. 2013-11-25 17:39:19 +10:30
6ab29f993d OCD 2013-11-24 23:29:17 +01:00
d11cf83a47 Added note about pull requests 2013-11-24 23:26:12 +01:00
336a40ae90 Merge pull request #947 from 99leonchang/master
Multiple orders for /gamemode
2013-11-24 14:20:04 -08:00
a8055eb59a Warn about not using the bin/ PHP binary 2013-11-24 20:09:04 +01:00
2b920033ff Drop boots on death 2013-11-24 19:23:56 +01:00
8665035381 Added Cocoa Beans crafting 2013-11-24 19:01:24 +01:00
e0021b8927 Fixed first hotbar item in Creative 2013-11-24 18:43:14 +01:00
44a9639150 Fixed POTATOE constant 2013-11-24 18:41:57 +01:00
e700179bb0 Multiple changes
* Fixed hoe durability
* Fixed some blocks hitbox
* Added Creative pseudo-inventory
* Added Carrots and Carrot Crops
* Added Potatoes, Baked potatoes and Potato Crops
2013-11-24 18:38:37 +01:00
f8d8052ec3 Correct placement for cakes and snow layers 2013-11-24 15:52:35 +01:00
0dc783f285 Added carpets, crafting recipes, placement 2013-11-24 15:50:02 +01:00
7cd5c5cde1 Fixed paintings resetting the hotbar 2013-11-24 15:18:58 +01:00
3968f3b298 Jungle Tree generation placeholder 2013-11-24 15:12:31 +01:00
9105e59f2a Jungle Sapling 2013-11-24 15:12:14 +01:00
5ac92ee0db Formatting 2013-11-24 20:48:03 +08:00
b5a53c04ac Merge pull request #5 from PocketMine/master
Fixed Wheat recipes
2013-11-24 04:40:15 -08:00
a93798719f Fixed Wheat recipes 2013-11-24 13:38:53 +01:00
1eda0d72a8 Different orders for /gamemode 2013-11-24 20:38:40 +08:00
1331c8aeb2 Merge pull request #4 from PocketMine/master
Update
2013-11-24 04:36:13 -08:00
b9e2576208 f 2013-11-24 20:34:58 +08:00
c25607588b Added sideway Hay Bales 2013-11-24 13:32:21 +01:00
ff8363e2ae Added Wooden Slabs, Double Wooden Slabs, new Wooden Slab crafting 2013-11-24 13:22:09 +01:00
64f7a78329 Added achievement.grant and achievement.broadcast handlers for more customization 2013-11-24 12:18:50 +01:00
f377eacc0f Merge pull request #3 from PocketMine/master
Update
2013-11-24 03:11:57 -08:00
8e452831e1 Fixed undefined $orderingChannel 2013-11-24 12:04:40 +01:00
2483614459 Merge pull request #944 from lloydw/master
Fix argument parsing
2013-11-24 02:52:17 -08:00
53fd9cb466 Merge pull request #945 from 99leonchang/master
AchievmentAPI logic change
2013-11-24 02:51:11 -08:00
1c5b473b36 Added player.craft handler 2013-11-24 11:45:18 +01:00
918fb62ce9 Logic changes 2013-11-24 12:42:31 +08:00
1350e1bc4e Merge pull request #2 from PocketMine/master
Update
2013-11-23 20:33:33 -08:00
5d53c259cf Fix argument parsing 2013-11-24 16:27:09 +13:00
5a71043ab0 Fix 2013-11-24 01:52:23 +01:00
6ff6a5fc91 More achievements 2013-11-24 01:10:05 +01:00
6de602a174 Fixed Coal Block ID 2013-11-24 00:52:21 +01:00
3ff4b9eae0 Achievements API 2013-11-24 00:51:04 +01:00
ae8c934b5f Allow accessing Config data keys directly 2013-11-23 19:14:45 +01:00
5803a4e649 Added Coal Blocks, crafting, fuel information 2013-11-23 18:18:02 +01:00
78f7964d57 Fixed bread crafting & added Hay Bales 2013-11-23 18:09:04 +01:00
78f9e40730 Added Compass and Clock 2013-11-23 17:54:19 +01:00
a0ca572d1f Added Cobblestone Walls, Mossy Stone Walls, crafting recipes, correct drops 2013-11-23 17:40:22 +01:00
af66e5a444 iron bars crafting 2013-11-23 17:23:03 +01:00
1ad00a453b Added Iron bars, Pumpkins, lit pumpkins and pumpkin grow, pumpkin growth, pumpkin seeds, pumpkin pie... 2013-11-23 16:36:30 +01:00
5fa6c5962e Added more Wood stairs, and planks 2013-11-23 15:51:09 +01:00
de98dd920b Sponges added 2013-11-23 15:34:32 +01:00
1a0bccf288 Sideway logs placement & correct drop 2013-11-23 15:21:48 +01:00
e4221b8552 Redstone Ore drops Redstone dust 2013-11-23 13:56:47 +01:00
ba7c9503d8 0.8.0 partial compatibility
* Not compatible with Creative mode
2013-11-23 13:52:13 +01:00
3d53b9eb3a Armor drop - tested 2013-11-23 11:06:01 +01:00
f32f379e97 Lava flow code reformatting 2013-11-23 11:04:36 +01:00
809ca802b3 PocketMine-MP Alpha_1.3.10 Stable Release 2013-11-23 11:00:22 +01:00
719df75886 Water flow code reformatting 2013-11-23 10:59:52 +01:00
14a40ac11e Remove keycodes from console input 2013-11-23 10:46:24 +01:00
c973abc36f Added --disable-ansi to disable console colors #887 2013-11-23 10:22:24 +01:00
54d37a432e Check that ServerAPI::request() works, fixes #916 [gh#916] 2013-11-23 10:17:38 +01:00
c7168a6c64 Fixed #926 [gh#926] 2013-11-23 10:11:25 +01:00
079d24055d Updated compile script
* PHP 5.5.6
* pthreads 0.0.45 (stable!)
* cURL 7.33.0
2013-11-22 23:42:48 +01:00
b1748b5393 Removed language include 2013-11-22 15:28:28 +01:00
dafb12c3d3 Merge pull request #1 from PocketMine/master
Merge pull request #930 from beN39sGroup/master
2013-11-22 05:58:19 -08:00
b66f34b308 Merge pull request #930 from beN39sGroup/master 2013-11-22 23:59:50 +10:30
1cb711d32d Temporaily fix multilanguage bug. Waiting on pull request author to remove multi language. 2013-11-22 22:56:02 +10:30
94a9b7b431 Merge pull request #925 from beN39sGroup/master
Liquid Performance
2013-11-22 03:12:16 -08:00
7acdb0dd3f Fix Performance Problem
Welcome, TPS!
2013-11-17 09:39:40 +09:00
fe70fa467d Slower Unflow & Basic for Multi Language
Slower Unflow!
I wanna Multi Language!
2013-11-15 19:14:02 +09:00
d4a5e4e5c4 Merge pull request #920 from beN39sGroup/master
Liquid Flowing. This requires further testing before stable release.
2013-11-12 21:48:02 -08:00
db289f9871 Mixable Lava & Water
I Wanna Make Cobblestone Generator!
2013-11-10 22:11:45 +09:00
b822b314cb Simple Flowable Lava & English Comment
Still A Flowing
2013-11-10 17:59:36 +09:00
77ca6da14c Simple Flowable Water!
Meet the 'Flowing' Water.
2013-11-10 17:19:50 +09:00
9373c93737 Prefix for Kick Flying when Player on Fence 2013-11-10 13:52:41 +09:00
cb47bf82c9 Reset player's armors after death UNTESTED. Fixes #896. 2013-11-09 20:44:09 +10:30
3498c876df Reset player's armors after death 2013-11-09 20:43:06 +10:30
df01e92ab6 Merge pull request #886 from JWhy/patch-1
Extract plugins/ path lookup to pluginsPath() function in PluginAPI
2013-11-09 01:34:54 -08:00
1f1f955eef Add plugin name info to Evaluation Error. 2013-11-09 20:00:24 +10:30
0e471ab38c Fixed leftover reference in pluginsPath() function 2013-10-22 14:53:12 +02:00
9f211bd7fb Extract plugins/ path lookup to pluginsPath() function in PluginAPI 2013-10-22 14:05:11 +02:00
af486917a1 Fixed #884 2013-10-22 21:26:30 +10:30
c197a58a3a Merge pull request #881 from JWhy/patch-1
Use DIRECTORY_SEPERATOR constant for safer cross-platform file access
2013-10-21 04:22:23 -07:00
ca0d682d87 Use DIRECTORY_SEPERATOR constant for safer cross-platform file access 2013-10-21 12:27:48 +02:00
70ec644658 Merge pull request #880 from JWhy/patch-1
Support other local date format for timezone detection to avoid startup errors
2013-10-20 21:55:48 -07:00
a860f16f4a Support other local date format for timezone detection to avoid startup errors
fixes PocketMine/PocketMine-MP#718
2013-10-21 06:12:27 +02:00
9ac72026b9 Fix #831 2013-10-19 11:47:53 +10:30
0ad0071107 Fix crash bug when @all is used in console. 2013-10-19 11:28:43 +10:30
386b2cb0ef Fix 805 2013-10-19 11:20:33 +10:30
58fce0e939 Fix /me @all critical server crash bug. Fix #840. Disabled usage of @all for non-ops. 2013-10-19 11:12:54 +10:30
780f60554d Fix #871 2013-10-19 10:58:49 +10:30
4aa0ae86fb Update config.php 2013-10-18 18:04:45 +10:30
f005b82a70 Fixed typo. Not Longer -> No Longer 2013-10-09 13:09:35 +10:30
c35c004827 Added the ability to shoot arrows
Credit to ljyloo (http://forums.pocketmine.net/index.php?threads/shooting-arrows-in-pm-server.508/#post-4338).
2013-10-08 16:52:37 -05:00
e179de1613 Better :3 2013-10-02 16:57:37 +02:00
3354df0360 More KiwiIRC Buttons 2013-10-03 00:25:38 +09:30
d8cfc06d3a KiwiIRC! 2013-10-03 00:24:48 +09:30
3b0e553e17 Merge pull request #812 from Humerus/patch-2
Made it so deop doesn't op the player.
2013-09-15 13:18:26 -07:00
c53ea830ea Made it so deop doesn't op the player. 2013-09-15 12:00:00 -04:00
0c1afe15fd Added .idea to .gitignore 2013-09-11 11:13:09 +02:00
6a24700f6e Fix compiler again 2013-09-10 22:52:24 +02:00
000dfc8601 Fix 64 bit builds 2013-09-10 22:49:33 +02:00
a011ad8fb6 Reverted DIAMOND_HOE to IRON_HOE 2013-09-10 20:11:31 +02:00
d41c30945b Level optimizations 2013-09-09 10:44:50 +02:00
b3c51c6d2e Faster level generator 2013-09-09 03:32:24 +02:00
4ccaccc126 Fixed Player::setSpawn() 2013-09-08 15:37:28 +02:00
8aef462a68 Fixed #784 Slabs replacing other slabs 2013-09-08 10:45:36 +02:00
c4a5a9c849 Better explosion damage calculation 2013-09-08 01:35:48 +02:00
275e27f7a9 Low level PMF level interface 2013-09-08 01:21:40 +02:00
1abe7626bf Using Vectors for explosions 2013-09-08 00:27:35 +02:00
7c9255e21e Incremented speedMeasure() size 2013-09-07 21:27:05 +02:00
0c6eaa0609 Fixed entity motion condition 2013-09-07 21:19:47 +02:00
1bc3b66afd Player check is done with equal name, not alike 2013-09-07 14:24:17 +02:00
df174d1b8e Tuned power again xD 2013-09-07 13:35:32 +02:00
f56dd60708 Correct item drop related to explosion power 2013-09-07 12:37:04 +02:00
2271d0b6fc Lowered TNT explosion force from 4 to 3 2013-09-07 12:28:18 +02:00
6d2eea8887 Level::getSafeSpawn() on player normal spawn 2013-09-07 12:05:04 +02:00
fb2bcdb722 Level::getSafeSpawn() look for solid block 2013-09-07 12:04:49 +02:00
c8dd85de75 Better fuse calculation 2013-09-07 11:55:14 +02:00
a00375b1a9 Perfect explosions 2013-09-07 11:40:22 +02:00
e7e05d37b3 Moved -mx32 flag 2013-09-07 10:30:08 +02:00
6ac54925ff Added -mx32 flag 2013-09-07 10:26:22 +02:00
555da94612 Moved patch location :P 2013-09-07 10:21:42 +02:00
774debb299 Fixed #781 2013-09-07 10:18:06 +02:00
9b63a0b0bf Fixed colors on MacOS 2013-09-07 10:13:14 +02:00
397b47d719 Added secondary explosions 2013-09-07 02:51:15 +02:00
5952e34995 PrimedTNT Entity implemented 2013-09-07 02:46:18 +02:00
0ddc48ca80 Vanilla-alike Explosions 2013-09-07 01:28:15 +02:00
24211764ce Tuned TNT force 2013-09-06 22:17:13 +02:00
4a2e3d3611 Fixed Flint & Steel order 2013-09-06 19:33:16 +02:00
e5841e623e Fixed comparison order with flint & steel metadata 2013-09-06 17:50:01 +02:00
215141d552 Added Diamond Hoe, Flint & Steel and Diamond Sword to the Creative inventory 2013-09-06 17:40:07 +02:00
94f8cfb59b Added Single Explosions [ignite TNT using fling & steel] 2013-09-06 13:46:52 +02:00
41b1a0f991 Fixed bottom bed offset 2013-09-05 22:58:49 +02:00
08d93fa021 Fixed #774 [gh#774] 2013-09-05 19:58:31 +02:00
ce65801d14 Keep window open 2013-09-05 17:17:54 +02:00
bb9923d210 Fixed position offset when sleeping on beds 2013-09-05 15:19:27 +02:00
ccac35d5a2 Fixed player catching fire after death 2013-09-05 00:39:06 +02:00
c11ee468a2 Added Door sounds 2013-09-05 00:37:07 +02:00
e48126a0c9 Fixed possible cases on infinite loop on addItem and removeItem 2013-09-04 21:29:21 +02:00
b56ee69f0d Alpha_1.3.10dev 2013-09-04 21:27:13 +02:00
4a46d8fd9c Fixed possible infinite loop in hasSpace 2013-09-04 21:26:22 +02:00
f29181a8ee Removed check on start.cmd 2013-09-04 20:49:25 +02:00
8515e7ff33 Fixed speed limiter 2013-09-04 20:49:14 +02:00
9db1b741a7 Another Typo ¬¬ 2013-09-04 20:34:48 +02:00
401c201a97 Fix start.cmd ¬¬ 2013-09-04 20:27:49 +02:00
fc3fb651b2 Fix fix fix 2013-09-04 20:25:36 +02:00
b4bfceeb6d Added README credits :) 2013-09-04 20:03:59 +02:00
a965103a03 Windows installer fix 2013-09-04 19:59:12 +02:00
f569587764 Alpha_1.3.9 2013-09-04 19:53:42 +02:00
1a9641e93a Dynamic title fix 2013-09-04 19:52:37 +02:00
b297ba16ed New starting scripts for mintty 2013-09-04 19:49:32 +02:00
809076b7d7 Added new text formatting system for future updates [like vanilla PC] 2013-09-04 19:49:19 +02:00
56d829eec6 Fixed #767 Players move laggy [gh#767] 2013-09-04 19:33:11 +02:00
7f15b27ff0 Fixed server crash when two players sleep together 2013-09-04 17:13:03 +02:00
28afadce0a Max chunk rate: 172kB/s => 256kB/s 2013-09-04 13:37:52 +02:00
ae92c968b4 PocketMine-MP Alpha_1.3.8 stable 2013-09-04 13:34:08 +02:00
2a2f2d8043 Changed newest MCPE version to 0.7.5 2013-09-04 13:33:50 +02:00
c9a7067e3f Added date on server logs 2013-09-04 13:32:36 +02:00
160aa3a199 Improved scripts 2013-09-04 13:29:27 +02:00
2b24dab57b Modified startup messages 2013-09-04 13:29:05 +02:00
49b7f60662 Doors fall when the block below is removed 2013-09-04 13:00:04 +02:00
19112f0d06 Updated blocks direct break 2013-09-04 12:59:08 +02:00
cf8e3e41ba Fixed Ice converting to water on creative 2013-09-04 12:56:35 +02:00
aff9349d20 Fixed SignPost Tile remove on block update break 2013-09-04 12:48:35 +02:00
71dd3fe3af Send broken bed block directly [no cache] 2013-09-04 12:41:04 +02:00
bee3e7d67a Fixed players sleeping on the same bed 2013-09-04 12:36:50 +02:00
dd5b1869e2 /spawn teleports to the server spawn instead of the player spawn 2013-09-04 10:49:19 +02:00
724d336853 Fixed blocks being placed on beds during day 2013-09-04 10:30:48 +02:00
3fe3aa2a62 Added force position on teleport [Fixes #356 gh#356] 2013-09-04 01:04:51 +02:00
bb9420753d Round of teleports on spawn 2013-09-03 22:55:47 +02:00
f14999c57f Check phase on sleep 2013-09-03 22:53:53 +02:00
40a20d1467 Send correct spawn position (client-side check) 2013-09-03 22:52:17 +02:00
4d2dc63182 Schedule a teleport on chunk load 2013-09-03 22:51:02 +02:00
1677ce4b1d Adds beds 2013-09-03 22:50:47 +02:00
f7508adb29 Fixed TimeAPI bugs 2013-09-03 22:40:48 +02:00
d86c9982b3 Fixed some item stack size 2013-09-03 20:33:15 +02:00
241a66f5d8 Stonecutter recipes fix 2013-09-02 01:13:21 +02:00
dc940ffcb6 Fix for cross compiling php 2013-09-01 13:51:40 -05:00
58d8fc339e Fix for invalid CPU usage limit 2013-08-31 21:26:55 +02:00
4d4786dc0d Fixed packet index when opening a furnace 2013-08-31 19:27:22 +02:00
8c6bf01815 Alpha_1.3.8dev 2013-08-31 19:26:50 +02:00
27b90c5a9a Stable Alpha_1.3.7 2013-08-30 17:51:33 +02:00
84deac3ef7 Reduced random range 2013-08-30 17:51:12 +02:00
5395f15fe7 Get block drops before breaking [fixes tile drops] 2013-08-30 17:48:46 +02:00
399f9b808b Random pos on item drop 2013-08-30 17:47:54 +02:00
82c655c09a Fixed first slot on Double chests 2013-08-30 17:37:16 +02:00
f6bbedbe91 Updated chests to 0.7.4 RC 2013-08-30 17:09:15 +02:00
77c35dd18e Removed fish from smelting data 2013-08-30 17:09:05 +02:00
ee3ae561b8 Removed fish from Player eating 2013-08-30 16:58:34 +02:00
08ed5dbfac Merge remote-tracking branch 'origin/0.7.4' 2013-08-29 19:47:25 +02:00
a21bb5ab6d Revert "Revert "Roll back""
This reverts commit e1e804ffe3.
2013-08-29 18:52:12 +02:00
fe681cb786 Removed character range check for UTF-8 full support 2013-08-29 18:35:57 +02:00
f609c40bdc Added homepage info on start.cmd 2013-08-29 13:36:09 +02:00
dc5b8ecd30 Fixed low TPS 2013-08-29 09:21:52 +02:00
31bf65ad5c Fixed test + output 2013-08-28 23:42:40 +02:00
d347137148 Removed obsolete Data.php 2013-08-28 23:37:47 +02:00
e1e804ffe3 Revert "Roll back"
This reverts commit 29504c09f263e73492c6ffecea201a81dcf3591d.
2013-08-28 20:55:58 +02:00
71fc3f2ef0 fix 2013-08-28 20:31:45 +02:00
ad1930da88 Custom unit test code. 2013-08-28 18:19:48 +02:00
251859921d $server global 2013-08-28 17:50:39 +02:00
549ad5eff1 Async thread remove on NO_THREADS 2013-08-28 17:41:01 +02:00
b8594ab48f Firce exit(0) 2013-08-28 17:33:29 +02:00
3608ee1194 Moved conditional class 2013-08-28 17:17:34 +02:00
eba33b0e00 Again :'( 2013-08-28 17:13:33 +02:00
06ce84e275 test with debug 2013-08-28 17:07:42 +02:00
feea39a97f test again 2013-08-28 17:02:04 +02:00
5d27a40a6e Remove test suites on compile 2013-08-28 16:54:04 +02:00
d8124d9ddd Removed MobAPI from ServerAPI 2013-08-28 16:49:18 +02:00
392c8d273e phpunit configuration file 2013-08-28 16:48:50 +02:00
29d089db5b Added default class 2013-08-28 16:41:57 +02:00
f5e640c875 Oops, added class name 2013-08-28 16:37:31 +02:00
46e6cd37b7 Merge remote-tracking branch 'origin/master' into 0.7.4 2013-08-28 16:08:51 +02:00
13a5a8df57 Check phpunit classes 2013-08-28 16:07:53 +02:00
f9c405d46a NO_THREADS mode for tests 2013-08-28 16:00:30 +02:00
a07ae731e3 Removed self-kill [will it blend?] 2013-08-28 15:45:15 +02:00
8dcb404bce Correct server object 2013-08-28 15:36:14 +02:00
56fdc87e9b Changed automatic init to manual startup 2013-08-28 15:32:16 +02:00
ff4970578a Moved requires() 2013-08-28 15:27:24 +02:00
4d53d07def Moved tests 2013-08-28 15:24:18 +02:00
9d3379daca Removed MobAPI
Why was that here?
2013-08-28 14:30:27 +02:00
070e9ebbae Removed tests building 2013-08-28 14:20:29 +02:00
8da61e613f Send sign text on update 2013-08-28 11:01:45 +02:00
2fff23019a PHP 5.5.3 2013-08-27 21:22:08 +02:00
093b86fa43 Fixed URL 2013-08-27 19:16:11 +02:00
9d52250afa Fixed flint&steel usage 2013-08-27 19:15:18 +02:00
4cdb751a67 Removed fish items 2013-08-27 18:28:52 +02:00
36ff8331b7 Updated headers 2013-08-27 18:16:57 +02:00
c73c1eb806 Fixed clearQueue() action not being deleted 2013-08-27 17:29:55 +02:00
41084f51a6 Removed double chests 2013-08-27 14:03:48 +02:00
1055ab6a79 Fixed chests 2013-08-27 13:48:08 +02:00
d61f7b889f Fixed level importing 2013-08-27 13:47:26 +02:00
5d6d30ed4e Chest unpairing 2013-08-27 13:06:43 +02:00
176c371330 Added chest pairing 2013-08-27 12:38:00 +02:00
e8c273fc10 Updated Chests [part1] 2013-08-27 02:08:04 +02:00
9e337e21d2 Implemented Level::getSafeSpawn() 2013-08-27 00:22:06 +02:00
4a05f04a00 Sign NBT data on Player, send chests NBT 2013-08-27 00:02:07 +02:00
291ba5c499 Removed third-party NBT link 2013-08-26 23:37:13 +02:00
2de8f95af4 Fixed empty signs on world load 2013-08-26 23:36:28 +02:00
3d5541696b New chat protocol 2013-08-26 23:35:18 +02:00
9ec51b18fe Update Tiles to use NBT 2013-08-26 23:35:04 +02:00
ff99aab6ff New NBT parser/writer 2013-08-26 23:29:56 +02:00
515affa1a7 New API version 2013-08-26 23:29:46 +02:00
3c348f2e22 Added new EntityData Packet 2013-08-26 23:29:32 +02:00
f14c5ec90c Updated version to 0.7.4 2013-08-26 18:36:58 +02:00
dc0577dcfa 0.7.4 compatibility update - new chat message handling [part1] 2013-08-26 18:16:30 +02:00
3779a66bdb Cake is now broken if the bottom block is removed [MCPE-4661] 2013-08-26 15:35:20 +02:00
4156aad71f Preparing 0.7.4 features 2013-08-26 15:32:35 +02:00
a66c1c76f8 Updated links 2013-08-26 13:47:47 +02:00
5f214b0984 Removed chcp from start.cmd 2013-08-26 13:47:39 +02:00
a0bd42712f Dev release version :) 2013-08-26 12:10:45 +02:00
ffc95bf311 Fixed {} 2013-08-26 11:10:25 +02:00
673515bc06 Fixed issues with DevTools 2013-08-26 11:04:21 +02:00
7865b8dbe5 Fixed #748 Player health not being saved [gh#748] 2013-08-26 10:01:12 +02:00
30483d5312 Added Shears check and drops [gh#749,750] 2013-08-25 20:40:36 +02:00
02a8a3e881 Quartz slab recipe added 2013-08-25 20:18:24 +02:00
6dc33791a7 Reload Bugfix 2013-08-22 19:40:20 +09:30
54f058de3e Config Reload 2013-08-22 19:30:27 +09:30
dfd451f620 Simplificated fix 2013-08-22 11:56:57 +02:00
85af510d74 Update ConsoleAPI.php 2013-08-22 19:21:50 +09:30
06554e8669 Added output initialization to allow monitoring of commands. 2013-08-22 19:18:17 +09:30
a91dee0e04 Do not check type on actions 2013-08-22 02:35:13 +02:00
f5492aac91 Stone brick recipe derp 2013-08-22 02:02:25 +02:00
8b5bd8f206 Removed invalid Cookie item 2013-08-21 21:27:19 +02:00
111c716c21 Merge pull request #735 from brandon15811/master
Add support to cross-compile for Mac from Linux
2013-08-21 11:23:46 -07:00
5175e1f297 Add support to cross-compile for Mac from linux 2013-08-21 12:50:31 -05:00
e0390d0f54 Rewrote a bit of Player::teleport() 2013-08-21 14:57:13 +02:00
f7abb6f909 Do not update water 2013-08-21 13:20:14 +02:00
c3517a4a49 compile script armv7a for Android 2013-08-20 23:50:13 +02:00
3cc4ee0281 Alpha_1.3.6 2013-08-20 22:47:00 +02:00
1ca87c7ade Rewrote Location table handling on Pocket Level Format parser [due to MCEdit bug] 2013-08-20 22:46:01 +02:00
6bafcbf2a7 Revert "Lowered process delay"
This reverts commit b905aabd19.
2013-08-20 21:15:06 +02:00
ea2ff5d983 Paintings now have health 1 always 2013-08-20 21:06:44 +02:00
b905aabd19 Lowered process delay 2013-08-20 21:06:31 +02:00
50f6bf7825 Fixed android build script 2013-08-20 19:17:48 +02:00
5ee2ad6a17 Added generic-armv7-a to compile script 2013-08-20 17:45:32 +02:00
26ce2e9e13 Added PocketMinecraftServer::process() limit based on #436 2013-08-20 16:57:23 +02:00
55cfc2895d Fixed Leggins/Pants crafting recipe 2013-08-20 13:13:43 +02:00
3ba213f2f0 Proper same armor check 2013-08-20 12:52:06 +02:00
6c941977f3 Fixed possible armor crash 2013-08-20 12:49:09 +02:00
ea17ff9d9b Alpha_1.3.5 release 2013-08-20 12:25:49 +02:00
1b72ef8827 Better Player:close() cleanup 2013-08-20 11:31:37 +02:00
a34595292d Allow armor replacing (changing armor to another armor) 2013-08-20 11:23:55 +02:00
e42314ade7 Fixed block durability 2013-08-20 04:53:22 +02:00
5683dca9f6 Fixed crash 2013-08-20 02:57:37 +02:00
b5c935559f Alpha_1.3.4 2013-08-20 02:32:47 +02:00
7a37b0e4bf Quartz slabs 2013-08-20 02:24:15 +02:00
19b3ac4a99 Fixed disconnection 2013-08-20 02:15:18 +02:00
bf1b00f0e6 Correct teleporting with the new player list handling 2013-08-20 02:06:14 +02:00
7102787aa9 Added correct handling of RemovePlayer packet for in-game player list 2013-08-20 01:42:45 +02:00
d26d657b95 Fixed /difficulty 2013-08-20 01:16:24 +02:00
3374bbcc9e Chest animations for everyone! Woo! 2013-08-20 00:26:37 +02:00
8d408996f4 Double chest checks, chest opening broadcast 2013-08-19 21:05:09 +02:00
68e78ba40b Implemented basic tool durability 2013-08-19 17:37:08 +02:00
a7b739d17f Fixed hotbar reset bugs in block placement 2013-08-19 17:04:02 +02:00
78c242eac4 Fixed armor hotbar reset bug 2013-08-19 16:51:40 +02:00
7e6758fb60 Alpha_1.3.4dev 2013-08-18 21:32:26 +02:00
39658ef63f Automatic recovery of corrupted maps 2013-08-18 21:31:47 +02:00
4f1ce9adee Revert "Merge pull request #682 from Humerus/patch-1"
This reverts commit 04c641b79b, reversing
changes made to ba9b800eff.

Revert
2013-08-18 13:17:01 +02:00
87a67804c4 Merge pull request #677 from Humerus/master
Enabled autosave via an option in server.properties.
2013-08-18 04:11:53 -07:00
04c641b79b Merge pull request #682 from Humerus/patch-1
I'm bored x2.
2013-08-09 21:22:01 -07:00
9c9939440f I'm bored x2. 2013-08-09 22:57:32 -04:00
ba9b800eff Merge pull request #599 from MinecrafterJPN/master
Fixed player.block.activate
2013-08-09 04:44:10 -07:00
62b589295e Enabled autosave 2013-08-08 23:02:38 -04:00
b6d86c287c Update ServerAPI.php 2013-08-08 22:58:32 -04:00
792a4bd98e Changed IRC Link 2013-08-02 13:01:47 +02:00
28790e0fb3 Changed chcp to normal Unicode 2013-08-01 19:32:17 +02:00
b77e7dd05c Added weird water 2013-08-01 19:31:39 +02:00
4c73629b9e Object check - Fixes #537 2013-07-31 22:38:17 -05:00
330e06b892 Players can no longer be given air (causes client crash) through /give.
Fixes #567.
2013-07-31 22:08:34 -05:00
f3f6828699 Object check on getting distance for PvP attacks
Fixes #586, although I'm not entirely sure what's causing the object to be invalid in the first case, so this is a temporal fix.
2013-07-31 21:45:23 -05:00
c1e1f5195b Fix for players connecting with a blank username field
Fix for players connecting with a blank username field (#636).
2013-07-31 16:45:56 -05:00
a60d41d489 Merge pull request #634 from williamtdr/patch-1
Fix for fly kick when player is standing on Fence
2013-07-31 14:37:04 -07:00
5975bd9d32 Fix for fly kick when player is standing on Fence
Fix for Issue #631 (Player kicked for flying when standing on fence).
2013-07-31 00:44:41 -05:00
e67b583cbe Added Player::realmsData for future checking 2013-07-23 19:02:32 +02:00
4755dee47d Fixed player count bug 2013-07-23 17:33:37 +02:00
fd5d981aa5 Revert "Better Command Permissions Check"
This reverts commit b42222c461.
2013-07-23 16:13:59 +02:00
a93b2cf954 Revert "Minor fix to command.check"
This reverts commit ed9eadd1a0.
2013-07-23 16:13:51 +02:00
16e65560a8 Revert "Update Deprecation.php"
This reverts commit 08000257fb.
2013-07-23 16:13:44 +02:00
32d658122b Fixed player.block.activate 2013-07-22 21:59:29 +09:00
1cf2741f96 Moved chat disconnect broadcast 2013-07-21 23:42:07 +02:00
47c934cee2 Reordered instructions 2013-07-21 23:36:14 +02:00
3606c392f2 Disallow packet receival on Player disconnect 2013-07-21 23:35:03 +02:00
6d4465eb67 Fixed High CPU Usage. setPosition now uses prepared statements. 2013-07-15 21:44:47 +09:00
08000257fb Update Deprecation.php 2013-07-15 12:50:03 +09:30
ed9eadd1a0 Minor fix to command.check 2013-07-15 12:15:23 +09:00
b42222c461 Better Command Permissions Check 2013-07-15 12:08:28 +09:00
635cd677eb minor armor api fix. 2013-07-14 17:50:14 +09:30
56f500d520 Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2013-07-13 23:59:39 +02:00
3202678594 Compiler changes 2013-07-13 23:59:23 +02:00
a68676a247 Added setArmor and getArmor 2013-07-13 18:18:10 +09:00
7efed17b74 Possible fix for armor crash 2013-07-04 23:33:56 +02:00
b776d9d5fc Fixed ghost armor 2013-07-04 22:01:28 +02:00
5237867319 Fixed Armor AIR crash 2013-07-04 21:48:35 +02:00
402fc087ca Armor fix 2013-07-04 20:40:35 +02:00
1727e18e31 Updated for Minecraft: PE 0.7.2 2013-07-04 20:24:13 +02:00
03b4e40bf4 Ooops! 2013-07-03 18:12:22 +02:00
8f1c34fdc5 Added whitelist to Query 2013-07-03 18:08:53 +02:00
84bb66357e Cast floats as integers on Level::getBlock() and Level::setBlock() 2013-07-03 10:59:32 +02:00
c00bfe3908 Fixed async thread get 2013-06-25 01:22:02 +02:00
3fb99e118c Added item save check 2013-06-20 22:10:39 +02:00
1d2de1f038 Fixed DEFLATEPacket notification 2013-06-17 10:03:20 +02:00
d177af3297 Fixed #410 2013-06-17 09:29:54 +02:00
8dcdf55264 Frequent memory checks 2013-06-17 09:27:17 +02:00
5a168836c5 Fixed setting the difficulty via command 2013-06-17 03:29:44 +02:00
ce1e95195b Alpha_1.3.3dev 2013-06-17 02:53:29 +02:00
cf5e2f63db Fixed pthreads infinite loop when string length was <= 0 2013-06-17 01:07:58 +02:00
d4c4f8817d Pushed fix for #391 2013-06-17 00:44:18 +02:00
b6a1d42870 Preparing Alpha_1.3.2 fix update 2013-06-16 17:51:31 +02:00
84a5f0fce5 Tweaked block break times #254 2013-06-16 17:33:24 +02:00
c136eb2b2e Fixed #400 2013-06-16 17:31:55 +02:00
d0a021de73 Improved #401 2013-06-16 17:28:12 +02:00
155c918bb8 Fixed Leaf Decay loops causing Lag Spikes, fixed #391 [gh#391] 2013-06-16 17:18:15 +02:00
19d0c70669 Added simple Matrices 2013-06-16 14:34:06 +02:00
02721c09a4 Possible fix for #391 2013-06-15 21:24:06 +02:00
204a4ce831 Updated PHP version 2013-06-14 14:43:43 +02:00
a118e626c2 Changed Languages
Other people that checks issues might not understand Spanish or Korean.
So, the people that use other languages might do it, as an exception,
but we won't add it to the Guidelines. Doing that would encourage it.
2013-06-14 13:49:35 +02:00
01d5612ed8 CONTRIBUTING Better Reading 2013-06-14 19:11:04 +09:30
59aa317546 Update CONTRIBUTING.md with Additional Language Issue stuff.
We need to consider non-English speakers as well.
2013-06-14 19:10:28 +09:30
4c9cbaf1ee Possible fix for #391 2013-06-14 02:56:29 +02:00
18562317c3 Added Packet Count check 2013-06-14 00:21:43 +02:00
f51630c572 Fixes to DEFLATE 2013-06-13 19:53:04 +02:00
847590645d Added CONTRIBUTING.md 2013-06-13 16:46:04 +02:00
fbf22cec39 Fixed #386 Adding items use the correct item max stack size [gh#386] 2013-06-13 10:44:00 +02:00
0dd3d4a457 Alpha_1.3.2dev 2013-06-12 22:48:31 +02:00
f521d16ce3 Alpha_1.3.1 release 2013-06-12 22:18:00 +02:00
72ec318481 Fixed crafting inside a chest 2013-06-12 22:01:42 +02:00
99554caa69 Added some type checks 2013-06-12 20:46:23 +02:00
bfffa35246 Async checks each second 2013-06-12 19:50:37 +02:00
09a388f8de Fixed type again 2013-06-12 19:41:03 +02:00
a7149ad9ef Fixed field type 2013-06-12 19:40:09 +02:00
471de2d1c5 Changed domain 2013-06-12 19:38:34 +02:00
aa7d9b5e05 Added full async operations in a separate Thread 2013-06-12 19:38:11 +02:00
2e23ce8beb Ban API fly fixed 2013-06-12 17:11:37 +02:00
e4871ee0c4 Faster packet broadcast 2013-06-12 17:10:10 +02:00
86469a1031 Fix 2013-06-12 16:43:29 +02:00
533c179622 Added Client Lag detection 2013-06-12 16:25:11 +02:00
4321a03935 Mini fix 2013-06-12 16:11:15 +02:00
68f0a91d56 Fixed Chunk max upload 2013-06-12 16:10:50 +02:00
5e231c846c Chat checks 2013-06-12 14:55:38 +02:00
7d3992bcc2 Improved some events 2013-06-12 14:51:36 +02:00
c83d4d955f Improved Player::blocked 2013-06-12 13:46:44 +02:00
ff7fa066a5 Entities are now updated on block updates 2013-06-12 12:20:56 +02:00
9619ebc2af Fixed lag issues when breaking blocks 2013-06-12 12:13:51 +02:00
0a4beaf051 Fix 2013-06-12 00:07:20 +02:00
2957f35194 Fixed incorrect player count at login 2013-06-12 00:06:09 +02:00
5afd26b1b6 Reduced stats server timeout 2013-06-11 23:08:07 +02:00
152ebcbc17 Fixed Memory Stats collection 2013-06-11 18:55:08 +02:00
73c155090c Fixed UP/Down speed 2013-06-11 18:50:47 +02:00
89cb879f1f Fixed pigs dropping leather 2013-06-11 17:42:47 +02:00
a45858ad94 Fixed #373 2013-06-11 17:01:51 +02:00
c8e157156e Added bandwidth usage measurement to Window Status 2013-06-11 11:00:02 +02:00
6563169527 Removed libedit support temporally 2013-06-11 10:43:50 +02:00
7e67f50da5 Creative players pickup item sound 2013-06-11 00:55:48 +02:00
393b57c535 Few level generation changes 2013-06-10 17:35:11 +02:00
bda5e62788 Fixed syntax 2013-06-10 17:13:34 +02:00
579175b3bc Ore Generation 2013-06-10 17:11:04 +02:00
808f5473d0 Added more Vector math 2013-06-10 17:10:49 +02:00
4284211bd1 Change 2013-06-10 17:10:40 +02:00
33733cd608 New API version 2013-06-10 17:10:18 +02:00
1e14485444 Increased support Y radius 2013-06-10 15:47:53 +02:00
c42fd790ff Fixed error 2013-06-10 15:36:45 +02:00
2ef1f0c9d0 Fixed #364 added despawn timer for arrows [gh#364] 2013-06-10 10:37:33 +02:00
abcb5828ed Fixed #361 2013-06-10 01:29:14 +02:00
ee7c767c16 Limited player upload peak using CLI max-chunks-per-second parameter 2013-06-10 01:20:28 +02:00
affd67debe Added ore generation to Superflat 2013-06-10 01:06:48 +02:00
79555e4029 Fixed Sign update bug 2013-06-09 23:26:03 +02:00
e1c0139ab3 Possible fix for signs bug 2013-06-09 23:02:01 +02:00
ca8be7b047 Lowered max lag acceptance to resend packets 2013-06-09 21:55:43 +02:00
3ab3526404 Improved Player::orderChunks() 2013-06-09 21:35:37 +02:00
523c4390fa Fixed entities not updating 2013-06-09 20:55:37 +02:00
508ee7e1d6 Removed outdated functions 2013-06-09 20:40:18 +02:00
4a5783b57b Large improvement in chunk sending 2013-06-09 20:37:45 +02:00
31490576d2 Added packet loss kicks and packet recovery repetition 2013-06-09 19:07:58 +02:00
b4f95fad11 Fix 2013-06-09 18:53:39 +02:00
8c190ead7f Fixed sand getting block updates 2013-06-09 18:52:56 +02:00
fef0b27f7c Changed speed check 2013-06-09 16:36:44 +02:00
cbe0692696 Players can put out fires 2013-06-09 15:14:30 +02:00
1cc19ae1e8 Fire can be broken 2013-06-09 14:59:55 +02:00
2976db25c3 Basic implementation of Fire 2013-06-09 14:59:02 +02:00
2f6ddb6aa4 Less complete inventory sending 2013-06-09 13:51:45 +02:00
099bedf8ee New speed limit 2013-06-09 13:37:27 +02:00
bd1875f5e4 Added chunk_split() to crash dumps 2013-06-09 13:18:58 +02:00
d82399e686 Fixed #359 crash dump name not compatible with Windows 2013-06-09 13:11:55 +02:00
4f10b1cb7c Fixed #358 2013-06-09 13:02:38 +02:00
ba53a0927f Removed debug message 2013-06-09 06:00:36 +02:00
9b88a4a73f Player packet handling rewrite, fix #350 2013-06-09 05:56:48 +02:00
715b92b681 Typo 2013-06-08 19:27:18 +02:00
1014052a57 Removed /invisible 2013-06-08 19:23:16 +02:00
ac486ec970 Removed generator setting 2013-06-08 18:55:08 +02:00
5a278f8a16 Fixed regeneration acting on all gamemodes 2013-06-08 18:47:30 +02:00
7404279f15 Added spawn-animals and spawn-mobs 2013-06-08 18:34:28 +02:00
5f40ab84f0 Fixed memory tracking error 2013-06-08 18:26:24 +02:00
3061b8eb3c Added a check to memory tracking 2013-06-08 17:48:17 +02:00
e58ef1f62c Added automatic memory usage tracking 2013-06-08 17:45:33 +02:00
4803f14a21 Removed chat repeating lag issues 2013-06-08 17:25:15 +02:00
409cc0931f Fixed some indexes 2013-06-08 17:21:02 +02:00
9874bd199e Marked chat packets as not recoverable 2013-06-08 17:05:39 +02:00
1a822460d8 Fixed DEFLATEPacket return 2013-06-08 16:59:49 +02:00
8d2862a744 Fixed ladders 2013-06-08 16:36:53 +02:00
4f3e49b6a9 Packet loss limit lowered 2013-06-08 14:47:36 +02:00
f1c278915d Possible fix for memory leak 2013-06-08 14:46:34 +02:00
169d122774 Fixed typo 2013-06-08 14:31:19 +02:00
ccc5e1b628 SignPosts drop being without a support block 2013-06-08 14:30:47 +02:00
5786ba7a35 Moved blocks around 2013-06-08 14:30:26 +02:00
cd932d5c07 Snow Layer is broken on update 2013-06-08 14:23:30 +02:00
bfa65e1e7d Time is sent on change 2013-06-08 14:19:10 +02:00
16a8566fca Time now is displayed correctly 2013-06-08 14:17:38 +02:00
28480424c5 Fixed crash 2013-06-08 13:45:42 +02:00
54227b1d86 Possible memory leak fix 2013-06-08 13:43:47 +02:00
04390e758d Fixed #347 2013-06-08 13:25:17 +02:00
3e46fc1fdd Fixed crafting in some cases where item was replaced 2013-06-08 13:11:16 +02:00
97dd718e4f Fixed #348 2013-06-08 12:51:28 +02:00
883b18078f Removed clientID from checks 2013-06-08 02:22:20 +02:00
8bef816061 Added PMF_LEVEL_DEFLATE_LEVEL 2013-06-08 01:59:00 +02:00
13bfaaf7b8 Fixed crash after level unload 2013-06-08 01:50:03 +02:00
164b420af6 Tiles and Entities won't get wiped on level unload 2013-06-08 01:40:39 +02:00
38c50c2fec Fixed API unloading 2013-06-08 01:40:13 +02:00
157237e3ef Proper Level checks on unload 2013-06-08 00:57:21 +02:00
20b83319de Added stop Chunked on Player::close() 2013-06-08 00:43:39 +02:00
1ce23ab8d7 Added DEFLATEPacket protocol support
https://gist.github.com/shoghicp/5729825
2013-06-08 00:41:34 +02:00
4f3700f13a Fixes indexes 2013-06-07 20:35:05 +02:00
129e099f88 Fixed Entity metadata sending, sheeps on fire 2013-06-07 20:32:38 +02:00
9d1369bfe9 Fixed items being consumed on CREATIVE mode 2013-06-07 20:02:25 +02:00
6fa0ef652e Using !== instead of != in recipe checks 2013-06-07 19:36:14 +02:00
71e556a181 Fixed crafting repeated items 2013-06-07 19:30:30 +02:00
51f4faf22e Bonemeal usage count 2013-06-07 19:25:23 +02:00
8e127e60a0 Another fix 2013-06-07 19:18:35 +02:00
3023df2033 Function fix 2013-06-07 19:14:42 +02:00
3463db04a6 Fixed tool metadata [partial] 2013-06-07 19:14:09 +02:00
e9683ff5d2 Fixed eating 2013-06-07 19:04:02 +02:00
64dca86342 Fix overloaded property 2013-06-07 17:36:57 +02:00
6a13705970 Fixed Level PMF 2013-06-07 16:42:31 +02:00
afbde5c7ac Added server.tick event deprecation notice 2013-06-07 16:29:16 +02:00
6f2b2f98d6 Removed debug messages 2013-06-07 16:17:02 +02:00
05ae6cdef3 Better event system 2013-06-07 16:15:19 +02:00
e7c6a0c817 Another typo 2013-06-07 14:02:50 +02:00
81524362c0 Fixed typo 2013-06-07 14:02:22 +02:00
35c0c21c8d Better /kill command, ensures death 2013-06-07 12:54:45 +02:00
c37c6da42d Fixed #339 Creative players have their inventory cleared on death [gh#339] 2013-06-07 12:51:12 +02:00
3fa1bd3a05 Merge branch 'master' of https://github.com/PocketMine/PocketMine-MP 2013-06-07 12:44:15 +02:00
fdb7af5df2 Chests and furnaces drop their items on break 2013-06-07 12:44:10 +02:00
a463e0c09e Revert 67919a6 2013-06-07 09:29:38 +09:30
67919a68e1 Added Lave Bucket as Fuel Check 2013-06-07 09:17:31 +09:30
45ee7ea7ae Correct armor checks 2013-06-07 00:43:15 +02:00
e3e7919652 Fixed wool on sheeps 2013-06-06 23:55:14 +02:00
139d8b38b5 Fixed spawn eggs & buckets on creative ,pde 2013-06-06 23:31:46 +02:00
96c11adc89 Fixed typo 2013-06-06 23:05:38 +02:00
82aa76be17 Added Spawn Eggs 2013-06-06 23:02:44 +02:00
7970b8aeed Buckets 2013-06-06 22:49:43 +02:00
ab3fcfc148 Correct drops for Snow and Cake 2013-06-06 22:44:20 +02:00
28f6a964d4 Added cake eating 2013-06-06 22:24:19 +02:00
306cc9f00c Fixed #333 2013-06-06 21:51:05 +02:00
c1f79fa2f8 Fixed craftin recipes with wildcard 2013-06-06 19:51:24 +02:00
1179369666 Refixed recipe 2013-06-06 19:32:35 +02:00
0bd8d0b0d0 Fixed recipe mixture 2013-06-06 19:31:15 +02:00
67b0b97005 Fix lava buckets on furnaces 2013-06-06 19:09:23 +02:00
5e45567c1d Fixed some slot sending 2013-06-06 19:02:30 +02:00
adce1ad920 Fixed equipment error message 2013-06-06 18:32:49 +02:00
8b1c251a59 Fixes crafting 2013-06-06 18:27:10 +02:00
8b9b05991d Fixed crash 2013-06-06 17:49:38 +02:00
5cb06579cd Another fast network fix 2013-06-06 17:34:42 +02:00
63933ed1fc Fast network fix 2013-06-06 17:31:55 +02:00
4b408675cf Minecraft: Pocket Edition 0.7.0 dev. release
* Crafting enabled, report bugs
* Chat handler
2013-06-06 17:14:09 +02:00
1f4df559e0 Final fix #324 2013-06-05 18:25:16 +02:00
89ef299333 Fixed #324 2013-06-05 16:30:12 +02:00
3d3383bea7 Fix #317 - removed phpseclib 2013-06-05 15:10:40 +02:00
c95c231cfc Possible fix for #323 - Use phtreads release from pecl 2013-06-05 14:40:09 +02:00
d614f3c9da Revert "New Language Output preparation"
This reverts commit 6993528af2.
2013-06-05 14:22:04 +02:00
6993528af2 New Language Output preparation 2013-06-05 21:45:41 +09:30
18b437eec9 Fixed Entity update 2013-06-05 13:15:40 +02:00
67b533a44d Removed debug thing 2013-06-05 12:59:50 +02:00
5def864aca Removed server.tick event 2013-06-05 12:58:58 +02:00
911577e9b8 Fixed syntax error 2013-06-05 12:36:31 +02:00
fbf897d1be Fixed level event duplication on some cases 2013-06-05 12:20:57 +02:00
a5bc95e733 Fixed entities being updated when they shouldn't 2013-06-05 12:11:04 +02:00
2dd188a0bd Old pthreads release 2013-06-04 22:34:39 +02:00
a830555d90 Added a normal Temporal Generator 2013-06-04 22:31:34 +02:00
8bf10c523e Fixed Level Generation block updates 2013-06-04 20:08:14 +02:00
7e13ae2bda Leave improvement 2013-06-04 19:51:16 +02:00
7527c57e1e Fixed #274 #301 Leaves now disappear [gh#274,301] 2013-06-04 19:41:13 +02:00
06a0f169dd Better auto-save, less resource and disk usage 2013-06-04 18:45:30 +02:00
f12620f376 Possible fix for #323 2013-06-04 17:42:32 +02:00
dce9b3140a Plant growth & scheduled updates! 2013-06-04 17:23:03 +02:00
be9676ebe5 Added server_engine to query 2013-06-04 11:25:05 +02:00
bd6e3901a6 More fix 2013-06-04 11:01:59 +02:00
6f8963bdcd Correct line offset in Plugins 2013-06-04 10:58:11 +02:00
033a1673f0 Added bandwidth measure 2013-06-04 10:55:20 +02:00
0c7c36cc03 Fixed unrelated packet loss kicks 2013-06-04 10:06:21 +02:00
e01a3e6811 Increased packet loss allowance 2013-06-04 01:59:35 +02:00
566cee2b0b New way to measure Ping 2013-06-04 01:12:22 +02:00
03e059a190 Added player.spawn and player.respawn 2013-06-04 00:13:12 +02:00
f80326b714 Limited length of messages to 100 2013-06-04 00:10:57 +02:00
1935e2bbf7 Disallow weird characters in chat 2013-06-04 00:08:58 +02:00
e43b4e67c6 Disallow sending empty chat messages 2013-06-03 23:33:52 +02:00
45267ea074 Fixed crash when players try to chat [MCPE 0.7.0] 2013-06-03 23:33:07 +02:00
45efcc5faa Fixed undefined $message 2013-06-03 23:28:24 +02:00
15c9b7214d Fixed crash at unload 2013-06-03 23:26:47 +02:00
be83eaf521 Correct call of destruct chain to release PMF file locks at unload 2013-06-03 23:24:33 +02:00
f2927df2b3 Renamed TileEntity to Tile (TileEntityAPI, TileEntity class, variables) 2013-06-03 19:19:00 +02:00
5bba03eb09 Refactored EntityAPI and TileEntityAPI 2013-06-03 19:11:46 +02:00
588379a430 Added player.teleport.level 2013-06-03 18:51:33 +02:00
dc22e1b81c Kick players on high packet loss 2013-06-03 18:27:17 +02:00
f55fb8d490 Player actions and bows [WiP] 2013-06-03 16:31:33 +02:00
d1f2f82c6d Fixed #313 Entities are updated depending on near block updates [gh#313] 2013-06-03 12:20:07 +02:00
4b6e456c65 Possible solution for #317 [gh#317] 2013-06-03 11:16:12 +02:00
a8b8427065 Updated secure random number generator ith harder entropy distillation 2013-06-02 18:01:34 +02:00
ec22034ad7 Plugin version 2, include extra data 2013-06-02 17:55:59 +02:00
c7a3fc4931 Fixed time checking on Linux 2013-06-02 13:32:36 +02:00
91e414fb87 Added phpseclib for future usage 2013-06-02 13:29:24 +02:00
1b50bd6e0f FInal fix #312 2013-06-02 12:54:21 +02:00
ffd8ac2879 Fix again #312 - Vector3 2013-06-02 12:48:04 +02:00
9ead05a6fa Fixed #312 Position::getSide() now returns a Position object instead of a Vector3 one 2013-06-02 12:46:27 +02:00
4f39818cae Added something to test 2013-06-02 12:22:41 +02:00
15ab47070a Sand now falls through Liquids when placed just on top of them 2013-06-02 11:34:02 +02:00
b72d4ac407 Fixed #311 Check for Liquids, ladders and cobweb for flying 2013-06-02 11:20:16 +02:00
0ca18864f3 Fixes #311 2013-06-02 10:22:28 +09:30
54b73e5f82 Added block cloning fix 2013-06-01 19:58:54 +02:00
24ba7cbbd1 New direct block method, better block placement sending 2013-06-01 00:32:23 +02:00
722eb6d1f9 Added -uclibc for Android 2013-05-31 23:09:15 +02:00
1638e68c53 Another build script fix 2013-05-31 23:03:41 +02:00
75bb2a6399 New method EntityAPI::getRadius() 2013-05-31 18:58:59 +02:00
a890cdc023 Performance improvements - removed Player action queue 2013-05-31 14:43:53 +02:00
66fc483156 Better item pickup 2013-05-31 14:30:07 +02:00
1376cc860d Removed API::action() 2013-05-31 14:29:46 +02:00
732f5f5168 Fixed compile script *again* 2013-05-31 13:46:56 +02:00
66e635daeb New Entity update system, scheduled updates when needed only 2013-05-31 13:44:06 +02:00
3ac4b0af68 Entities spawn with their motion 2013-05-31 12:04:43 +02:00
d7f74a6725 Removed incorrect unloaded chunk detection 2013-05-31 11:53:50 +02:00
0522052c75 New compile script 2013-05-31 00:48:25 +02:00
e6dbd61308 Drops do not get into blocks 2013-05-30 19:54:55 +02:00
848554bc0c Correct falling sand drop position 2013-05-30 19:34:31 +02:00
fc02572065 Drops now have starting speed, correct entity motion at spawn 2013-05-30 18:55:50 +02:00
09efcec605 Better entity position sending using motion update 2013-05-30 16:45:44 +02:00
4507072980 Fixed sand falling replacing other blocks 2013-05-30 16:33:08 +02:00
2c8d527025 Increased view-distance by default, due to Fancy Graphics in 0.7.0 2013-05-30 16:19:58 +02:00
9919a709e9 Vector3 => Position fix 2013-05-30 13:13:36 +02:00
3825edaaab Better item spawning on falling entity break 2013-05-30 12:51:56 +02:00
6e5924a183 Typo fixed 2013-05-30 12:49:35 +02:00
a795b64bab Added new Block properties (Block::isSolid, Block::isFullBlock) 2013-05-30 12:47:24 +02:00
8d00ef381d Fixed Hardcore flags 2013-05-29 23:30:07 +02:00
b564868467 Fixed #305 Made BlockAPI check for flowable blocks instead of transparent blocks [gh#305] 2013-05-29 23:25:43 +02:00
450b5d9560 Updated TileEntity API [fixes #306] 2013-05-29 23:13:01 +02:00
25de7a68d5 API version update 2013-05-29 23:12:23 +02:00
6e2f7af6b4 Added hardcore mode 2013-05-29 22:58:43 +02:00
2f05a03e51 Fixed #304 Calculate Server Time Offset [gh#304] 2013-05-29 18:20:48 +02:00
ddec63c4d4 Fixed cleanup 2013-05-29 15:00:41 +02:00
6242089b28 Removed incomplete generator 2013-05-29 14:09:36 +02:00
1fbf475ace Mini fix 2013-05-29 14:08:30 +02:00
2271d45fd9 Fixed Mac compilation 2013-05-29 14:03:39 +02:00
f6ab39a526 Fixed falling entities falling upwards 2013-05-29 12:18:35 +02:00
71584288dc Fixed Entity floor drag 2013-05-29 12:11:12 +02:00
e67a7a510e Gravel is able to drop Flint 2013-05-29 11:57:58 +02:00
8192b41693 Fixed #303 Checking plants position on normal block update 2013-05-29 11:53:57 +02:00
4a969257d1 #303 Torches are able to be placed on top of Fences [gh#303] 2013-05-29 11:53:55 +02:00
fde93debb4 Fixed @brandon15811 typo 2013-05-29 01:13:57 +03:00
620486a4a0 Merge pull request #302 from brandon15811/patch-1
Add script for android/rpi cross-compiling
2013-05-28 14:39:27 -07:00
0d12039623 Added TileEntity::setText(1,2,3,4) 2013-05-28 23:35:33 +02:00
00427a076e Add script for android/rpi cross-compiling 2013-05-28 16:33:51 -05:00
58fd67d2ed Falling Entities, better Physics [not final] 2013-05-28 22:03:58 +02:00
cb03daf28a Removed duplicate in compile script 2013-05-28 11:05:38 +02:00
3d28f519c7 Revert "Fix for pthreads and cross_compile"
This reverts commit 6b61bc11d0.
2013-05-28 08:23:13 +02:00
6b61bc11d0 Fix for pthreads and cross_compile 2013-05-28 08:06:44 +02:00
c9d0cf3698 Added env. variable to specify the number of threads [gh#300] 2013-05-27 23:20:06 +02:00
5d6669201b Fixed compile script 2013-05-27 21:24:13 +02:00
d8f6e9ff0e Pass compile options via env. variables 2013-05-27 20:36:49 +02:00
929c27e339 Changed the order of some build instructions 2013-05-27 18:16:58 +02:00
a92e4f6acd Disable not needed cURL functions 2013-05-27 16:36:31 +02:00
b7bc0826af Autodetection of native machine and code optimization 2013-05-27 14:23:10 +02:00
044b25ccd2 Faster chunk distance ordering 2013-05-26 19:58:23 +02:00
90effd173b Faster chunk sending algorithm 2013-05-26 19:57:41 +02:00
fc80a85c8c Faster network stack on overflow conditions 2013-05-26 19:57:19 +02:00
06c57a3aae Fixed #293 player.armor data not being correct [gh#293] 2013-05-26 16:16:36 +02:00
6d54495402 Cached Utils::getIP() method 2013-05-26 16:15:30 +02:00
838e7ad010 Hide rcon.password in the crash log 2013-05-26 16:11:21 +02:00
6262fbffcb Send correct entity motion 2013-05-26 14:06:26 +02:00
7622151a21 Pine & Spruce trees fixed 2013-05-26 13:36:33 +02:00
aefcfad296 Added more features to the World Generator 2013-05-26 13:22:22 +02:00
424dba2fdd Filling a chunk triggers the block change saving algorithm 2013-05-26 12:48:20 +02:00
7c3b8807e9 Alpha_1.3.1dev version 2013-05-26 12:16:23 +02:00
f6a395e7b7 Possible fix for #289 [gh#289] 2013-05-26 12:04:26 +02:00
d92056fe77 Fixed typo in deop 2013-05-26 17:36:45 +09:30
161a271127 Merge pull request #290 from sfan5/patch-1
Allow DeOPing disconnected players
2013-05-26 01:03:07 -07:00
8ec11b35ad Set up base for upcoming Mob MobAI and MobAPI 2013-05-26 17:27:16 +09:30
df4a29d7d6 Allow DeOPing disconnected players 2013-05-26 09:55:03 +03:00
00de63986b Alpha_1.3 stable release 2013-05-26 01:18:44 +02:00
60c0345c81 Fixed cobweb 2013-05-26 00:49:20 +02:00
b39677cc96 Added LevelAPI::unloadLevel(Level $level) 2013-05-26 00:37:18 +02:00
72f8f00c5d Autorecovery of bad chunks 2013-05-25 23:46:02 +02:00
ce391160f4 Added hostile mobs drops 2013-05-25 23:21:21 +02:00
7111bc5e64 Improved updated messages 2013-05-25 22:56:09 +02:00
7a5df07ee5 Fixed #220 Players now drop items on death [gh#220] 2013-05-25 22:36:13 +02:00
7ade4762b9 Fixed #288 [gh#288] 2013-05-25 21:19:24 +02:00
a153f2ebdc Minifix 2013-05-25 19:29:24 +02:00
a538543e4c Fixed #287 Items dropped will be deleted if picked up in creative mode [gh#287] 2013-05-25 19:27:29 +02:00
5e1dddaba0 Added correct clay blocks 2013-05-25 19:20:37 +02:00
f224c26084 Furnaces and Burning items 2013-05-25 19:06:31 +02:00
221da1685e Fixed #281 client crashes due to packet recovery 2013-05-25 14:07:08 +02:00
e34b407538 Fixed #283 server crash when placing brown mushrooms [gh#283] 2013-05-24 23:56:35 +02:00
b8834890b6 Temporal fix for player crashing 2013-05-22 16:31:59 +02:00
03062c4e54 Fixed #204 Packet recovery algorithm can recover unsent chunks [gh#204] 2013-05-22 12:17:31 +02:00
929aebc1bf added ticks to error logs 2013-05-21 23:02:56 +02:00
363501d988 Fixed #275 2013-05-21 23:01:56 +02:00
9857f40175 Removed notice message 2013-05-21 20:44:02 +02:00
29b96fa855 Merge pull request #273 from greyson/master
Nearer-original tree generation
2013-05-21 11:29:51 -07:00
49716cfb18 Fixed packet-related stuff 2013-05-21 20:29:10 +02:00
acc373525f Removed MT Random generator namespace 2013-05-21 20:14:03 +02:00
c29d3a3e56 Better (more original) looking trees 2013-05-21 14:03:42 -04:00
b7083032f3 Updated settings, less memory usage 2013-05-21 19:50:59 +02:00
c9cecaf218 Fixes 2013-05-21 19:29:57 +02:00
9dbdab8060 Added } 2013-05-21 19:19:50 +02:00
8c5d0f070d Changed flying checks 2013-05-21 19:17:13 +02:00
73c5e7d7bc Added more food sources 2013-05-21 18:52:56 +02:00
4766424cb3 Fixed moving to fast message during Player blocking 2013-05-21 18:40:00 +02:00
8e8002c479 Fixed crash 2013-05-21 15:52:37 +02:00
409f0670bd Added sendUsage() port 2013-05-21 11:06:38 +02:00
ee12b41c39 Allow-flight disables speed checks 2013-05-21 08:24:17 +02:00
cd30f51979 Added startup errors display 2013-05-20 23:39:15 +02:00
6dc1e99f5a Merge pull request #269 from greyson/master
added libedit/readline support
2013-05-20 13:32:54 -07:00
cca453cc06 Feature complete: 'libedit' 2013-05-20 16:26:06 -04:00
ff8de264c0 Added "readline" support using libedit. 2013-05-20 16:17:11 -04:00
c6121e88bf Optionally disabled libedit based on results of compile 2013-05-20 16:17:11 -04:00
27050b9ec4 Internal ticker autocalculation 2013-05-20 17:21:04 +02:00
43071dd0ac RCON bad reading fixed 2013-05-20 17:20:35 +02:00
281d3b037f Fixed #255 Player and item bounding boxes 2013-05-20 16:53:57 +02:00
13b00988f0 Added GLOWSTONE constant 2013-05-20 16:44:28 +02:00
228075851c Correct Ice drop 2013-05-20 16:38:41 +02:00
47b54cfd28 Fixed #270 Blocks that need to be broken with a pickaxe now give correct drops & items 2013-05-20 16:33:09 +02:00
8336b4c91b Added libedit download/compile 2013-05-20 03:53:58 -04:00
713f16771f Added some socket options to cURL 2013-05-20 09:43:32 +02:00
aa14539274 Added execute bit to scripts 2013-05-20 08:26:04 +02:00
98c790d731 Fixed #265 2013-05-20 00:28:58 +02:00
00a41e7e11 Correct Slab checking error 2013-05-20 00:24:13 +02:00
ae13512627 Added index 2013-05-19 23:03:59 +02:00
95f2f347ff Updated Level::setMiniChunk() and Level::setRawBlock 2013-05-19 23:03:09 +02:00
48b5afac46 Packet broadcast to players 2013-05-19 22:49:40 +02:00
b9e3acd017 Do not grow trees on incorrect blocks 2013-05-19 21:00:38 +02:00
2fc542d93d Added trees to the flat preset 2013-05-19 20:54:43 +02:00
a7a45dfe96 Updated flat preset, do not allow empty Level names 2013-05-19 20:53:12 +02:00
bb9067acd7 Fixed #262 2013-05-19 19:32:40 +02:00
68855bdd4f Buffered block changes and sending big changes with Chunk Packets 2013-05-19 19:27:55 +02:00
10ed95a469 Don't fire change events if block has not changed 2013-05-19 17:53:40 +02:00
04f0500822 MTU used correctly 2013-05-19 17:11:21 +02:00
e3de52ba8b Fixed bigRaw packets reliability 2013-05-19 16:47:57 +02:00
2c4a428698 Packets bigger than the MTU are automagically split in different packets 2013-05-19 13:51:02 +02:00
b481c26839 Fixed teleporting to worlds with spaces 2013-05-19 13:32:27 +02:00
e163223134 Implemented safe_var_dump() 2013-05-19 03:39:33 +02:00
295363a381 New Player::directBigRawPacket() method 2013-05-19 02:50:04 +02:00
db97c0c5f7 Updated hook 2013-05-18 21:04:58 +02:00
d28780fa05 Updated Travis repo 2013-05-18 21:03:00 +02:00
a7709f827f Updated repository URL 2013-05-18 21:00:16 +02:00
22cc3d4d83 Clear Plugin file error during a crash 2013-05-18 19:47:50 +02:00
f485124190 Fixed #257 2013-05-18 19:12:50 +02:00
b48f486620 Fixed no params aliases 2013-05-18 19:04:31 +02:00
e3bf38e0b2 Plugin API: Allow Plugins without Main class 2013-05-18 18:24:48 +02:00
7297f8d2c0 Level Generation API updated 2013-05-18 15:22:07 +02:00
c408ee07b1 Player spawning on unknown worlds will be redirected properly to the main world 2013-05-18 15:21:54 +02:00
6adc41f301 Fixed #256 Signs not attaching to walls 2013-05-18 13:26:31 +02:00
af85c7ce45 Added Perlin noise generator 2013-05-18 13:16:35 +02:00
22d9cefe96 Fixed build 2013-05-18 11:24:31 +02:00
5faeff9e16 Fixed PMF metadata set 2013-05-18 11:19:08 +02:00
e81d68c8d0 Added trees to teh SuperflatGenerator 2013-05-18 11:02:00 +02:00
3c4d4f5cff Updated pthreads version 2013-05-18 02:53:35 +02:00
5ea6052a8a New Level Generator API & Support for MC Superflat Presets 2013-05-18 02:05:56 +02:00
edb93d6312 Fixed #254 2013-05-17 18:45:02 +02:00
3bb7114e7c Fixed PMFLevel::getBlock() not converting to int 2013-05-17 15:08:56 +02:00
d71a088460 Added MC_REMOVE_PLAYER 2013-05-17 14:33:14 +02:00
6db36c238f Allow OPping disconnected players 2013-05-17 14:02:01 +02:00
09fabfc87e Fixed getting spawn seed 2013-05-17 13:56:18 +02:00
2377cf7199 Index fix 2013-05-17 13:19:44 +02:00
b82e9b2895 Fixed already loaded worlds 2013-05-17 13:14:52 +02:00
651398e500 Fixed #249 2013-05-17 12:33:42 +02:00
2b89b51621 Fixed #251 implode() error 2013-05-17 12:30:39 +02:00
f3fe0a6d27 Merge pull request #250 from zhuowei/master
Fixed a few missing methods due to the Multiworld conversion fixed #248
2013-05-16 22:20:38 -07:00
4678b57c75 Fixed a few missing methods due to multiworld conversion 2013-05-16 19:03:18 -07:00
7bbda6dd67 Detect non loaded chunks 2013-05-16 20:24:05 +02:00
4564765470 Added "player.teleport" 2013-05-16 19:39:15 +02:00
2305322ed0 tp help 2013-05-16 19:13:36 +02:00
848a69b28a /tp [player] w:[world] & simple /spawn 2013-05-16 19:13:03 +02:00
6a0cc4e122 Fixed teleport pitch 2013-05-16 18:13:08 +02:00
beb84ca013 Teleport fixes 2013-05-16 18:11:26 +02:00
9dd1568c40 New Player::getSpawn() 2013-05-16 18:05:05 +02:00
66322d7719 Selector aliases & @world & /spawnpoint 2013-05-16 18:02:24 +02:00
ad4959f8c0 Fixed selectors 2013-05-16 17:44:43 +02:00
fceb076b9b Better speed measure 2013-05-16 17:31:26 +02:00
1dbbf08f1b Use other things instead of array_shift 2013-05-16 17:30:34 +02:00
5277555d33 Relative teleporting 2013-05-16 17:21:39 +02:00
7d49847ae7 Correct teleport message 2013-05-16 17:14:02 +02:00
3cc4546f93 Fixed Level::nextSave 2013-05-16 17:07:28 +02:00
9a3f887f44 Attacking entities fixed 2013-05-16 16:41:54 +02:00
1f8987183b Removed libevent 2013-05-16 16:12:15 +02:00
072e1328f1 Updated pthreads version 2013-05-15 23:37:54 +02:00
d071497747 Fixed redstone scheduled update 2013-05-15 23:30:47 +02:00
e0e724bcc3 Saving entities/tiles 2013-05-15 23:30:46 +02:00
fb69cf3392 Chunk unloading fixed 2013-05-15 23:30:45 +02:00
f1e4bb0f62 Scheduled saving 2013-05-15 23:30:44 +02:00
244fde8143 Chunk unloading 2013-05-15 23:30:43 +02:00
3f532d419c Saplings 2013-05-15 23:30:43 +02:00
6f59e2eaad Time API working with changes 2013-05-15 23:30:42 +02:00
5ee2cda4a6 Level-independient time change 2013-05-15 23:30:41 +02:00
e63677a23d Level saving 2013-05-15 23:30:40 +02:00
78baa237e3 Remove teleporting players from the other world 2013-05-15 23:30:39 +02:00
3fca7ab6a5 Don't fire events in different worlds 2013-05-15 23:30:38 +02:00
9e55de134f Added /seed 2013-05-15 23:30:37 +02:00
bcbc65ed5e Added /spawn [world] [player] 2013-05-15 23:30:36 +02:00
838e08b33b Fixed metadata packing 2013-05-15 23:30:36 +02:00
991436993f Fixed things 2013-05-15 23:30:35 +02:00
cef4347a02 Fixed error with world teleporting 2013-05-15 23:30:34 +02:00
de5be4168d Fixed RCON non-blocking sockets 2013-05-15 23:30:33 +02:00
33bd66c1da Added world teleporting 2013-05-15 23:30:33 +02:00
7de0835ad9 Chat Selectors [@player] 2013-05-15 23:30:32 +02:00
d0d5c1bb79 CMD Selectors [@all, @player, @random] 2013-05-15 23:30:31 +02:00
c6c82f7e55 Player scheduled actions get cleaned 2013-05-15 23:30:30 +02:00
5dade755eb Fixed Player memory leak 2013-05-15 23:30:29 +02:00
24c0e2742a Fixes 2013-05-15 23:30:29 +02:00
c27cca6741 More fixes :D 2013-05-15 23:30:28 +02:00
7236f4aad6 Few fixes 2013-05-15 23:30:25 +02:00
2254e87ce4 PMF & Multiworld [part 3] 2013-05-15 23:30:24 +02:00
5938747083 PMF & Multiworld [part 2] 2013-05-15 23:30:22 +02:00
9b212ae034 New stats 2013-05-15 23:30:21 +02:00
db8f50f408 PMF & Multiworld [part 1] 2013-05-15 23:30:20 +02:00
bbbc54f606 New API version 2013-05-15 23:30:19 +02:00
703803eb6b New pthreads version 2013-05-12 12:32:02 +02:00
60b559d64b Added webhook 2013-05-12 13:19:57 +03:00
6610f82ceb Updated PHP version 2013-05-12 11:48:23 +02:00
73867f1f80 Updated ZLIB version 2013-05-10 21:49:45 +09:30
cfb2d939a4 Added little bits of comments to the BanAPI for better understanding by newbies. 2013-05-10 18:38:32 +09:30
5b6724a452 Mac machines are detected 2013-04-29 00:46:36 +03:00
4ec2bed44d More fix 2013-04-27 01:02:30 +02:00
2a4d2a92ab Fix :DD (remove temp. feature) 2013-04-27 00:49:59 +02:00
47e9a7b6a1 Fix :D 2013-04-27 00:43:42 +02:00
d7a54123e2 New Event ConsoleLoop 2013-04-27 00:39:59 +02:00
3cae25cebd Fix ^^ 2013-04-27 00:27:37 +02:00
e0727d2e57 Fix 2013-04-27 00:21:22 +02:00
77ecdb8727 Event test in ConsoleAPI 2013-04-27 00:15:01 +02:00
21150cd239 Added Event and libevent to README.md 2013-04-26 23:55:03 +02:00
cea84879e7 OCD 2013-04-26 23:35:07 +02:00
e43c45768d Added Event support 2013-04-26 23:25:26 +02:00
d48a1a6ce3 Fixed typo 2013-04-26 23:15:06 +02:00
83cce9cdf3 *changes* 2013-04-26 23:01:13 +02:00
d56328b16a Added PHP event and libevent2 for testing 2013-04-26 21:22:56 +02:00
8aa047b3f0 Removed obsolete methods from the Utils class 2013-04-26 19:56:08 +02:00
c4ff8921f1 StackableArrays class 2013-04-25 20:29:45 +02:00
6a4010a9af Fixed plugins not generating their config file 2013-04-25 18:52:14 +02:00
8149c9e7ca Better plugin list in the Error dump 2013-04-25 18:31:03 +02:00
a3a2155026 Removed startup binary I/O test 2013-04-25 18:30:44 +02:00
173784752e Added GIT_COMMIT to the Error dump 2013-04-25 17:54:32 +02:00
33a614c615 Removed libevent dependency 2013-04-25 17:29:32 +02:00
515fcf0890 Updated build script path 2013-04-24 22:27:45 +02:00
72208d9159 Added shmop to build script 2013-04-24 20:32:25 +02:00
31ffe8017f Updated build script for libevent 2013-04-24 19:37:02 +02:00
9624b9c35e Added libevent dependency 2013-04-24 00:41:37 +02:00
9b07994913 Chat & Console fixes 2013-04-23 19:21:08 +02:00
fea6e9c432 Fixed Container::check() blacklist 2013-04-23 18:21:37 +02:00
13aa73d26e Added correct Painting placing checks & bigger Paintings 2013-04-23 15:32:09 +02:00
dffbfa0754 PlayerAPI teleport commands now return a correct name 2013-04-23 12:42:43 +02:00
2e4724c596 Added Query protocol description 2013-04-23 12:18:08 +02:00
3378c44542 Added output redirection to kill() 2013-04-23 11:59:34 +02:00
093bf3ddee Query now checks for the last token when changed (30-sec change) 2013-04-23 11:44:58 +02:00
85e3c08aa9 Added the "rcon.port", "rcon.threads", "rcon.clients-per-thread" ghost properties 2013-04-23 11:39:39 +02:00
8345fd02c4 Set default gamemode to SURVIVAL 2013-04-23 10:49:25 +02:00
1c03fb0de9 Removed the rcon.port property, being the same as the server 2013-04-23 10:33:15 +02:00
2ae0cf65c5 Added protocol info to README.md 2013-04-23 02:00:22 +02:00
cb42e5832b Added documentation for RCON and Query 2013-04-23 01:21:34 +02:00
ee73ccc0e2 Remoced "hostip" from Query 2013-04-23 01:17:39 +02:00
cc2addfe92 Implemented Query protocol 2013-04-23 00:58:26 +02:00
be7e5cd67a Unknown packets are always discarded even if they have been processed 2013-04-22 23:46:34 +02:00
e428b4cfc4 Limited RCON threads to one and added a auth timeout 2013-04-22 23:33:46 +02:00
f466e1f791 Added Player::getSlot() for consistency 2013-04-22 21:01:53 +02:00
bb9a6146fd Raised the speed limit 2013-04-22 19:20:25 +02:00
34ca8baa29 Fixed "player.interact" event only being fired with weird conditions 2013-04-22 18:46:35 +02:00
d552042094 Fixed #166 2013-04-22 17:25:45 +02:00
6457055be3 Added TimeAPI command responses 2013-04-22 16:51:04 +02:00
02bbfb60b6 Increased RCON max clients per thread to 25 (total 100 clients) 2013-04-22 16:46:48 +02:00
b759863bb1 Changed /list to be the same as vanilla 2013-04-22 16:39:33 +02:00
e81793174b Multiple RCON clients per thread, allow external connections 2013-04-22 16:28:24 +02:00
d08807abaf Added 4 RCON threads 2013-04-22 14:29:30 +02:00
1cb3e25bf9 Added RCON protocol 2013-04-22 14:22:52 +02:00
70056b8d1f Save config filles automatically after adding new defaults 2013-04-22 00:05:56 +02:00
2f1e37ce6c Updated Spyc library 2013-04-21 22:29:44 +02:00
80488784f9 Updated cURL release 2013-04-21 22:23:52 +02:00
55b8401967 Updated pthreads version 2013-04-21 22:22:43 +02:00
269e63ab50 Rewrite /defaultgamemode command to allow multiple values 2013-04-20 21:00:52 +02:00
d0d8d281d2 Revert "Added coordinates command. Displays your coordinates"
This reverts commit 4434fe2a5b.
2013-04-20 20:56:58 +02:00
4434fe2a5b Added coordinates command. Displays your coordinates 2013-04-20 14:45:35 +09:30
82c72f8beb Added defaultgamemode command 2013-04-20 12:26:26 +09:30
083110ffd0 Fixed #194 Implemented armor damage reduction 2013-04-19 14:31:41 +02:00
0bea234788 Fixed #206 2013-04-19 13:53:58 +02:00
e444f2a9e0 Fixed #208 2013-04-19 13:40:02 +02:00
38950969dd Added Player::setSpawn(Vector3 $pos) method 2013-04-18 22:34:12 +02:00
9a4c3f8c9f Revert "Updated PHP version on .travis.yml"
This reverts commit e4e649ec49.
2013-04-18 20:37:07 +02:00
c3a0600ffd Added __get() magic methods to Player and set some properties private 2013-04-18 20:22:20 +02:00
78167a3cd4 Fixed players not getting their inventory reset on gamemode change 2013-04-18 19:33:51 +02:00
724e9d9bb2 Fixed changing gamemodes 2013-04-18 17:25:07 +02:00
8b41246f2d Added "player.gamemode.change" 2013-04-18 17:18:42 +02:00
e4e649ec49 Updated PHP version on .travis.yml 2013-04-18 17:10:14 +02:00
639ca67a10 Blocked again opening of chests in Creative mode 2013-04-18 17:05:26 +02:00
96baeaaad2 Fixed VIEW gamemode crash 2013-04-18 16:54:48 +02:00
bcb76b51f4 Fixed setting more gamemodes 2013-04-18 16:43:00 +02:00
3577667039 New VIEW gamemode 2013-04-18 16:40:30 +02:00
5848d283da Correct MC_LOGIN_STATUS usage 2013-04-18 16:16:54 +02:00
8f724ffc46 Resend slot on change 2013-04-17 23:29:44 +02:00
26c2f61da0 Added fix so players aren't targeted by name completion by default 2013-04-17 23:02:53 +02:00
fd8166c836 Obligatory Creative mode item enforcement 2013-04-17 22:57:44 +02:00
bc80c01348 Return output of commands on ConsoleAPI::run() method 2013-04-17 20:24:10 +02:00
e0a59486eb Force inventory sending on death 2013-04-17 20:15:51 +02:00
393f54fe28 /give compatible with "item-enforcement" = off 2013-04-17 19:48:13 +02:00
1885cdf3a2 Changed item enforcement option name 2013-04-17 19:41:46 +02:00
e65731e3ec Item enforcement optional for packet sending 2013-04-17 19:38:29 +02:00
f7f05d4175 Paintings are removed at usage 2013-04-17 19:32:06 +02:00
cd8211a9d3 Fixed client-side item duplication 2013-04-17 19:31:15 +02:00
09301f0e5f Added a way to send Player's inventory directly 2013-04-17 19:25:53 +02:00
5e4ef9732b Oops! 2013-04-17 17:23:12 +02:00
44cb66837e Fixed torch sides 2013-04-17 17:22:57 +02:00
f195168132 Fixed Player not getting in survival mode removed due to BlockAPI checking Server default gamemode 2013-04-17 17:13:36 +02:00
32e0085c1e Allow placing torches on top of side blocks 2013-04-17 17:10:05 +02:00
b34e55eec5 Torches drop when no supporting block is present 2013-04-17 17:09:48 +02:00
758070e478 Optimized block updates 2013-04-17 16:41:36 +02:00
2790f60491 Added Redstone Ore block update 2013-04-17 16:36:37 +02:00
d8bf5ce711 Added Cakes 2013-04-16 20:00:41 +02:00
bbbdaa30d1 Better online player list 2013-04-16 19:48:33 +02:00
2438c9535b Only shown available commands in help 2013-04-16 19:46:14 +02:00
3d48eec887 Allow looking the help of an alias 2013-04-16 19:41:37 +02:00
f1cb29cc8b Increased Socket buffer size 2013-04-16 19:11:03 +02:00
710ed5c704 Improved block updates and Scheduled block updates [part1] 2013-04-16 17:15:39 +02:00
3c40c8734f Changed PHP directory [migration included] 2013-04-15 16:02:43 +02:00
80aaf9923c Fixed packets being discarded due to a bad ordering 2013-04-14 23:19:55 +02:00
cad9908f94 Added new network reliability identifiers 2013-04-14 18:47:50 +02:00
9ad73b00c8 Removed online broadcast 2013-04-14 18:47:34 +02:00
fb805f2b0f Re-fixed #200 2013-04-14 17:08:05 +02:00
e0791b9bae Log out message 2013-04-14 17:00:13 +02:00
10d34a7ce6 Fixed 0x60 packets being received 2013-04-14 16:58:54 +02:00
69b78a9dd6 Send Usage data again 2013-04-14 16:30:26 +02:00
8442c0529e Added player.connect (pre-join) 2013-04-14 16:19:27 +02:00
77da9d3a7c Chat messages are shown on the server log 2013-04-14 16:19:16 +02:00
5e9e2b2a7d Commands are executed as console by default 2013-04-14 16:10:41 +02:00
88a4116398 Fixed #200 Running in a folder with spaces 2013-04-14 13:10:04 +02:00
633f7233b4 New network reliability layer 2013-04-14 13:04:57 +02:00
a92518ef9e Fixed console messages without [TAG] 2013-04-14 13:01:50 +02:00
0c051fb02e Removed MP chat tag 2013-04-13 20:03:07 +02:00
e71b6946f3 Fixed /help paging 2013-04-13 20:01:27 +02:00
d157299c7a Updated console texts and help 2013-04-13 19:47:20 +02:00
82d49b0343 PluginAPI API error to warning 2013-04-13 18:55:29 +02:00
790b9c19b6 Fixed hack check crash 2013-04-13 16:22:05 +02:00
439d0ead4f Default equipment fix 2013-04-13 14:37:01 +02:00
3ae18c85b1 Round coords at spawn 2013-04-13 14:34:04 +02:00
74c4fab58d Space 2013-04-13 14:32:58 +02:00
199fbb644b Fixed spawning despawned entities 2013-04-13 14:21:58 +02:00
4867533ab7 Removed TNT explosion on break 2013-04-13 13:47:37 +02:00
452df5b2f8 Added Buckets 2013-04-13 13:42:55 +02:00
c334bbce12 Item change protection 2013-04-13 13:37:14 +02:00
8d7fafe167 Removed /crash 2013-04-13 13:23:05 +02:00
996bf6b366 Updated PHP & pthreads version 2013-04-13 13:02:41 +02:00
1cf61fc829 Fixed #196 syntax error 2013-04-13 11:55:45 +02:00
75a2bf122f Added "disallow-crafting" to enable item protection 2013-04-12 23:11:07 +02:00
159d1c5024 Added missing parameters 2013-04-12 23:09:28 +02:00
e2b68a01d1 UDP Sokcet port blocking exit 2013-04-12 20:35:39 +02:00
bab3b8274a Explosions 2013-04-12 20:35:16 +02:00
a6615560bc fix. 2013-04-12 14:21:09 +02:00
62735c8e41 Changed messages 2013-04-12 14:20:52 +02:00
5c2a2ecd6d Added a security radius for flying 2013-04-12 14:09:36 +02:00
432eb36b83 Fixed support check height difference 2013-04-12 14:06:12 +02:00
7388a32869 Fixed flying check support range 2013-04-12 14:04:57 +02:00
83a63ef805 Added login packet protection 2013-04-12 13:59:21 +02:00
c45cd5e12a Fixed a crash 2013-04-12 13:58:25 +02:00
c138cb2797 Fixed player death name 2013-04-12 13:55:26 +02:00
feaecbcd60 First usage report 5 minutes after the server restart. 2013-04-11 23:16:29 +02:00
3e4efbb26a Fixed players not being able to move after being damaged 2013-04-11 22:40:18 +02:00
b9498275a4 Fixed /invisible not working 2013-04-11 22:35:47 +02:00
f7af97c651 Direct fix for speed hack 2013-04-09 21:07:35 +02:00
076691ec52 Added fixes for hacks like Health protection and speed hack 2013-04-09 21:02:46 +02:00
2763401be3 /give now checks correctly 2013-04-09 20:44:57 +02:00
a3b7f12803 /banip add <player> works banning the Player's IP 2013-04-09 19:52:10 +02:00
eac72bb8ae Added "player.flying" event, ops can always fly 2013-04-09 19:11:45 +02:00
7b8a27f7b0 Removed time-per-second property 2013-04-09 19:04:01 +02:00
6ba7486097 Gamemode check for flying 2013-04-09 18:58:32 +02:00
4dd66b450c Flying damage & kicks less random 2013-04-09 18:57:41 +02:00
2b741a2913 Fixed crashes, added flying check 2013-04-09 18:44:13 +02:00
2043534003 Removed constant property file write 2013-04-09 17:39:36 +02:00
7e37a60a67 Changed property names for consistency (migration included) 2013-04-09 17:35:37 +02:00
f093286fb2 Disallow joining invisible servers 2013-04-09 17:26:30 +02:00
7c9eec7869 Added a parameter to remove directly the async thread 2013-04-09 17:23:29 +02:00
79ca735fb0 Fixed a weird, random, pthreads-caused crash 2013-04-09 17:21:49 +02:00
533b175b66 Syntax error 2013-04-09 17:09:21 +02:00
2c81518c5d OP players are automatically whitelisted 2013-04-09 17:08:44 +02:00
dccfbfd572 Added "view-distance" setting to change chunk sending radius 2013-04-09 17:07:17 +02:00
e88c337229 Added the "spawn-protection" property to define the protection radius 2013-04-09 17:02:03 +02:00
5f55cdf26a Added pvp server property 2013-04-09 16:58:52 +02:00
3e3521086b Fixed crash due to new API changes 2013-04-08 23:07:01 +02:00
01e31fc82e Updated test to reflect changes 2013-04-08 22:59:34 +02:00
b66e784a12 Removed GMP dependency, using bundled BCMath 2013-04-08 20:23:44 +02:00
20694f2c77 Changes to Threads 2013-04-07 14:35:39 +02:00
539c8046d8 Removed deprecated chat() method in server 2013-04-07 13:47:11 +02:00
1d32e82265 Usage sending in background 2013-04-07 12:28:34 +02:00
12f9c12fe4 Changed default file permissions 2013-04-07 12:15:34 +02:00
0060c3f10d Duplicated chunk loading speed 2013-04-05 16:33:47 +02:00
6456d2383b Added a spawn protection 2013-04-05 15:51:19 +02:00
793aaf87c0 /op and /deop needs the player connected 2013-04-05 15:37:18 +02:00
f7de979de1 Added commands to whitelist 2013-04-05 15:14:32 +02:00
82a789687c Added /me 2013-04-05 15:13:17 +02:00
026353399b Added /tell 2013-04-05 15:09:25 +02:00
febfbb19c4 Updated /gamemode command to follow Minecraft structure 2013-04-05 14:09:02 +02:00
45bbc86830 Username completion & better gamemode change 2013-04-05 14:04:51 +02:00
3d8c9db430 Fixed #183 Players taking damage landing on water (temp. fix) 2013-04-05 12:43:18 +02:00
8405c74b42 Fixed #186 players not teleporting due to speed check 2013-04-05 12:41:05 +02:00
93cfa035d4 Fixed #187 Opening Chests with solid blocks on top 2013-04-05 12:37:08 +02:00
463e82a1e7 Changed final public methods 2013-04-04 12:04:03 +02:00
cd946a7273 Added fix to Utils::getOS() method 2013-04-03 19:21:12 +02:00
074c1b5295 Added a fix so higher PMF version files doesn't get loaded 2013-04-03 13:20:18 +02:00
ad6b48a599 Updated README.md 2013-04-03 12:43:54 +02:00
e77db15c21 Error suppression 2013-04-03 12:30:51 +02:00
683fd03f45 Set process title PHP 5.5 function fallback 2013-04-03 12:28:57 +02:00
dbc357c266 Removed killing php to end the process 2013-04-03 12:21:12 +02:00
e0747a9c44 PHP 5.5 2013-04-03 11:38:50 +02:00
cdc164729c Added server.unknownpacket to receive unknown packets 2013-04-02 20:45:30 +02:00
4e8e132fcf Added damage for Axe, Pickaxe, and Shovel 2013-04-02 16:37:08 +02:00
77fa1608c1 Fixed #179 2013-04-02 16:33:15 +02:00
e3a858a089 Merge pull request #179 from williamtdr/master
Updated Player.php for sword damage amounts
2013-04-02 07:27:55 -07:00
eeb9b925a5 Removed unnecessary left bracket causing syntax error
Sorry 'bout that.
2013-04-01 18:01:15 -05:00
082c4429cd Updated PECL pthreads release 2013-04-02 00:14:19 +02:00
314da7b30e Update Player.php
Swords now do proper damage amount
2013-04-01 12:03:38 -05:00
1129df6194 View connection lag in-game 2013-04-01 16:25:25 +02:00
1ef0a41944 Added Ping / Pong system 2013-04-01 16:03:43 +02:00
1cb30601b5 20 mini chunks / second 2013-04-01 14:54:08 +02:00
534898167e Improve loading on Y chunks 2013-04-01 14:49:13 +02:00
f53877c070 Fixed a few things
REALLY BUGGY!!! DO NOT USE THIS!
2013-03-31 15:03:13 +02:00
ecc2faffea Fixed #128 player death 2013-03-31 14:44:39 +02:00
66169d63c4 Force chunk resend on teleport 2013-03-31 13:50:13 +02:00
b83ef4e70b Automatically remove ANSI codes from chat 2013-03-31 13:36:19 +02:00
e2d4b49266 Remove single beds 2013-03-31 13:27:31 +02:00
1b92b1177c Fixed #176 bed breaking not removing origin block 2013-03-31 13:25:58 +02:00
251b88f8ba Limited Player tick time queue further 2013-03-31 13:20:05 +02:00
f8c6921ac4 Few protocol edits 2013-03-31 00:12:19 +01:00
2b03e71c97 Do not measure Y dimension for moving speed 2013-03-30 21:38:29 +01:00
263824fa01 Fixed division by zero 2013-03-30 21:35:59 +01:00
abf52079fc Chunk loading based on X,Y,Z (+1 dimension) 2013-03-30 21:35:50 +01:00
7312c57123 Improved internal Client IDs 2013-03-30 21:09:12 +01:00
f7a12b09f7 Better Player queue completion limited by time 2013-03-30 20:56:01 +01:00
949ab34b42 Added player.block.(break/place).invalid handling events 2013-03-30 20:26:15 +01:00
121fd51dc6 Fixed placing blocks on activable blocks 2013-03-30 19:51:21 +01:00
44fcf4a6ed Noob-proof memory-limit server property 2013-03-30 19:36:49 +01:00
a6cc0f8261 Same for Peak Memory usage 2013-03-30 19:34:08 +01:00
bd196c0fcb Typo 2013-03-30 19:33:18 +01:00
caa32edf6f Get REAL memory usage, not allocated 2013-03-30 19:33:05 +01:00
87ebe7fac4 Generic importing to PMF Level format 2013-03-30 14:08:22 +01:00
8c9f07f737 PMF Level format fixes 2013-03-30 14:08:11 +01:00
cbe160e655 Fixed #169 and fixed #168 2013-03-30 13:11:06 +01:00
efa8692bfa Added wget dependency 2013-03-30 02:25:12 +01:00
3f2cb86859 Normalized Item Names 2013-03-29 20:11:53 +01:00
6d39f54591 Removed $server constructor arguments because of ServerAPI::request() 2013-03-29 19:49:33 +01:00
af52b0a5b5 Fixed ACK/NACK range writing 2013-03-29 11:18:47 +01:00
257b330a53 Fixed ACK/NACK range reading 2013-03-29 11:07:45 +01:00
8a9e6426ca Optional teleport yaw & pitch 2013-03-29 10:56:28 +01:00
3f820d18d2 Removed teleport jerking 2013-03-29 10:54:58 +01:00
677e1f8ce0 Added Player automatic blocking during spawn or gamemode change 2013-03-28 17:59:45 +01:00
822adcae2d Packet Cleaning 2013-03-28 16:56:50 +01:00
4ea4431986 Less Server->Client NACK usage 2013-03-28 14:37:35 +01:00
e392a35598 Fixed client-side ACK & NACK 2013-03-28 14:08:45 +01:00
912e35f202 Fixed server-side NACK & ACK 2013-03-28 13:59:56 +01:00
f1a28f23ae New ACK/NACK structure & Packet multiple ressend issue 2013-03-28 13:56:11 +01:00
c68b4ebda6 Few packet loss system fixes 2013-03-28 13:10:51 +01:00
98976ac56c Fixed NACK handling - Works even with 90% packet loss 2013-03-28 13:00:18 +01:00
42d5296533 Fixed invalid ACK/NACK handling 2013-03-28 11:20:40 +01:00
6260d66bde Updated pthreads version in compiler 2013-03-28 10:59:33 +01:00
2861fe0703 New Plugin format includes multiple API versions 2013-03-27 18:02:10 +01:00
012ecbe40a Fixed #165 2013-03-27 15:53:48 +01:00
c5326131a2 Fixed a server crash related to #162 2013-03-25 20:26:20 +01:00
174160c65c Fixed incorrect gamemode change close message 2013-03-25 19:57:57 +01:00
a5998ff9a2 Start of API 6
Don't try making plugins with this until the stable release
2013-03-25 18:55:25 +01:00
ec5f255a71 Fixed bad PMFLevel::getXZ() logic 2013-03-25 18:54:25 +01:00
e7fcbe206f Create PMF Levels 2013-03-25 18:46:08 +01:00
89b38c25ce Raised ticks directive to 40 2013-03-25 16:46:01 +01:00
88a1f83545 Added protection for fast movements 2013-03-24 11:02:37 +01:00
14ab386b0f Fixed typo 2013-03-23 23:00:23 +01:00
7dbf421e99 Fixed things in PMF Level 2013-03-23 22:46:54 +01:00
0d3624e6a7 :DDDD 2013-03-23 18:27:21 +01:00
14ff3e0a9b Internal API's are now shown as Debug level 2013-03-23 18:26:18 +01:00
ae731c9093 Added the caseusername preference on offline player data 2013-03-23 18:21:40 +01:00
d613fa2138 Fixed Chest Slots not getting sent and shown 2013-03-23 17:44:32 +01:00
5e52bbdd16 Fixed Syntax Error 2013-03-23 17:33:06 +01:00
0b6ff03d5a Revert "API version changed to 6"
This reverts commit 1ff8945015.
2013-03-23 17:32:51 +01:00
1ff8945015 API version changed to 6 2013-03-23 17:18:02 +01:00
a603732bb4 PMF Level reader 2013-03-23 16:59:44 +01:00
23a7847350 Added Plugin List on sendUsage() 2013-03-23 13:14:14 +01:00
f07cd21dd1 Updated PMF 2013-03-23 13:04:02 +01:00
8bbd899689 Fixed #156 2013-03-22 14:44:22 +01:00
2a8c72dfc2 Updated the compile script 2013-03-22 13:51:53 +01:00
59763a35c7 Reverting 75a42ce26c 2013-03-21 17:03:22 +01:00
2e0d49a2ba Moved the RAKNET_MAGIC constant 2013-03-21 17:03:13 +01:00
6e4141f140 Changed the Utils::isOnline() method 2013-03-21 16:27:02 +01:00
75a42ce26c Added reload feature UNTESTED 2013-03-21 22:41:25 +10:30
38d361bb07 Added Wooden Tools Item Settings 2013-03-21 16:50:09 +10:30
13ae305bdd Change to dev version 2013-03-20 19:06:10 +01:00
ec55ebc14e Sign Post orientation 2013-03-20 19:03:09 +01:00
698515f31b Fixed #152 #149 2013-03-20 18:39:24 +01:00
58c258d422 Cancellation of entity.move and player.move (impeding player movement) 2013-03-20 18:35:32 +01:00
eb90c777f3 Better Teleportation 2013-03-20 18:32:47 +01:00
7a0ff2a1c0 Updated some level things 2013-03-20 18:23:08 +01:00
57df6e61aa Raised buffer time 2013-03-20 18:14:04 +01:00
5e44ecf63b Paginated help command 2013-03-20 18:12:06 +01:00
4a9374a58c Updated compile script 2013-03-20 17:51:23 +01:00
f936e29d34 TPS check 2013-03-20 16:42:20 +01:00
6dba82c695 Disable reloading the config from server 2013-03-20 16:38:38 +01:00
df77f725fd Syntax error fix 2013-03-20 15:45:03 +01:00
2c952a5a4f Removed equipment change notification 2013-03-20 15:20:21 +01:00
9ee7180681 Lower API version of a plugin is notified with a debug level of 2 2013-03-20 15:19:24 +01:00
65110d5358 Removed /harm 2013-03-20 15:17:58 +01:00
da849a7251 /say is now prefixed by [Server] 2013-03-20 15:17:22 +01:00
28d431e497 Removed reference in BlockAPI::drop() of Server gamemode 2013-03-20 15:16:37 +01:00
9bd4b02908 Cancel past movements 2013-03-20 14:56:18 +01:00
4ff9753ede Checking for GIT now stops the update on the latest version 2013-03-20 14:51:06 +01:00
518902caf4 fixed creative players taking damage 2013-03-19 23:44:23 +01:00
2c3ab413f5 Fixed Creative players spawning drops 2013-03-19 23:44:10 +01:00
3ba56c3e81 Independient Player gamemode, saved between sessions, set it via /gamemode 2013-03-19 19:54:13 +01:00
49d2723806 Fixed Entity updates getting duplicated and negated 2013-03-19 19:07:07 +01:00
70b86061f6 Drowing is only checked once per check 2013-03-19 19:05:46 +01:00
6a29dd5a8d Ghost players don't leave a quit message 2013-03-19 18:59:44 +01:00
58631ba1d0 Send the entire Buffer at disconnect 2013-03-19 18:58:10 +01:00
fe2b9a6ac5 Fixed memory Leak 2013-03-19 18:55:35 +01:00
4d2835a37a Swapped X and Z 2013-03-19 18:39:29 +01:00
e1c5d965a0 Disable placing a chest when a chest already exists on the side 2013-03-19 18:21:43 +01:00
a3268d2405 Update README.md 2013-03-19 18:07:32 +01:00
5eaa432ddb Updated API Domain 2013-03-19 17:06:01 +01:00
acc0311386 Lowercase enforcement (fixes #144) 2013-03-19 16:06:23 +01:00
8842d8d772 Fixed EID typo on TileEntity API 2013-03-18 17:08:34 +01:00
6fb8e754d6 Fixed #142 Server crash while using whitelist 2013-03-18 15:06:39 +01:00
6763e93a8d Obtain GIT information 2013-03-17 17:35:33 +01:00
40b43a911e Optimization 2013-03-17 17:26:15 +01:00
012c86ef00 Player Entity preload 2013-03-17 16:56:36 +01:00
5fedf27255 Player gamemode fix 2013-03-17 16:51:08 +01:00
3967c8eec1 Sandstone ^^ 2013-03-17 16:42:46 +01:00
23ca20855a New Generated worlds are higher (so no more complains about "moving walls") 2013-03-17 16:39:42 +01:00
01628b88b7 Added Furnace inventory 2013-03-17 11:47:52 +01:00
b5cd877b3e Updated Tile Slot handling 2013-03-17 11:47:43 +01:00
c536a35beb Player data now uses YAML 2013-03-16 23:26:46 +01:00
bb968451ba Players are able to omit arguments on /tp, /tppos, /kill 2013-03-16 20:36:08 +01:00
a5e52e7b9a Players now respawn on the server's spawn point 2013-03-16 20:19:06 +01:00
47af98a875 Fixed spawning on top of chunks & added Player::teleport() method 2013-03-16 19:36:30 +01:00
ed003cd207 Updated the API version 2013-03-16 19:36:08 +01:00
3bf9d5b911 Dev Alpha_1.3dev 2013-03-16 13:23:53 +01:00
db4bdcd2bd PocketMine-MP Alpha_1.2.1 2013-03-16 13:12:08 +01:00
ce8724c5ed PMF Plugin Loading 2013-03-16 12:52:14 +01:00
d46a61d0c4 Removed Server getting via Plugin Loading 2013-03-16 12:29:29 +01:00
1bfef261ab PMF Plugin Reading 2013-03-16 12:27:23 +01:00
6dfe348767 Added Command Permissions Whitelist 2013-03-16 09:54:42 +01:00
3f10e11ddf Array format fixes 2013-03-16 00:21:50 +01:00
5b79722fa9 Better NACK handling (#133, #16, fixes #75) 2013-03-16 00:16:47 +01:00
fc06e1bcaf Packet Sending Buffering 2013-03-16 00:09:00 +01:00
ffaaca6f2d PMF class 2013-03-15 21:54:19 +01:00
0660409987 Updated Spyc 2013-03-14 21:55:50 +01:00
bbc925b188 Updated Message level of World generation 2013-03-14 21:55:31 +01:00
6f7268902d Added the libtool dependency to the compile script 2013-03-14 19:42:23 +01:00
6851f9c7b1 Added a dynamic title function 2013-03-14 16:36:34 +01:00
9ec9d22bbc BlockAPI::setBlock now uses a Vector3 2013-03-10 13:34:11 +01:00
40842ec794 Fixed Vector3::add() 2013-03-10 13:33:52 +01:00
ab1c28fc57 Changed the api.op.check event check 2013-03-09 22:38:53 +01:00
a9f7d47c25 Added all the future tags 2013-03-09 13:58:22 +01:00
5241f0527b Fix typo for De-Op (I know a very little change) 2013-03-09 22:52:56 +10:30
5c7f397bde Changed default debug level 2013-03-09 12:52:57 +01:00
84ac13d591 Added checks 2013-03-09 12:40:53 +01:00
8bf4b5cafa Added callable type hinting 2013-03-09 10:08:42 +01:00
7acbf13a8a Updated README.md image 2013-03-09 09:33:39 +01:00
fa4813d335 Raised save interval to 25 minutes 2013-03-09 09:31:41 +01:00
3432a69a41 Cancel correctly Handling Events using return true 2013-03-09 09:27:29 +01:00
bc5516867c Fixed Quartz Blocks not getting placed correctly 2013-03-08 23:05:57 +01:00
5c17f77bcc Name update 2013-03-07 19:56:07 +01:00
5fab555c48 Real Minecraft username check 2013-03-07 18:46:04 +01:00
ba3dfd91db Removed unnecesary replace 2013-03-07 18:11:35 +01:00
8f21eb41ee Added message separation 2013-03-07 18:06:51 +01:00
d90e41c0d5 Fixed Server description not being displayed 2013-03-07 18:05:33 +01:00
aecfbbbdc1 Removed flying damage 2013-03-07 17:56:33 +01:00
1c63448c6c Drop in the correct position 2013-03-07 17:44:28 +01:00
8253d63d9b Case-insensitive playernames, removed Client ID kick 2013-03-07 17:43:44 +01:00
a7d8e22e7e Player inventory is changed using chests (Fixes #127) 2013-03-07 17:36:19 +01:00
ad11851c61 Remove items from Player inventory on drop 2013-03-07 17:15:12 +01:00
b259ed2532 Fixed #124 2013-03-06 20:29:49 +01:00
9510cbd716 New block touch event 2013-03-06 20:17:38 +01:00
8a345e6582 Target player gets notified of op 2013-03-06 19:28:24 +01:00
66fe5d2a3e Added Kicking on Ban 2013-03-06 19:21:50 +01:00
7f88ab95e2 Added the /sudo command 2013-03-06 19:19:12 +01:00
3355f71ab3 Added a tile.update event to the container slot change 2013-03-06 19:00:48 +01:00
e8c2662258 Get Item Lists from BlockAPI::fromString() method 2013-03-06 16:43:25 +01:00
6c4900cd32 Dev version 2013-03-06 14:40:58 +01:00
265549906b Version 2013-03-06 14:38:24 +01:00
b1003500c6 Revert "Possible Solution to Issue #119"
This reverts commit 365b7bec7d.
2013-03-06 14:37:45 +01:00
804636b99f Revert "Updated Possible Fix to #119"
This reverts commit 139dfdf59f.
2013-03-06 14:37:40 +01:00
139dfdf59f Updated Possible Fix to #119 2013-03-06 20:25:48 +10:30
a85c865099 OpCheck Typo fixes #121 2013-03-06 19:06:24 +10:30
365b7bec7d Possible Solution to Issue #119 2013-03-06 18:29:59 +10:30
b0722a8ab1 Changed to next release Alpha_1.3dev 2013-03-05 20:44:34 +01:00
69de47da92 PocketMine-MP Alpha_1.2 release 2013-03-05 20:36:24 +01:00
f4ce715efc Furnace Simplification 2013-03-05 20:23:39 +01:00
55cb79fdf6 Send Slot Data to other players opened chests 2013-03-05 20:17:22 +01:00
4db8c0e68d Functional Chests 2013-03-05 20:09:53 +01:00
68d71b367d Force drops on Creative mode 2013-03-05 18:00:54 +01:00
7e8e273be7 Mob Drops 2013-03-05 17:54:34 +01:00
7cf9c03735 Better Entity attacking system 2013-03-05 17:37:09 +01:00
52aa57d400 Less BlockAPI::cancelAction lag, send only to the starter Player 2013-03-05 17:19:18 +01:00
845e48db66 Instant Break protection 2013-03-05 17:16:26 +01:00
0ab5fc8fcd Entity::getDirection() method 2013-03-05 17:03:34 +01:00
3b2a7e68f3 Fixed DevTools plugin related issues 2013-03-05 13:26:10 +01:00
8c32b3d896 Removed the last backtrace funcion due to an infinite loop 2013-03-05 12:51:39 +01:00
a3e141672a Added option to change the DATA_PATH via CLI argument data-path=<directory> 2013-03-05 12:43:35 +01:00
c60e15a682 Correct Line Breaks 2013-03-04 21:36:07 +01:00
76fcad92b3 Pretty print options for Config JSON 2013-03-04 17:29:15 +01:00
a964c0e3ec Added Stack Count 2013-03-04 17:01:28 +01:00
474c1d2093 Added Vector3 preload 2013-03-04 17:01:15 +01:00
354893ba11 BlockAPI::getBlockFace() method optimization to use the Vector3 method 2013-03-04 16:50:41 +01:00
287fa7e551 Updated the BlockAPI::drop method 2013-03-04 16:50:11 +01:00
326864f889 Fixed FILE_PATH on tests 2013-03-02 15:35:07 +01:00
3e1dfa07c0 Once again on PHP 5.4.12, fixed krakjoe/pthreads#62 2013-03-01 18:48:44 +01:00
5aa34b2803 Downgrade to PHP 5.4.11 as a temp. fix to krakjoe/pthreads#62 2013-03-01 15:38:20 +01:00
ccd1231d42 Remove Chest TileEntities on break 2013-02-27 19:32:59 +01:00
69a1c97a36 Updated PHP to 5.4.12 2013-02-26 19:54:50 +01:00
28bfdbb3c5 Fixed the String test (fixes #117) 2013-02-26 19:21:13 +01:00
0852c42de7 Removing sudo on travis 2013-02-26 12:18:05 +01:00
44dc1b13e3 Fixed breaking a bed from the bottom part 2013-02-25 20:54:16 +01:00
8d522077c4 Removed big & nasty unhandled message for inventory sending 2013-02-25 20:51:32 +01:00
53b79a1f7b Fixed Bed Breaking & added return info 2013-02-25 20:49:34 +01:00
66d43228cd Added comments to bed block fix 2013-02-19 18:10:55 +10:30
536bfa1f46 Correct Bed Breaking UNSTABLE NEEDS TESTING 2013-02-19 17:43:20 +10:30
6bed89f4b5 Update PocketMine-MP.php 2013-02-16 23:12:38 +01:00
20e6d19d85 Added GMP base 2013-02-15 20:11:40 +01:00
b3db08a370 Removed Math_BigInteger dependency 2013-02-15 20:04:21 +01:00
39df588dd9 Removed header 2013-02-14 21:24:26 +01:00
874571d572 Changes made to be compatible with the DevTools plugin 2013-02-14 20:37:16 +01:00
717c668787 Removed includes, moving to only one main folder 2013-02-13 20:35:56 +01:00
09e81b8e17 New tests branch 2013-02-12 16:55:01 +01:00
45192c4448 Updated gamemode constant names 2013-02-12 16:42:58 +01:00
6c4670421c Moved tests 2013-02-12 16:34:52 +01:00
eff4631f35 Fixes #103 2013-02-11 21:04:35 +01:00
20066ddb89 Added GeneralConstants file 2013-02-11 20:29:37 +01:00
ed1f5f225e Fixed glowstone block placing 2013-02-11 20:25:18 +01:00
881e363d1b Readme 2013-02-11 19:44:53 +01:00
db8e00ca4c Update README.md 2013-02-10 16:59:23 +01:00
ce925cd382 Updated ConsoleAPI::alias(), BlockAPI::fromString() 2013-02-10 11:04:14 +01:00
fbc1873e06 Merge branch 'master' of https://github.com/shoghicp/PocketMine-MP 2013-02-10 19:42:59 +10:30
1a2fbd7389 Added Iron Tool IDs 2013-02-10 19:41:58 +10:30
5970927e8a Fixed teleport commands for disconnected players 2013-02-09 21:03:54 +01:00
7c33c4f75a Set a name for unnamed worlds 2013-02-09 20:39:52 +01:00
6dcf9e5da1 Preparation for future changes 2013-02-09 18:07:25 +01:00
4e4aab247a Fixed #93 Path with spaces bug 2013-02-09 13:06:40 +01:00
6ef89cbf8c Added Build status 2013-02-09 12:28:52 +01:00
88b7cb7228 Merge branch 'master' of https://github.com/shoghicp/PocketMine-MP 2013-02-09 21:37:13 +10:30
731827cf7d Added Ingot Item IDs 2013-02-09 21:35:50 +10:30
9281d68bea Exit after an error with exit(1) 2013-02-09 11:32:53 +01:00
1cc15ddd42 Updated README.md 2013-02-09 11:27:17 +01:00
d0057b6595 Merge branch 'master' of https://github.com/shoghicp/PocketMine-MP 2013-02-09 20:44:00 +10:30
c7866fc352 Removed Old and Added New mailing list to README 2013-02-09 20:43:02 +10:30
862938cfc7 Fixed /whitelist reload crash 2013-02-09 10:41:36 +01:00
afbc3da6ed Now following PHPUnit file name pattern 2013-02-09 01:06:36 +01:00
aaaa68ff66 Fixed YAML syntax error 2013-02-09 01:01:20 +01:00
c46eee611f Added some Travis-CI tests 2013-02-09 00:57:41 +01:00
90c8ac1461 Better Console Alias 2013-02-08 17:46:05 +01:00
967a929723 Send Inventory Support 2013-02-08 14:17:52 +01:00
506b9f4a4f Updated packet names 2013-02-08 13:58:00 +01:00
539993751f Moved chat message to console 2013-02-08 13:52:37 +01:00
32df30448b Typo 2013-02-07 17:10:02 +01:00
e7d56a837f Added __toString() to Player, Block and Item classes & added protocol order enforcement after login 2013-02-07 17:04:04 +01:00
4d05d7da0d Fixed #96 server crash 2013-02-07 16:56:10 +01:00
498c050da7 Added OPs and permission checks 2013-02-07 09:37:15 +01:00
c2e55941d8 Added player commands, better console API and implemented future player chat 2013-02-07 09:24:44 +01:00
72388fa3cb Corrected Feather and Added Brick 2013-02-07 16:24:06 +10:30
318590e664 Merge branch 'master' of https://github.com/shoghicp/PocketMine-MP 2013-02-07 16:12:24 +10:30
466ae6290d Merge pull request #95 from snake302/patch-2
Update compile_php.sh
2013-02-06 13:14:06 -08:00
816ef08ad2 Update compile_php.sh
Update version
- pthread
- curl 7.29.0
2013-02-07 00:26:44 +04:00
e288a8a880 Multiple Paintings 2013-02-06 17:04:19 +01:00
d2dcf4f43a Switched gamemode handler to Player object 2013-02-06 16:18:15 +01:00
4aa0f8f8d1 Slab placement fix 2013-02-06 16:06:23 +01:00
5bca4242c2 Bedrock breakeable 2013-02-06 15:59:51 +01:00
93fa008acb Correct Painting placement 2013-02-06 15:57:48 +01:00
639cfc8ab8 GMP version 2013-02-06 11:22:55 +01:00
854599005a Fixed assembly instructions blocking compilation on iOS 2013-02-06 11:18:23 +01:00
72bc35a219 changes 2013-02-06 10:44:04 +01:00
d76408b809 Added Feather Item Code 2013-02-06 20:05:14 +10:30
320dc1af88 Working on Item IDs Added COAL APPLE DIAMOND STICK BOWL 2013-02-06 19:57:32 +10:30
1c05455514 Weird Painting spawn (WiP) 2013-02-05 23:25:40 +01:00
0be3379720 Updated view-distance 2013-02-05 21:43:01 +01:00
e433f0f6dc Flying damage 2013-02-05 21:33:30 +01:00
f53e08bb84 Glass pane suffocation 2013-02-05 21:18:27 +01:00
09dd47722b Meaningful crash reports 2013-02-05 19:15:51 +01:00
74f139ea85 Fixed server crash 2013-02-05 17:58:46 +01:00
b0c520f72a Send only field of view + Chunk resend support 2013-02-05 17:53:22 +01:00
e5ed7e04cf Send MiniChunks 2013-02-05 17:36:38 +01:00
7f92c6fab3 Automatic channel selection & use PocketMine.org API 2013-02-05 16:44:13 +01:00
50815c7ca8 Fixed #92 crash 2013-02-05 07:25:15 +01:00
67925b7df2 Snow Layer is now replaceable and flowable 2013-02-04 23:29:01 +01:00
23dc1033d5 Better chunk distance calculation 2013-02-04 23:11:45 +01:00
34f0e5170b Better door Hinges 2013-02-04 23:03:41 +01:00
e07302b021 Improvement in chunk sending to reduce server lag 2013-02-04 22:48:06 +01:00
ac6c3c7e69 Allow binding to an specific IP 2013-02-04 22:37:56 +01:00
6839001dc3 New Chunks are sent based on the current player position 2013-02-04 22:17:23 +01:00
1b37caf732 Added fast Item check 2013-02-04 20:48:02 +01:00
a07e002565 Added tile update event 2013-02-04 20:31:02 +01:00
25549bbf51 Updated GMP version 2013-02-04 20:27:45 +01:00
6b77a69302 Updated API methods to use less events 2013-02-04 20:27:36 +01:00
565cb9781c Bed placement 2013-02-04 19:57:23 +01:00
719dff6e3c Added API Version check 2013-02-04 19:39:00 +01:00
4f0517a5a7 Added Sign placement 2013-02-04 19:35:11 +01:00
3e87d1927d Cactus Placement 2013-02-04 19:08:31 +01:00
7e7f1892fd Instant growth using bonemeal 2013-02-04 19:00:21 +01:00
fee04cd0d9 Tilling Dirt & Grass, tall gras growth 2013-02-04 18:54:48 +01:00
a718294a08 Seed placement 2013-02-04 18:41:23 +01:00
65280d85d1 Spawning blocks/items using its name 2013-02-04 17:44:41 +01:00
cdb05f0695 Updated Entity class to reflect changes in BlockAPI 2013-02-04 17:26:55 +01:00
37f5626e9a Added more future possible placements for 2013-02-04 17:21:11 +01:00
bb27c0623c Made liquid blocks replaceable 2013-02-04 17:16:01 +01:00
3519cb230c Correct Sugarcane placement 2013-02-04 17:15:01 +01:00
213cda27aa Added conversion between Items <==> Blocks 2013-02-04 16:26:47 +01:00
d5aa898ffe Finished Adding Item IDs 2013-02-04 16:13:11 +01:00
f1c593d809 Fix for crashes via item (MCPE-1198) 2013-02-04 15:02:21 +01:00
3578b90a39 Ladder placement 2013-02-03 22:53:22 +01:00
afe33202dc Added Chest & Furnace placement 2013-02-03 22:50:59 +01:00
a5651c0f43 Door Placement, Breaking and Activation 2013-02-03 22:39:30 +01:00
9cdd616852 Corrected Fence Gate activation 2013-02-03 21:21:16 +01:00
084acfab00 Fence Gate Placement 2013-02-03 21:17:55 +01:00
59ae4f6faa Trapdoor placement & activation 2013-02-03 21:13:16 +01:00
e15392f7bc Added Quartz Stairs to placement 2013-02-03 21:03:20 +01:00
a3260814b8 Upside-down stairs placement 2013-02-03 21:01:21 +01:00
8df59078ad Stair Block placement 2013-02-03 20:59:34 +01:00
b45676d2b5 Fixed Torch block target 2013-02-03 20:47:58 +01:00
399050fc4e Added Torches placement 2013-02-03 20:45:12 +01:00
3ecbe7dbf7 Added Mushroom placement 2013-02-03 20:24:22 +01:00
a9c7a6642e Added flowers placement 2013-02-03 20:23:07 +01:00
d1610ce7a1 Check for player in range for slab placement 2013-02-03 20:21:03 +01:00
fb9a0f2119 Slab placement 2013-02-03 20:15:55 +01:00
d9c87161ba Place/Breaking/Activation logic separated from BlockAPI 2013-02-03 18:55:59 +01:00
6156baab85 Added Liquid check to Fall Damage 2013-02-03 11:03:54 +01:00
bf63065d4e Added Fall damage message 2013-02-03 10:55:54 +01:00
38a1f82456 Added Fall Damage 2013-02-03 10:51:12 +01:00
861a017fa0 Fixed redstone IDs 2013-02-02 21:14:49 +01:00
c95f671271 Added block classes to BlockAPI 2013-02-02 21:12:56 +01:00
49faebde2c Added all the blocks 2013-02-02 21:06:26 +01:00
bb68f8f305 Added PHP version check 2013-02-02 20:27:07 +01:00
8513a34358 Added construct method 2013-02-02 19:52:06 +01:00
8a9762cd31 Second sugarcane fix 2013-02-02 19:03:45 +01:00
38f40eb540 Fix for growing trees 2013-02-02 18:55:53 +01:00
69d2557e32 Fix for sugarcane placing 2013-02-02 18:50:54 +01:00
8d6d5306c1 Added Liquids properties 2013-02-02 17:50:17 +01:00
328cc968bd Added more block properties 2013-02-02 17:38:15 +01:00
e6c2ddbb47 Fixed usage stats 2013-02-02 16:21:00 +01:00
ad98fbf380 Added block info to /give command 2013-02-02 16:19:31 +01:00
34db027ffd Corrected block metadata 2013-02-02 15:53:22 +01:00
bbd113692e Disallow placing torches on ceilings 2013-02-02 15:43:20 +01:00
888e84dd69 Block Names 2013-02-02 15:42:06 +01:00
5a054a8ab4 Added new methods of Block properties (WiP) 2013-02-02 13:36:18 +01:00
4c06b384c7 Added Block Properties 2013-02-02 12:50:53 +01:00
4e740e1862 Next dev version 2013-02-01 18:30:22 +01:00
c9e459cb0f Stable release Alpha_1.1.1 2013-02-01 18:28:25 +01:00
d24d826ffd Adventure Mode 2013-02-01 18:15:14 +01:00
eaa3006d51 Implemented nametags 2013-02-01 15:02:36 +01:00
198a0e69de Updated target version 2013-02-01 00:18:35 +01:00
c7e1a36bd5 Updated version to next development release 2013-01-31 18:28:29 +01:00
f0aecabef7 Updated Version 2013-01-31 18:20:31 +01:00
60c57a6330 Correct and new slab placement (upside-down) 2013-01-31 18:20:01 +01:00
ba4fe61cdb Better event handling 2013-01-31 17:23:50 +01:00
a485536716 Fixed protocol errors 2013-01-30 23:38:07 +01:00
9ef2dc6fe1 Small changes, Ellie 2013-01-30 20:49:34 +01:00
d0a08d16e7 Added new packets 2013-01-30 20:21:18 +01:00
0e889b0139 Armor is shown on multiplayer 2013-01-30 19:57:11 +01:00
fe8b4b7aa7 Added Armor 2013-01-30 18:46:06 +01:00
1e8b012a6e Added structure version 2013-01-30 18:09:19 +01:00
5096cdcde8 Added item pickup delay 2013-01-30 18:02:13 +01:00
08b67428a0 Placing signs text 2013-01-30 17:07:43 +01:00
b697f1441e Protocol changes 4 2013-01-30 16:29:00 +01:00
62578d5fc7 Protocol changes 3 2013-01-30 16:25:26 +01:00
c787142346 Protocol changes 2 2013-01-30 16:13:33 +01:00
db38b824b7 Protocol changes 1 2013-01-30 16:00:22 +01:00
a75f8c2737 Updating version & protocol enforcement 2013-01-30 15:35:33 +01:00
9a8850cb9c Added Stonecutter 2013-01-30 12:47:47 +01:00
8d232cf623 Save paintings 2013-01-29 22:44:19 +01:00
a7079fc49b Correctly handle paintings 2013-01-29 22:38:48 +01:00
71b12191b2 Eating 2013-01-29 20:53:43 +01:00
2011d1d339 Void damage 2013-01-29 20:01:33 +01:00
1976e1c6f6 Item movement fix 2013-01-29 19:29:16 +01:00
5a2156c2bf New compile options for speed improvement 2013-01-29 19:05:47 +01:00
a86213dad8 Include Yaw and Pitch in entity tracking 2013-01-29 17:16:20 +01:00
6095432a4f Updated versions 2013-01-29 10:01:46 +01:00
46f7279a26 Fixes #83 #82 2013-01-29 08:40:36 +01:00
da2b800ea8 Changes in item spawning 2013-01-28 23:07:17 +01:00
862947ab6b Entity Motion packet (WiP) 2013-01-28 22:48:18 +01:00
f8179f0f7c Removed var_dump()! 2013-01-28 20:30:31 +01:00
db9625b52f Entity Gravity 2013-01-28 20:26:57 +01:00
fe3be181e8 Sign placing improvement 2013-01-28 19:06:39 +01:00
8a5708f47a Placing Signs 2013-01-28 19:01:41 +01:00
df46e241d3 Added marble block 2013-01-28 18:37:26 +01:00
104817162d Added upside-down stairs 2013-01-28 18:19:16 +01:00
50ae0953ac Allow for command-line arguments to starter scripts 2013-01-28 18:10:43 +01:00
d9e9b9fd22 Updated target version 2013-01-28 16:22:11 +01:00
eeb623cf21 Added new 0.6.0 blocks 2013-01-28 16:21:50 +01:00
1474d8c785 Better Tile selection & player death check and fix 2013-01-27 23:21:08 +01:00
26fb652c5a Added entity dead check for damage 2013-01-27 23:08:30 +01:00
c06ffe3003 TileEntity spawning improvement 2013-01-27 22:58:54 +01:00
2cb7a21b76 Entity and TileEntity saving 2013-01-27 21:33:57 +01:00
5c11f48270 Tile Entities & Signs 2013-01-27 19:36:12 +01:00
3c4888521d Fix for feet suffocation 2013-01-27 19:14:51 +01:00
d54161f5ca Fixed Signs sufocation 2013-01-27 18:46:09 +01:00
67341c6420 Added regeneration fix, item despawn and damage check 2013-01-27 18:23:51 +01:00
2eb93c1676 Entity metadata 2013-01-27 13:32:55 +01:00
d69291e2fa Added logged in checks 2013-01-27 11:34:24 +01:00
0c5826c8ab Water now generates source blocks 2013-01-27 11:29:43 +01:00
880121a83f Fixed a special water & lava case 2013-01-27 00:29:25 +01:00
0082bc9d10 Lava & water flow now creates stone, cobblestona and obsidian 2013-01-27 00:10:34 +01:00
895e001216 Fixed PHP-Powered memory leaks 2013-01-26 22:00:34 +01:00
1f8939da6e Fixed entities memory leak 2013-01-26 21:45:31 +01:00
c77a3c2f87 Added new IP site 2013-01-26 20:57:13 +01:00
f476cf6943 Send optional usage data 2013-01-26 20:50:34 +01:00
8e3efa0b7e Removed unknown Packet 0xa9 2013-01-26 19:01:05 +01:00
81423e6c3d Fixed health not being correctly displayed after reconnect 2013-01-26 18:55:09 +01:00
e1cf3cc25e Entity death status 2013-01-26 18:51:50 +01:00
fe7138b21e Entity moving optimization 2013-01-26 18:44:13 +01:00
234aee9dfa Entity harm sound 2013-01-26 18:24:10 +01:00
88725100a0 Version - Arggghhhhh!!!! 2013-01-26 17:36:34 +01:00
707 changed files with 61446 additions and 14342 deletions

1
.gitattributes vendored
View File

@ -5,6 +5,7 @@
*.txt text eol=lf
*.properties text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
# Custom for Visual Studio
*.cs diff=csharp

170
.gitignore vendored
View File

@ -1,134 +1,16 @@
players/*
worlds/*
plugins/*
logs/*
bin/*
*.log
*.txt
*.phar
server.properties
white-list.txt
banned-ips.txt
banned.txt
pocketmine.yml
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover
## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish
# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
############
## Windows
############
# Common IDEs
.idea/*
nbproject/*
# Windows image file caches
Thumbs.db
@ -136,38 +18,10 @@ Thumbs.db
# Folder config file
Desktop.ini
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
# Mac crap
.DS_Store
/nbproject/private/
# Sphinx-doc
/docs/build/
!/docs/requirements.txt

11
.gitmodules vendored Normal file
View File

@ -0,0 +1,11 @@
[submodule "src/pocketmine/gui"]
path = src/pocketmine/gui
url = https://github.com/PocketMine/PocketMine-MP-GUI.git
branch = master
[submodule "src/raklib"]
path = src/raklib
url = https://github.com/PocketMine/RakLib.git
branch = master
[submodule "src/spl"]
path = src/spl
url = https://github.com/PocketMine/PocketMine-SPL.git

5
.mailmap Normal file
View File

@ -0,0 +1,5 @@
Shoghi Cervantes <shoghicp@gmail.com>
Shoghi Cervantes <shoghicp@gmail.com> Shoghi Cervantes <shoghicp@pocketmine.net>
Brandon V <brandon15811@gmail.com>
Michael Yoo <sekjun9878@gmail.com> Michael Yoo <michael@yoo.id.au>
Michael Yoo <sekjun9878@gmail.com> Michael Yoo <sekjun9878@sekjun9878.info>

21
.travis.yml Normal file
View File

@ -0,0 +1,21 @@
language: php
php:
- 5.6
branches:
- master
before_script:
- mkdir plugins
- wget -O plugins/DevTools.phar https://github.com/PocketMine/DevTools/releases/download/v1.9.0/DevTools_v1.9.0.phar
- pecl install channel://pecl.php.net/pthreads-2.0.10
- pecl install channel://pecl.php.net/weakref-0.2.6
- echo | pecl install channel://pecl.php.net/yaml-1.1.1
script:
- php tests/TravisTest.php
notifications:
email: false
#webhooks: http://n.tkte.ch/h/214/wsNvmG43-ncxUVRrFPwSM-r0

140
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,140 @@
![](http://cdn.pocketmine.net/img/PocketMine-MP-h.png)
# PocketMine-MP Contribution Guidelines
You must follow these guidelines if you wish to contribute to the PocketMine-MP code base, or participate in issue tracking.
## I have a question
* For questions, please refer to the _#pocketmine_ or _#mcpedevs_ IRC channel on Freenode. There is a [WebIRC](http://webchat.freenode.net?channels=pocketmine,mcpedevs&uio=d4) if you want.
* You can ask directly to _[@PocketMine](https://twitter.com/PocketMine)_ in Twitter, but don't expect an immediate reply.
* You may use our [Forum](http://forums.pocketmine.net) to ask questions.
* We do not accept questions or support requests in our issue tracker.
## Creating an Issue
- First, use the [Issue Search](https://github.com/PocketMine/PocketMine-MP/search?ref=cmdform&type=Issues) to check if anyone has reported it.
- If your issue is related to a plugin, you must contact their original author instead of reporting it here.
- If your issue is related to a PocketMine official plugin, or our Android application, you must create an issue on that specific repository.
- **Support requests are not bugs.** Issues such as "How do I do this" are not bugs and are closed as soon as a collaborator spots it. They are referred to our Forum to seek assistance.
- **No generic titles** such as "Question", "Help", "Crash Report" etc. If an issue has a generic title they will either be closed on the spot, or a collaborator will edit it to describe the actual symptom.
- Information must be provided in the issue body, not in the title. No tags are allowed in the title, and do not change the title if the issue has been solved.
- Similarly, no generic issue reports. It is the issue submitter's responsibility to provide us an issue that is **trackable, debuggable, reproducible, reported professionally and is an actual bug**. If you do not provide us with a summary or instructions on how to reproduce the issue, it is a support request until the actual bug has been found and therefore the issue is closed.
## Contributing Code
* Use the [Pull Request](https://github.com/PocketMine/PocketMine-MP/pull/new) system, your request will be checked and discussed.
* __Create a single branch for that pull request__
* Code using the syntax as in PocketMine-MP. See below for an example.
* The code must be clear and written in English, comments included.
* Use descriptive commit titles
* __No merge commits are allowed, or multiple features per pull request__
**Thanks for contributing to PocketMine-MP!**
### Code Syntax
It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) with a few exceptions.
* Opening braces MUST go on the same line, and MUST NOT have spaces before.
* `else if` MUST be written as `elseif`. _(It is in PSR-2, but using a SHOULD)_
* Control structure keywords or opening braces MUST NOT have one space after them.
* Code MUST use tabs for indenting.
* Long arrays MAY be split across multiple lines, where each subsequent line is indented once.
* Files MUST use only the `<?php` tag.
* Files MUST NOT have an ending `?>` tag.
* Code MUST use namespaces.
* Strings SHOULD use the double quote `"` except when the single quote is required.
* Argument lists MAY NOT be split across multiple lines, except long arrays.
```php
<?php
namespace pocketmine\example;
class ExampleClass{
const EXAMPLE_CLASS_CONSTANT = 1;
public $examplePublicVariable = "defaultValue";
private $examplePrivateVariable;
public function __construct($firstArgument, &$secondArgument = null){
if($firstArgument === "exampleValue"){ //Remember to use === instead == when possible
//do things
}elseif($firstArgument === "otherValue"){
$secondArgument = function(){
return [
0 => "value1",
1 => "value2",
2 => "value3",
3 => "value4",
4 => "value5",
5 => "value6",
];
}
}
}
}
```
### RFC and Voting
* These are big Pull Requests or contributions that change important behavior.
* RFCs will be tagged with the *PR: RFC* label
* A vote will be held once the RFC is ready. All users can vote commenting on the Pull Request
* Comments MUST use "Yes" or "No" on the FIRST sentence to signify the vote, except when they don't want it to be counted.
* If your comment is a voting comment, specify the reason of your vote or it won't be counted.
* After voting has been closed, no further votes will be counted.
* An RFC will be rejected if less than 50% + 1 (simple majority) has voted Yes.
* If the RFC is approved, Team Members have the final word on its implementation or rejection.
* RFCs with complex voting options will specify the vote percentage or other details.
## Bug Tracking for Collaborators
### Labels
To provide a concise bug tracking environment, prevent the issue tracker from over flowing and to keep support requests out of the bug tracker, PocketMine-MP uses a label scheme a bit different from the default GitHub Issues labels.
PocketMine-MP uses GitHub Issues Labels. There are a total of 12 labels.
Note: For future reference, labels must not be longer than 15 letters.
#### Categories
Category labels are prefixed by `C:`. Multiple category labels may be applied to a single issue(but try to keep this to a minimum and do not overuse category labels).
- C: Core - This label is applied when the bug results in a fatal crash, or is related to neither Gameplay nor Plugin API.
- C: Gameplay - This label is applied when the bug effects the gameplay.
- C: API - This label is applied when the bug effects the Plugin API.
#### Pull Requests
Pull Requests are prefixed by `PR:`. Only one label may be applied for a Pull Request.
- PR: Bug Fix - This label is applied when the Pull Request fixes a bug.
- PR: Contribution - This label is applied when the Pull Request contributes code to PocketMine-MP such as a new feature or an improvement.
- PR: RFC - Request for Comments
#### Status
Status labels show the status of the issue. Multiple status labels may be applied.
- Reproduced - This label is applied when the bug has been reproduced, or multiple people are reporting the same issue and symptoms in which case it is automatically assumed that the bug has been reproduced in different environments.
- Debugged - This label is applied when the cause of the bug has been found.
- Priority - This label is applied when the bug is easy to fix, or if the scale of the bug is global.
- Won't Fix - This label is applied if the bug has been decided not be fixed for some reason. e.g. when the bug benefits gameplay. *This label may only be applied to a closed issue.*
#### Miscellaneous
Miscellaneous labels are labels that show status not related to debugging that bug. The To-Do label and the Mojang label may not be applied to a single issue at the same time.
- To-Do - This label is applied when the issue is not a bug, but a feature request or a list of features to be implemented that count towards a milestone.
- Mojang - This label is applied when the issue is suspected of being caused by the Minecraft: Pocket Edition client, but has not been confirmed.
- Invalid - This label is applied when the issue is reporting a false bug that works as intended, a support request, etc. *This label may only be applied to a closed issue.*
### Closing Issues
To keep the bug tracker clear of non-related issues and to prevent it from overflowing, **issues must be closed as soon as possible** (This may sound unethical, but it is MUCH better than having the BUG TRACKER filled with SUPPORT REQUESTS and "I NEED HELP").
If an issue does not conform to the "Creating an Issue" guidelines above, the issue should be closed.
### Milestones
PocketMine-MP uses GitHub Milestones to set a goal for a new release. A milestone is set on the following occasions.
- A new Beta release
- A new Stable release
A milestone must use the following format:
```
Alpha_<version_number> [release_title][release_version]
```
For example:
```
Alpha_1.4 beta2
```

View File

@ -1,35 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
require_once(dirname(__FILE__)."/src/common/dependencies.php");
require_once("API/ServerAPI.php");
$server = new ServerAPI();
$server->run();//$server->start();
//$server->join();
kill(getmypid()); //Fix for segfault

View File

@ -1,49 +1,55 @@
![](http://shoghicp.github.com/PocketMine-MP/favicon.png)
# ![PocketMine-MP](http://cdn.pocketmine.net/img/PocketMine-MP-h.png)
# PocketMine-MP
```
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
```
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
__PocketMine-MP is a Server for Minecraft Pocket Edition done in PHP__. It has a Plugin API that enables a developer to extend it and add new features, or change default ones.
The entire server is done in PHP, and has been tested, profiled and optimized to run smoothly.
__PocketMine-MP is a free, open-source software that creates Minecraft: Pocket Edition servers and allows extending its functionalities__
### [Homepage](http://www.pocketmine.org/)
### [Homepage](http://www.pocketmine.net/)
### [Go to Wiki for more information](https://github.com/shoghicp/PocketMine-MP/wiki)
### [Forums](http://forums.pocketmine.net/)
### [FAQ: Frequently Asked Questions](https://github.com/shoghicp/PocketMine-MP/wiki/Frequently-Asked-Questions)
### [Documentation](http://pocketmine-mp.readthedocs.org/)
### [Plugin Repository](http://plugins.pocketmine.net/)
<!--## [FAQ: Frequently Asked Questions](https://github.com/PocketMine/PocketMine-MP/wiki/Frequently-Asked-Questions)-->
### [Official Jenkins server](http://jenkins.pocketmine.net/)
### API Documentation
* [Official Doxygen-generated documentation](http://docs.pocketmine.net/)
* [Latest Doxygen generated from development](http://jenkins.pocketmine.net/job/PocketMine-MP-doc/doxygen/)
### [Twitter @PocketMine](https://twitter.com/PocketMine)
### [Mailing List](https://groups.google.com/forum/#!forum/pocketmine-development) pocketmine-development@googlegroups.com
### IRC Chat #pocketmine (or #mcpedevs) @ irc.freenode.net
[#pocketmine + #mcpedevs channel WebIRC](http://webchat.freenode.net/?channels=pocketmine,mcpedevs)
### Want to contribute?
* Check the [Contributing Guidelines](CONTRIBUTING.md)
## Third-party Libraries Used
* __[PHP cURL](http://php.net/manual/en/book.curl.php)__
## Third-party Libraries/Protocols Used
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
* __[PHP SQLite3](http://php.net/manual/en/book.sqlite3.php)__
* __[PHP GMP](http://php.net/manual/en/book.gmp.php)__
* __[PHP Zlib](http://php.net/manual/en/book.zlib.php)__
* __[PHP pthreads](https://github.com/krakjoe/pthreads)__ by _[krakjoe](https://github.com/krakjoe)_: Threading for PHP - Share Nothing, Do Everything.
* __[PHP NBT](https://github.com/TheFrozenFire/PHP-NBT-Decoder-Encoder/blob/master/nbt.class.php)__ by _[TheFrozenFire](https://github.com/TheFrozenFire)_: Class for reading in NBT-format files (modified to handle Little-Endian files).
* __[Math_BigInteger](http://phpseclib.sourceforge.net/math/intro.html)__ by _[phpseclib](http://phpseclib.sourceforge.net/)_: Pure-PHP arbitrary precission integer arithmetic library
* __[Spyc](https://github.com/mustangostang/spyc/blob/master/Spyc.php)__ by _[Vlad Andersen](https://github.com/mustangostang)_: A simple YAML loader/dumper class for PHP.
* __[ANSICON](https://github.com/adoxa/ansicon)__ by _[Jason Hood](https://github.com/adoxa)_: Process ANSI escape sequences for Windows console programs.
## IRC #mcpedevs @ irc.freenode.net
* [WebIRC](http://webchat.freenode.net?channels=mcpedevs&uio=d4)
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__
* __[PHP pthreads](http://pthreads.org/)__ by _[krakjoe](https://github.com/krakjoe)_: Threading for PHP - Share Nothing, Do Everything.
* __[PHP YAML](https://code.google.com/p/php-yaml/)__ by _Bryan Davis_: The Yaml PHP Extension provides a wrapper to the LibYAML library.
* __[LibYAML](http://pyyaml.org/wiki/LibYAML)__ by _Kirill Simonov_: A YAML 1.1 parser and emitter written in C.
* __[cURL](http://curl.haxx.se/)__: cURL is a command line tool for transferring data with URL syntax
* __[Zlib](http://www.zlib.net/)__: A Massively Spiffy Yet Delicately Unobtrusive Compression Library
* __[Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)__
* __[UT3 Query Protocol](http://wiki.unrealadmin.org/UT3_query_protocol)__

View File

@ -1,136 +0,0 @@
#!/bin/bash
COMPILER_VERSION="0.5"
PHP_VERSION="5.4.11"
ZLIB_VERSION="1.2.7"
GMP_VERSION="5.1.0"
PTHREADS_VERSION="2ef11a4341d12c697d508138863f3c79b3729189"
CURL_VERSION="curl-7_28_1"
echo "[PocketMine] PHP installer and compiler for Linux - by @shoghicp v$COMPILER_VERSION"
DIR=`pwd`
date > $DIR/install.log 2>&1
uname -a >> $DIR/install.log 2>&1
echo "[INFO] Checking dependecies"
type make >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"make\""; exit 1; }
type autoconf >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"autoconf\""; exit 1; }
type automake >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; exit 1; }
type gcc >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"gcc\""; exit 1; }
type m4 >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; exit 1; }
rm -r -f install_data/ >> $DIR/install.log 2>&1
rm -r -f php5/ >> $DIR/install.log 2>&1
mkdir -m 0777 install_data >> $DIR/install.log 2>&1
mkdir -m 0777 php5 >> $DIR/install.log 2>&1
cd install_data
#PHP 5
echo -n "[PHP5] downloading $PHP_VERSION..."
wget http://php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror -q -O - | tar -zx >> $DIR/install.log 2>&1
mv php-$PHP_VERSION php
echo " done!"
#zlib
echo -n "[zlib] downloading $ZLIB_VERSION..."
wget http://zlib.net/zlib-$ZLIB_VERSION.tar.gz -q -O - | tar -zx >> $DIR/install.log 2>&1
mv zlib-$ZLIB_VERSION zlib
echo -n " checking..."
cd zlib
./configure --prefix=$DIR/install_data/php/ext/zlib \
--static >> $DIR/install.log 2>&1
echo -n " compiling..."
make >> $DIR/install.log 2>&1
echo -n " installing..."
make install >> $DIR/install.log 2>&1
echo -n " cleaning..."
cd ..
rm -r -f ./zlib
echo " done!"
#GMP
echo -n "[GMP] downloading $GMP_VERSION..."
wget ftp://ftp.gmplib.org/pub/gmp-$GMP_VERSION/gmp-$GMP_VERSION.tar.bz2 -q -O - | tar -xj >> $DIR/install.log 2>&1
mv gmp-$GMP_VERSION gmp
echo -n " checking..."
cd gmp
./configure --prefix=$DIR/install_data/php/ext/gmp \
--disable-shared >> $DIR/install.log 2>&1
echo -n " compiling..."
make >> $DIR/install.log 2>&1
echo -n " installing..."
make install >> $DIR/install.log 2>&1
echo -n " cleaning..."
cd ..
rm -r -f ./gmp
echo " done!"
echo -n "[cURL] downloading $CURL_VERSION..."
wget https://github.com/bagder/curl/archive/$CURL_VERSION.tar.gz --no-check-certificate -q -O - | tar -zx >> $DIR/install.log 2>&1
mv curl-$CURL_VERSION curl
echo -n " checking..."
cd curl
./buildconf >> $DIR/install.log 2>&1
./configure --prefix=$DIR/install_data/php/ext/curl \
--disable-shared >> $DIR/install.log 2>&1
echo -n " compiling..."
make >> $DIR/install.log 2>&1
echo -n " installing..."
make install >> $DIR/install.log 2>&1
echo -n " cleaning..."
cd ..
rm -r -f ./curl
echo " done!"
#pthreads
echo -n "[PHP pthreads] downloading $PTHREADS_VERSION..."
wget https://github.com/krakjoe/pthreads/archive/$PTHREADS_VERSION.tar.gz --no-check-certificate -q -O - | tar -zx >> $DIR/install.log 2>&1
mv pthreads-$PTHREADS_VERSION $DIR/install_data/php/ext/pthreads
echo " done!"
echo -n "[PHP5] checking..."
MAX_MEMORY=$(free -m | awk '/^Mem:/{print $2}')
if [ $MAX_MEMORY -gt 2048 ]
then
echo -n " enabling optimizations..."
OPTIMIZATION="--enable-inline-optimization "
else
OPTIMIZATION=""
fi
cd php
./buildconf --force >> $DIR/install.log 2>&1
./configure $OPTIMIZATION--prefix=$DIR/php5 \
--exec-prefix=$DIR/php5 \
--enable-embedded-mysqli \
--enable-bcmath \
--with-gmp=$DIR/install_data/php/ext/gmp \
--with-curl=$DIR/install_data/php/ext/curl \
--with-zlib=$DIR/install_data/php/ext/zlib \
--disable-libxml \
--disable-xml \
--disable-dom \
--disable-simplexml \
--disable-xmlreader \
--disable-xmlwriter \
--without-pear \
--disable-cgi \
--disable-session \
--enable-ctype \
--without-iconv \
--without-pdo-sqlite \
--enable-sockets \
--enable-shared=no \
--enable-static=yes \
--enable-pcntl \
--enable-pthreads \
--enable-maintainer-zts \
--enable-cli >> $DIR/install.log 2>&1
echo -n " compiling..."
make >> $DIR/install.log 2>&1
echo -n " installing..."
make install >> $DIR/install.log 2>&1
echo " done!"
cd $DIR
echo -n "[INFO] Cleaning up..."
rm -r -f install_data/ >> $DIR/install.log 2>&1
date >> $DIR/install.log 2>&1
echo " done!"
echo "[PocketMine] You should start the server now using \"./start.sh\""
echo "[PocketMine] If it doesn't works, please send the \"install.log\" file to the Bug Tracker"

View File

@ -1,220 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class BanAPI{
private $server;
private $whitelist;
private $banned;
private $bannedIPs;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function init(){
console("[INFO] Loading authentication lists...");
$this->whitelist = new Config(FILE_PATH."white-list.txt", CONFIG_LIST);
$this->bannedIPs = new Config(FILE_PATH."banned-ips.txt", CONFIG_LIST);
$this->banned = new Config(FILE_PATH."banned.txt", CONFIG_LIST);
$this->server->api->console->register("banip", "Manages IP Banning", array($this, "commandHandler"));
$this->server->api->console->register("ban", "Manages Bannning", array($this, "commandHandler"));
$this->server->api->console->register("kick", "Kicks a player", array($this, "commandHandler"));
$this->server->api->console->register("whitelist", "Manages White-listing", array($this, "commandHandler"));
}
public function commandHandler($cmd, $params){
switch($cmd){
case "kick":
if(!isset($params[0])){
console("[INFO] Usage: /kick <playername> [reason]");
}else{
$name = array_shift($params);
$player = $this->server->api->player->get($name);
if($player === false){
console("[ERROR] Player \"".$name."\" does not exist");
}else{
$reason = implode(" ", $params);
$reason = $reason == "" ? "No reason":$reason;
$player->close("You have been kicked: ".$reason);
console("[INFO] Player \"".$player->username."\" has been kicked: $reason");
}
}
break;
case "whitelist":
$p = strtolower(array_shift($params));
switch($p){
case "remove":
$user = trim(implode(" ", $params));
$this->whitelist->remove($user);
$this->whitelist->save();
console("[INFO] Player \"$user\" removed from white-list");
break;
case "add":
$user = trim(implode(" ", $params));
$this->whitelist->set($user);
$this->whitelist->save();
console("[INFO] Player \"$user\" added to white-list");
break;
case "reload":
$this->whitelist = $this->load(FILE_PATH."white-list.txt", CONFIG_LIST);
break;
case "list":
console("[INFO] White-list: ".implode(", ", $this->whitelist->getAll(true)));
break;
case "on":
case "true":
case "1":
console("[INFO] White-list turned on");
$this->server->api->setProperty("white-list", true);
break;
case "off":
case "false":
case "0":
console("[INFO] White-list turned off");
$this->server->api->setProperty("white-list", false);
break;
default:
console("[INFO] Usage: /whitelist <on | off | add | remove | reload | list> [username]");
break;
}
break;
case "banip":
$p = strtolower(array_shift($params));
switch($p){
case "pardon":
case "remove":
$ip = trim(implode($params));
$this->bannedIPs->remove($ip);
$this->bannedIPs->save();
console("[INFO] IP \"$ip\" removed from ban list");
break;
case "add":
case "ban":
$ip = trim(implode($params));
$this->bannedIPs->set($ip);
$this->bannedIPs->save();
console("[INFO] IP \"$ip\" added to ban list");
break;
case "reload":
$this->bannedIPs = new Config(FILE_PATH."banned-ips.txt", CONFIG_LIST);
break;
case "list":
console("[INFO] IP ban list: ".implode(", ", $this->bannedIPs->getAll(true)));
break;
default:
console("[INFO] Usage: /banip <add | remove | list | reload> [IP]");
break;
}
break;
case "ban":
$p = strtolower(array_shift($params));
switch($p){
case "pardon":
case "remove":
$user = trim(implode($params));
$this->banned->remove($user);
$this->banned->save();
console("[INFO] Player \"$user\" removed from ban list");
break;
case "add":
case "ban":
$user = trim(implode($params));
$this->banned->set($user);
$this->banned->save();
$player = $this->server->api->player->get($user);
if($player !== false){
$player->close("You have been banned");
}
$this->server->api->chat->broadcast("$user has been banned");
console("[INFO] Player \"$user\" added to ban list");
break;
case "reload":
$this->banned = new Config(FILE_PATH."banned.txt", CONFIG_LIST);
break;
case "list":
console("[INFO] Ban list: ".implode(", ", $this->banned->getAll(true)));
break;
default:
console("[INFO] Usage: /ban <add | remove | list | reload> [player]");
break;
}
break;
}
}
public function ban($username){
$this->commandHandler("ban", array("add", $username));
}
public function pardon($username){
$this->commandHandler("ban", array("pardon", $username));
}
public function banIP($ip){
$this->commandHandler("banip", array("add", $ip));
}
public function pardonIP($ip){
$this->commandHandler("banip", array("pardon", $ip));
}
public function kick($username, $reason){
$this->commandHandler("kick", array($username, $reason));
}
public function reload(){
$this->commandHandler("ban", array("reload"));
$this->commandHandler("banip", array("reload"));
$this->commandHandler("whitelist", array("reload"));
}
public function isIPBanned($ip){
if($this->server->api->dhandle("api.ban.ip.check", $ip) === false){
return true;
}elseif($this->bannedIPs->exists($ip)){
return true;
}
return false;
}
public function isBanned($username){
if($this->server->api->dhandle("api.ban.check", $username) === false){
return true;
}elseif($this->banned->exists($username)){
return true;
}
return false;
}
public function inWhitelist($username){
if($this->server->api->dhandle("api.ban.whitelist.check", $ip) === false){
return true;
}elseif($this->whitelist->exists($username)){
return true;
}
return false;
}
}

View File

@ -1,975 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
define("BLOCK_UPDATE_NORMAL", 0);
define("BLOCK_UPDATE_RANDOM", 1);
define("BLOCK_UPDATE_SCHEDULED", 2);
define("BLOCK_UPDATE_WEAK", 3);
class BlockAPI{
private $server;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function init(){
$this->server->addHandler("block.update", array($this, "updateBlockRemote"), 1);
$this->server->addHandler("player.block.break", array($this, "blockBreak"), 1);
$this->server->addHandler("player.block.action", array($this, "blockAction"), 1);
$this->server->api->console->register("give", "Give items to a player", array($this, "commandHandler"));
}
public function commandHandler($cmd, $params){
switch($cmd){
case "give":
if(!isset($params[0]) or !isset($params[1])){
console("[INFO] Usage: /give <username> <item> [amount] [damage]");
break;
}
$username = $params[0];
$b = explode(":", $params[1]);
if(!isset($b[1])){
$meta = 0;
}else{
$meta = (int) $b[1];
}
$block = ((int) $b[0]) & 0xFFFF;
if(!isset($params[2])){
$amount = 64;
}else{
$amount = (int) $params[2];
}
if(isset($params[3])){
$meta = (int) $params[3];
}
if(($player = $this->server->api->player->get($username)) !== false){
$this->drop($player->entity->x - 0.5, $player->entity->y, $player->entity->z - 0.5, $block, $meta, $amount);
console("[INFO] Giving ".$amount." of ".$block.":".$meta." to ".$username);
}else{
console("[INFO] Unknown player");
}
break;
}
}
private function cancelAction($block){
$this->server->api->dhandle("block.change", array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2],
"block" => $block[0],
"meta" => $block[1],
"fake" => true,
));
return false;
}
public function blockBreak($data, $event){
if($event !== "player.block.break"){
return;
}
$target = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
if(isset(Material::$unbreakable[$target[0]])){
return $this->cancelAction($target);
}
$drop = array(
$target[0], //Block
$target[1], //Meta
1, //Count
);
switch($target[0]){
case 1:
$drop[0] = 4;
break;
case 16:
$drop = array(263, 0, 1);
break;
case 21:
$drop = array(351, 4, mt_rand(4, 8));
break;
case 62:
$drop[0] = 61;
case 50: //Drop without metadata
case 53:
case 54:
case 61:
case 65:
case 67:
case 96:
case 107:
case 108:
case 109:
$drop[1] = 0;
break;
case 56:
$drop = array(264, 0, 1);
break;
case 73:
case 74:
$drop = array(351, 4, mt_rand(4, 5));
break;
case 18:
$drop = false;
if(mt_rand(1,20) === 1){ //Saplings
$drop = array(6, $target[1], 1);
}
if($target[1] === 0 and mt_rand(1,200) === 1){ //Apples
$this->drop($data["x"], $data["y"], $data["z"], 260, 0, 1);
}
break;
case 59:
if($target[1] >= 0x07){ //Seeds
$drop = array(296, 0, 1);
$this->drop($data["x"], $data["y"], $data["z"], 295, 0, mt_rand(0,3));
}else{
$drop = array(295, 0, 1);
}
break;
case 31:
$drop = false;
if(mt_rand(1,10) === 1){ //Seeds
$drop = array(295, 0, 1);
}
break;
case 20:
$drop = false;
break;
case 30:
$drop = false;
break;
case 51:
$drop = false;
break;
case 52:
$drop = false;
break;
case 43:
$drop = array(
44,
$target[1],
2,
);
break;
case 46: //TNT
if(($player = $this->server->api->player->getByEID($data["eid"])) !== false){
$player->dataPacket(MC_EXPLOSION, array(
"x" => $data["x"],
"y" => $data["y"],
"z" => $data["z"],
"radius" => 2,
"records" => array(),
));
}
break;
case 60:
case 2:
$drop = array(3, 0, 1);
break;
case 64: //Wood Door
case 71: //Iron Door
$drop = array(($target[0] === 64 ? 324:330), 0, 1);
if(($target[1] & 0x08) === 0x08){
$down = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if($down[0] === $target[0]){
$data2 = $data;
--$data2["y"];
$this->server->trigger("player.block.break", $data2);
}
}else{
$up = $this->server->api->level->getBlock($data["x"], $data["y"] + 1, $data["z"]);
if($up[0] === $target[0]){
$data2 = $data;
++$data2["y"];
$this->server->trigger("player.block.break", $data2);
}
}
break;
}
if($drop !== false and $drop[0] !== 0 and $drop[2] > 0){
$this->drop($data["x"], $data["y"], $data["z"], $drop[0], $drop[1] & 0x0F, $drop[2] & 0xFF);
}
$this->server->trigger("player.block.break", $data);
return false;
}
public function drop($x, $y, $z, $block, $meta, $stack = 1){
if($block === 0 or $stack <= 0 or $this->server->gamemode === 1){
return;
}
$data = array(
"x" => $x,
"y" => $y,
"z" => $z,
"meta" => $meta,
"stack" => $stack,
);
$data["x"] += mt_rand(2, 8) / 10;
$data["y"] += 0.19;
$data["z"] += mt_rand(2, 8) / 10;
if($this->server->api->handle("block.drop", $data) !== false){
for($count = $stack; $count > 0; ){
$data["stack"] = min(64, $count);
$count -= $data["stack"];
$e = $this->server->api->entity->add(ENTITY_ITEM, $block, $data);
$this->server->api->entity->spawnToAll($e->eid);
}
}
}
public function blockAction($data, $event){
if($event !== "player.block.action"){
return;
}
if($data["face"] < 0 or $data["face"] > 5){
return false;
}
$data["original"] = array($data["block"], $data["meta"]);
$target = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
if($target[0] === 0){ //If no block exists
$this->cancelAction($target);
$block = $this->server->api->level->getBlockFace($target, $data["face"]);
return $this->cancelAction($block);
}
$cancelPlace = false;
if(isset(Material::$activable[$target[0]])){
switch($target[0]){
case 54:
$cancelPlace = true;
if($this->server->gamemode === 1){
break;
}
$this->server->api->player->getByEID($data["eid"])->dataPacket(MC_CONTAINER_OPEN, array(
"windowid" => 1,
"type" => WINDOW_CHEST,
"slots" => 27,
"title" => "Chest",
));
break;
case 61:
case 62:
$cancelPlace = true;
if($this->server->gamemode === 1){
break;
}
$this->server->api->player->getByEID($data["eid"])->dataPacket(MC_CONTAINER_OPEN, array(
"windowid" => 1,
"type" => WINDOW_FURNACE,
"slots" => 3,
"title" => "Furnace",
));
break;
case 6:
if($data["block"] === 351 and $data["meta"] === 0x0F){ //Bonemeal
Sapling::growTree($this->server->api->level, $target, $target[1] & 0x03);
$cancelPlace = true;
}
break;
case 2:
if($target[0] === 2 and $data["block"] === 351 and $data["meta"] === 0x0F){ //Bonemeal
for($c = 0; $c < 15; ++$c){
$x = mt_rand($target[2][0] - 2, $target[2][0] + 2);
$z = mt_rand($target[2][2] - 2, $target[2][2] + 2);
$b = $this->server->api->level->getBlock($x, $target[2][1] + 1, $z);
$d = $this->server->api->level->getBlock($x, $target[2][1], $z);
if($b[0] === 0 and $d[0] === 2){
$arr = array(
array(37, 0),
array(38, 0),
array(31, 1),
array(31, 1),
array(31, 1),
array(31, 1),
array(0, 0),
);
$t = $arr[mt_rand(0, count($arr) - 1)];
$this->server->api->level->setBlock($x, $target[2][1] + 1, $z, $t[0], $t[1]);
}
}
$cancelPlace = true;
break;
}
case 3:
if($data["block"] === 292){ //Hoe
$data["block"] = 60;
$data["meta"] = 0;
$this->server->handle("player.block.update", $data);
$cancelPlace = true;
}
break;
case 59:
case 105:
if($data["block"] === 351 and $data["meta"] === 0x0F){ //Bonemeal
$data["block"] = $target[0];
$data["meta"] = 0x07;
$this->server->handle("player.block.place", $data);
$cancelPlace = true;
}
break;
case 64: //Door
if(($target[1] & 0x08) === 0x08){
$down = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if($down[0] === 64){
$down[1] = $down[1] ^ 0x04;
$data2 = array(
"x" => $data["x"],
"z" => $data["z"],
"y" => $data["y"] - 1,
"block" => $down[0],
"meta" => $down[1],
"eid" => $data["eid"],
);
if($this->server->handle("player.block.update", $data2) !== false){
$this->updateBlocksAround($data["x"], $data["y"], $data["z"], BLOCK_UPDATE_NORMAL);
}
}
}else{
$data["block"] = $target[0];
$data["meta"] = $target[1] ^ 0x04;
if($this->server->handle("player.block.update", $data) !== false){
$up = $this->server->api->level->getBlock($data["x"], $data["y"] + 1, $data["z"]);
if($up[0] === 64){
$data2 = $data;
$data2["meta"] = $up[1];
++$data2["y"];
$this->updateBlocksAround($data2["x"], $data2["y"], $data2["z"], BLOCK_UPDATE_NORMAL);
}
$this->updateBlocksAround($data["x"], $data["y"], $data["z"], BLOCK_UPDATE_NORMAL);
}
}
$cancelPlace = true;
break;
case 96: //Trapdoor
case 107: //Fence gates
$data["block"] = $target[0];
$data["meta"] = $target[1] ^ 0x04;
$this->server->handle("player.block.update", $data);
$cancelPlace = true;
break;
default:
$cancelPlace = true;
break;
}
}
if($cancelPlace === true){
return false;
}
$replace = false;
switch($data["block"]){
case 44: //Slabs
if($data["face"] === 0){
break;
}elseif($data["face"] === 1){
if(($target[1] & 0x07) === ($data["meta"] & 0x07) and $target[0] === 44){
$replace = true;
$data["block"] = 43;
$data["meta"] = $data["meta"] & 0x07;
}
}else{
$data2 = $data;
BlockFace::setPosition($data2, $data["face"]);
$b = $this->server->api->level->getBlock($data2["x"], $data2["y"], $data2["z"]);
if($b[0] === 44 and ($b[1] & 0x07) === ($data["meta"] & 0x07) and $b[0] === 44){
$data = $data2;
$replace = true;
$data["block"] = 43;
$data["meta"] = $data["meta"] & 0x07;
}
}
break;
}
if($replace === false){
BlockFace::setPosition($data, $data["face"]);
}
if($data["y"] >= 127){
return false;
}
$block = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
if($replace === false and !isset(Material::$replaceable[$block[0]])){
return $this->cancelAction($block);
}
if(isset(Material::$placeable[$data["block"]])){
$data["block"] = Material::$placeable[$data["block"]] === true ? $data["block"]:Material::$placeable[$data["block"]];
}else{
return $this->cancelAction($block);
}
$entity = $this->server->api->entity->get($data["eid"]);
if(($entity instanceof Entity) !== true){
return $this->cancelAction($block); //No Entity WTF?
}
if(!isset(Material::$transparent[$data["block"]]) and $entity->inBlock($block[2][0], $block[2][1], $block[2][2])){
return $this->cancelAction($block); //Entity in block
}
$direction = $entity->getDirection();
switch($data["block"]){
case 6:
if($target[0] === 60){
break;
}
case 37:
case 38:
if(($target[0] !== 2 and $target[0] !== 3) or $data["face"] !== 1){
return false;
}
break;
case 39://Mushrooms
case 40:
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if(isset(Material::$transparent[$blockDown[0]])){
return false;
}
break;
case 83: //Sugarcane
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if($blockDown[0] !== 2 and $blockDown[0] !== 3 and $blockDown[0] !== 12){
return false;
}
$block0 = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"] + 1);
$block1 = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"] - 1);
$block2 = $this->server->api->level->getBlock($data["x"] + 1, $data["y"], $data["z"]);
$block3 = $this->server->api->level->getBlock($data["x"] - 1, $data["y"], $data["z"]);
if($block0[0] === 9 or $block0[0] === 8 or $block1[0] === 9 or $block1[0] === 8 or $block2[0] === 9 or $block2[0] === 8 or $block3[0] === 9 or $block3[0] === 8){
}else{
return false;
}
break;
case 50: //Torch
if(isset(Material::$transparent[$target[0]])){
return false;
}
$faces = array(
0 => 6,
1 => 5,
2 => 4,
3 => 3,
4 => 2,
5 => 1,
);
if(!isset($faces[$data["face"]])){
return false;
}
$data["meta"] = $faces[$data["face"]];
break;
case 53://Stairs
case 67:
case 108:
$faces = array(
0 => 0,
1 => 2,
2 => 1,
3 => 3,
);
$data["meta"] = $faces[$direction] & 0x03;
break;
case 96: //trapdoor
if(isset(Material::$transparent[$target[0]])){
return false;
}
$faces = array(
2 => 0,
3 => 1,
4 => 2,
5 => 3,
);
if(!isset($faces[$data["face"]])){
return false;
}
$data["meta"] = $faces[$data["face"]] & 0x03;
break;
case 107: //Fence gate
$faces = array(
0 => 3,
1 => 0,
2 => 1,
3 => 2,
);
$data["meta"] = $faces[$direction] & 0x03;
break;
case 64://Door placing
case 71:
if($data["face"] !== 1){
return false;
}
$blockUp = $this->server->api->level->getBlock($data["x"], $data["y"] + 1, $data["z"]);
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if(!isset(Material::$replaceable[$blockUp[0]]) or isset(Material::$transparent[$blockDown[0]])){
return false;
}else{
$data2 = $data;
$data2["meta"] = 0x08;
$data["meta"] = $direction & 0x03;
$face = array(
0 => 3,
1 => 4,
2 => 2,
3 => 5,
);
$next = $this->server->api->level->getBlockFace($block, $face[(($direction + 2) % 4)]);
if($next[0] === $data["block"]){ //Door hinge
$data2["meta"] = $data2["meta"] | 0x01;
}
++$data2["y"];
$this->server->handle("player.block.place", $data2);
}
break;
case 54:
case 61:
$faces = array(
0 => 4,
1 => 2,
2 => 5,
3 => 3,
);
$data["meta"] = $faces[$direction];
break;
case 26: //bed
$face = array(
0 => 3,
1 => 4,
2 => 2,
3 => 5,
);
$next = $this->server->api->level->getBlockFace($block, $face[(($direction + 3) % 4)]);
if(!isset(Material::$replaceable[$next[0]])){
return false;
}
$data["meta"] = (($direction + 3) % 4) & 0x3;
$data2 = $data;
$data2["meta"] = $data2["meta"] | 0x08;
$data2["x"] = $next[2][0];
$data2["y"] = $next[2][1];
$data2["z"] = $next[2][2];
$this->server->handle("player.block.place", $data2);
break;
case 65: //Ladder
if(isset(Material::$transparent[$target[0]])){
return false;
}
$faces = array(
2 => 2,
3 => 3,
4 => 4,
5 => 5,
);
if(!isset($faces[$data["face"]])){
return false;
}
$data["meta"] = $faces[$data["face"]];
break;
case 59://Seeds
case 105:
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
if($blockDown[0] !== 60){
return false;
}
$data["meta"] = 0;
break;
case 81: //Cactus
$blockDown = $this->server->api->level->getBlock($data["x"], $data["y"] - 1, $data["z"]);
$block0 = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"] + 1);
$block1 = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"] - 1);
$block2 = $this->server->api->level->getBlock($data["x"] + 1, $data["y"], $data["z"]);
$block3 = $this->server->api->level->getBlock($data["x"] - 1, $data["y"], $data["z"]);
if($blockDown[0] !== 12 or !isset(Material::$transparent[$block0[0]]) or !isset(Material::$transparent[$block1[0]]) or !isset(Material::$transparent[$block2[0]]) or !isset(Material::$transparent[$block3[0]])){
return false;
}
break;
}
$this->server->handle("player.block.place", $data);
return false;
}
public function blockScheduler($data){
$this->updateBlock($data["x"], $data["y"], $data["z"], BLOCK_UPDATE_SCHEDULED);
}
public function updateBlockRemote($data, $event){
if($event !== "block.update"){
return;
}
$this->updateBlock($data["x"], $data["y"], $data["z"], isset($data["type"]) ? $data["type"]:BLOCK_UPDATE_RANDOM);
}
public function flowLavaOn($source, $face){
$down = 0;
if($face === BlockFace::BOTTOM){
$level = 0;
$down = 1;
}else{
$level = ($source[1] & 0x07) + 2;
if($level > 0x07){
return false;
}
}
$spread = $this->server->api->level->getBlockFace($source, $face);
if(($source[0] === 10 or $source[0] === 11) and $spread[0] === 10){
if($level < ($spread[1] & 0x07)){
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $spread[2][0],
"y" => $spread[2][1],
"z" => $spread[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $spread[0], $level | $down, false);
return true;
}
}elseif(isset(Material::$flowable[$spread[0]])){
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $spread[2][0],
"y" => $spread[2][1],
"z" => $spread[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 10, $level | $down, false);
return true;
}elseif(($source[1] & 0x08) === 0x08){
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $source[0], $source[1] & 0x07, false);
return true;
}
return false;
}
public function flowWaterOn($source, $face){
$down = 0;
if($face === BlockFace::BOTTOM){
$level = 0;
$down = 1;
}else{
$level = ($source[1] & 0x07) + 1;
if($level > 0x07){
return false;
}
}
$spread = $this->server->api->level->getBlockFace($source, $face);
if(($source[0] === 8 or $source[0] === 9) and $spread[0] === 8){
if($level < ($spread[1] & 0x07)){
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $spread[2][0],
"y" => $spread[2][1],
"z" => $spread[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $spread[0], $level | $down, false);
return true;
}
}elseif(isset(Material::$flowable[$spread[0]])){
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $spread[2][0],
"y" => $spread[2][1],
"z" => $spread[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 8, $level | $down, false);
return true;
}elseif(($source[1] & 0x08) === 0x08){
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], $source[0], $source[1] & 0x07, false);
return true;
}
return false;
}
public function updateBlock($x, $y, $z, $type = BLOCK_UPDATE_NORMAL){
$block = $this->server->api->level->getBlock($x, $y, $z);
$changed = false;
switch($block[0]){
case 8:
case 9:
if(!$this->flowWaterOn($block, 0) or $block[0] === 9){
$this->flowWaterOn($block, 2);
$this->flowWaterOn($block, 3);
$this->flowWaterOn($block, 4);
$this->flowWaterOn($block, 5);
}
if($block[0] === 8){
$drained = true;
$level = $block[1] & 0x07;
$up = $this->server->api->level->getBlockFace($block, BlockFace::UP);
if($up[0] === 8 or $up[0] === 9){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::NORTH);
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::SOUTH);
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::EAST);
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::WEST);
if($b[0] === 9 or ($b[0] === 8 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}
}
}
}
}
if($drained === true){
++$level;
if($level > 0x07){
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0] + 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0] - 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] + 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] - 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1] - 1,
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], 0, 0, false);
}else{
$block[1] = ($block[1] & 0x08) | $level;
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0] + 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0] - 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] + 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] - 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1] - 1,
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], $block[0], $block[1], false);
}
}
}
break;
case 10:
case 11:
if(!$this->flowLavaOn($block, 0) or $block[0] === 11){
$this->flowLavaOn($block, 2);
$this->flowLavaOn($block, 3);
$this->flowLavaOn($block, 4);
$this->flowLavaOn($block, 5);
}
if($block[0] === 10){
$drained = true;
$level = $block[1] & 0x07;
$up = $this->server->api->level->getBlockFace($block, BlockFace::UP);
if($up[0] === 10 or $up[0] === 11){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::NORTH);
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::SOUTH);
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::EAST);
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}else{
$b = $this->server->api->level->getBlockFace($block, BlockFace::WEST);
if($b[0] === 11 or ($b[0] === 10 and ($b[1] & 0x08) === 0 and ($b[1] & 0x07) < $level)){
$drained = false;
}
}
}
}
}
if($drained === true){
++$level;
if($level > 0x07){
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0] + 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0] - 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] + 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] - 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1] - 1,
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], 0, 0, false);
}else{
$block[1] = ($block[1] & 0x08) | $level;
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0] + 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0] - 1,
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] + 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2] - 1,
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1] - 1,
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->schedule(20, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], $block[0], $block[1], false);
}
}
}
break;
case 74:
if($type === BLOCK_UPDATE_SCHEDULED or $type === BLOCK_UPDATE_RANDOM){
$changed = true;
$this->server->api->level->setBlock($x, $y, $z, 73, $block[1], false);
$type = BLOCK_UPDATE_WEAK;
}
break;
case 73:
if($type === BLOCK_UPDATE_NORMAL){
$changed = true;
$this->server->api->level->setBlock($x, $y, $z, 74, $block[1], false);
$this->server->schedule(mt_rand(40, 100), array($this, "blockScheduler"), array(
"x" => $x,
"y" => $y,
"z" => $z,
));
$type = BLOCK_UPDATE_WEAK;
}
break;
}
if($type === BLOCK_TYPE_SCHEDULED){
$type = BLOCK_UPDATE_WEAK;
}
if($changed === true){
$this->updateBlocksAround($x, $y, $z, $type);
}
}
public function updateBlocksAround($x, $y, $z, $type){
$this->updateBlock($x + 1, $y, $z, $type);
$this->updateBlock($x, $y + 1, $z, $type);
$this->updateBlock($x, $y, $z + 1, $type);
$this->updateBlock($x - 1, $y, $z, $type);
$this->updateBlock($x, $y - 1, $z, $type);
$this->updateBlock($x, $y, $z - 1, $type);
}
}

View File

@ -1,51 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class ChatAPI{
private $server;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function init(){
}
public function broadcast($message){
$this->send(false, $message);
}
public function send($owner, $text, $whitelist = false, $blacklist = false){
$message = "";
if($owner !== false){
$message = "<".$owner."> ";
}
$message .= $text;
console("[CHAT] ".$message);
$this->server->handle("server.chat", new Container($message, $whitelist, $blacklist));
}
}

View File

@ -1,199 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class ConsoleAPI{
private $loop, $server, $event, $help, $cmds;
function __construct(PocketMinecraftServer $server){
$this->help = array();
$this->cmds = array();
$this->server = $server;
$this->last = microtime(true);
}
public function init(){
$this->event = $this->server->event("server.tick", array($this, "handle"));
$this->loop = new ConsoleLoop;
$this->loop->start();
}
function __destruct(){
$this->server->deleteEvent($this->event);
$this->loop->stop = true;
$this->loop->notify();
$this->loop->join();
}
public function defaultCommands($cmd, $params){
switch($cmd){
case "crash": //Crashes the server to generate an report
$this->callNotDefinedMethodCrash();
$this->server->api->server; //Access a private property
callNotExistingFunction();
break;
case "invisible":
$p = strtolower(array_shift($params));
switch($p){
case "on":
case "true":
case "1":
console("[INFO] Server is invisible");
$this->server->api->setProperty("invisible", true);
break;
case "off":
case "false":
case "0":
console("[INFO] Server is visible");
$this->server->api->setProperty("invisible", false);
break;
default:
console("[INFO] Usage: /invisible <on | off>");
break;
}
break;
case "status":
case "lag":
$info = $this->server->debugInfo();
console("[INFO] TPS: ".$info["tps"].", Memory usage: ".$info["memory_usage"]." (Peak ".$info["memory_peak_usage"].")");
break;
case "update-done":
$this->server->api->setProperty("last-update", time());
break;
case "stop":
$this->loop->stop = true;
console("[INFO] Stopping the server...");
$this->server->close();
break;
case "gamemode":
$s = trim(array_shift($params));
if($s == "" or (((int) $s) !== 0 and ((int) $s) !== 1)){
console("[INFO] Usage: /gamemode <0 | 1>");
break;
}
$this->server->api->setProperty("gamemode", (int) $s);
console("[INFO] Gamemode changed to ".$this->server->gamemode);
break;
case "difficulty":
$s = trim(array_shift($params));
if($s == "" or (((int) $s) !== 0 and ((int) $s) !== 1)){
console("[INFO] Usage: /difficulty <0 | 1>");
break;
}
$this->server->api->setProperty("difficulty", (int) $s);
console("[INFO] Difficulty changed to ".$this->server->difficulty);
loadConfig(true);
break;
case "say":
$s = implode(" ", $params);
if(trim($s) == ""){
console("[INFO] Usage: /say <message>");
break;
}
$this->server->api->chat->broadcast($s);
break;
case "save-all":
$this->server->save();
break;
case "help":
case "?":
console("[INFO] /help: Show available commands");
console("[INFO] /status: Show server TPS and memory usage");
console("[INFO] /gamemode: Changes default gamemode");
console("[INFO] /difficulty: Changes difficulty");
console("[INFO] /invisible: Manages server visibility");
console("[INFO] /say: Broadcasts mesages");
console("[INFO] /save-all: Saves pending changes");
console("[INFO] /stop: Stops the server");
//console("[INFO] /restart: Restarts the server");
foreach($this->help as $c => $h){
console("[INFO] /$c: ".$h);
}
break;
default:
console("[ERROR] Command doesn't exist! Use /help");
break;
}
}
public function alias($alias, $cmd){
if(!isset($this->cmds[$cmd])){
return false;
}
$this->cmds[strtolower(trim($alias))] = &$this->cmds[$cmd];
return true;
}
public function register($cmd, $help, $callback){
if(!is_callable($callback)){
return false;
}
$cmd = strtolower(trim($cmd));
$this->cmds[$cmd] = $callback;
$this->help[$cmd] = $help;
}
public function run($line = ""){
if($line != ""){
$params = explode(" ", $line);
$cmd = strtolower(array_shift($params));
console("[INFO] Issued server command: /$cmd ".implode(" ", $params));
if(isset($this->cmds[$cmd]) and is_callable($this->cmds[$cmd])){
call_user_func($this->cmds[$cmd], $cmd, $params);
}elseif($this->server->api->dhandle("api.console.command", array("cmd" => $cmd, "params" => $params)) !== false){
$this->defaultCommands($cmd, $params);
}
}
}
public function handle($time){
if($this->loop->line !== false){
$line = trim($this->loop->line);
$this->loop->line = false;
$this->run($line);
}else{
$this->loop->notify();
}
}
}
class ConsoleLoop extends Thread{
public $line, $stop;
public function __construct(){
$this->line = false;
$this->stop = false;
}
public function run(){
$fp = fopen("php://stdin", "r");
while($this->stop === false and ($line = fgets($fp)) !== false){
$this->line = $line;
$this->wait();
$this->line = false;
}
exit(0);
}
}

View File

@ -1,104 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class EntityAPI{
private $server;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function get($eid){
if(isset($this->server->entities[$eid])){
return $this->server->entities[$eid];
}
return false;
}
public function init(){
}
public function getAll(){
return $this->server->entities;
}
public function heal($eid, $heal = 1, $cause){
$this->harm($eid, -$heal, $cause);
}
public function harm($eid, $attack = 1, $cause, $force = false){
$e = $this->get($eid);
if($e === false or $e->dead === true){
return false;
}
$e->setHealth($e->getHealth() - $attack, $cause, $force);
}
public function add($class, $type = 0, $data = array()){
$eid = $this->server->eidCnt++;
$this->server->entities[$eid] = new Entity($this->server, $eid, $class, $type, $data);
$this->server->handle("entity.add", $this->server->entities[$eid]);
return $this->server->entities[$eid];
}
public function spawnTo($eid, $player){
$e = $this->get($eid);
if($e === false){
return false;
}
$e->spawn($player);
}
public function spawnToAll($eid){
$e = $this->get($eid);
if($e === false){
return false;
}
foreach($this->server->api->player->getAll() as $player){
if($player->eid !== false){
$e->spawn($player);
}
}
}
public function spawnAll($player){
foreach($this->getAll() as $e){
$e->spawn($player);
}
}
public function remove($eid){
if(isset($this->server->entities[$eid])){
$entity = $this->server->entities[$eid];
unset($this->server->entities[$eid]);
$entity->closed = true;
$this->server->query("DELETE FROM entities WHERE EID = ".$entity->eid.";");
$this->server->api->dhandle("entity.remove", $entity);
unset($entity);
}
}
}

View File

@ -1,134 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class LevelAPI{
private $server, $map;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
$this->map = $this->server->map;
$this->heightMap = array_fill(0, 256, array());
}
public function init(){
$this->server->event("player.block.break", array($this, "handle"));
$this->server->event("player.block.place", array($this, "handle"));
$this->server->event("player.block.update", array($this, "handle"));
}
public function handle($data, $event){
switch($event){
case "player.block.place":
case "player.block.update":
console("[DEBUG] EID ".$data["eid"]." placed ".$data["block"].":".$data["meta"]." at X ".$data["x"]." Y ".$data["y"]." Z ".$data["z"], true, true, 2);
$this->setBlock($data["x"], $data["y"], $data["z"], $data["block"], $data["meta"]);
break;
case "player.block.break":
$block = $this->getBlock($data["x"], $data["y"], $data["z"]);
console("[DEBUG] EID ".$data["eid"]." broke ".$block[0].":".$block[1]." at X ".$data["x"]." Y ".$data["y"]." Z ".$data["z"], true, true, 2);
if($block[0] === 0){
break;
}
$this->setBlock($data["x"], $data["y"], $data["z"], 0, 0);
break;
}
}
public function getSpawn(){
return $this->server->spawn;
}
public function getChunk($X, $Z){
return $this->map->map[$X][$Z];
}
public function getBlockFace($block, $face){
$data = array("x" => $block[2][0], "y" => $block[2][1], "z" => $block[2][2]);
BlockFace::setPosition($data, $face);
return $this->getBlock($data["x"], $data["y"], $data["z"]);
}
public function getBlock($x, $y, $z){
$b = $this->map->getBlock($x, $y, $z);
$b[2] = array($x, $y, $z);
return $b;
}
public function getFloor($x, $z){
if(!isset($this->heightMap[$z][$x])){
$this->heightMap[$z][$x] = $this->map->getFloor($x, $z);
}
return $this->heightMap[$z][$x];
}
public function setBlock($x, $y, $z, $block, $meta = 0, $update = true){
if($x < 0 or $y < 0 or $z < 0){
return false;
}
$this->map->setBlock($x, $y, $z, $block, $meta);
$this->heightMap[$z][$x] = $this->map->getFloor($x, $z);
if($this->server->api->dhandle("block.change", array(
"x" => $x,
"y" => $y,
"z" => $z,
"block" => $block,
"meta" => $meta,
)) !== false){
if($update === true){
$this->server->api->block->updateBlock($x, $y, $z, BLOCK_UPDATE_NORMAL);
$this->server->api->block->updateBlocksAround($x, $y, $z, BLOCK_UPDATE_NORMAL);
}
}
return true;
}
public function getOrderedChunk($X, $Z, $columnsPerPacket = 2){
$columnsPerPacket = max(1, (int) $columnsPerPacket);
$c = $this->getChunk($X, $Z);
$ordered = array();
$i = 0;
$cnt = 0;
$ordered[$i] = "";
for($z = 0; $z < 16; ++$z){
for($x = 0; $x < 16; ++$x){
if($cnt >= $columnsPerPacket){
++$i;
$ordered[$i] = str_repeat("\x00", $i * $columnsPerPacket);
$cnt = 0;
}
$ordered[$i] .= "\xff";
$block = $this->map->getChunkColumn($X, $Z, $x, $z, 0);
$meta = $this->map->getChunkColumn($X, $Z, $x, $z, 1);
for($k = 0; $k < 8; ++$k){
$ordered[$i] .= substr($block, $k << 4, 16);
$ordered[$i] .= substr($meta, $k << 3, 8);
}
++$cnt;
}
}
return $ordered;
}
}

View File

@ -1,261 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class PlayerAPI{
private $server;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function init(){
$this->server->addHandler("server.regeneration", array($this, "handle"));
$this->server->addHandler("player.death", array($this, "handle"), 1);
$this->server->api->console->register("list", "Shows connected player list", array($this, "commandHandler"));
$this->server->api->console->register("kill", "Kills a player", array($this, "commandHandler"));
$this->server->api->console->register("tppos", "Teleports a player to a position", array($this, "commandHandler"));
$this->server->api->console->register("tp", "Teleports a player to another player", array($this, "commandHandler"));
}
public function handle($data, $event){
switch($event){
case "server.regeneration":
$result = $this->server->query("SELECT EID FROM players WHERE EID = (SELECT EID FROM entities WHERE health < 20);");
if($result !== true and $result !== false){
while(false !== ($player = $result->fetchArray())){
if(($player = $this->server->api->entity->get($player["EID"])) !== false){
if($player->dead === true){
continue;
}
$player->setHealth(min(20, $player->getHealth() + $data), "regeneration");
}
}
}
break;
case "player.death":
$message = $data["name"];
if(is_numeric($data["cause"]) and isset($this->entities[$data["cause"]])){
$e = $this->api->entity->get($data["cause"]);
switch($e->class){
case ENTITY_PLAYER:
$message .= " was killed by ".$e->name;
break;
default:
$message .= " was killed";
break;
}
}else{
switch($data["cause"]){
case "cactus":
$message .= " was pricked to death";
break;
case "lava":
$message .= " tried to swim in lava";
break;
case "fire":
$message .= " burned to death";
break;
case "suffocation":
$message .= " suffocated in a wall";
break;
case "water":
$message .= " drowned";
break;
default:
$message .= " died";
break;
}
}
$this->server->chat(false, $message);
break;
}
}
public function commandHandler($cmd, $params){
switch($cmd){
case "tp":
$name = array_shift($params);
$target = array_shift($params);
if($name == null or $target == null){
console("[INFO] Usage: /tp <player> <target>");
break;
}
if($this->teleport($name, $target)){
console("[INFO] \"$name\" teleported to \"$target\"");
}else{
console("[ERROR] Couldn't teleport");
}
break;
case "tppos":
$z = array_pop($params);
$y = array_pop($params);
$x = array_pop($params);
$name = implode(" ", $params);
if($name == null or $x === null or $y === null or $z === null){
console("[INFO] Usage: /tp <player> <x> <y> <z>");
break;
}
if($this->tppos($name, $x, $y, $z)){
console("[INFO] \"$name\" teleported to ($x, $y, $z)");
}else{
console("[ERROR] Couldn't teleport");
}
break;
case "kill":
$player = $this->get(implode(" ", $params));
if($player !== false){
$this->server->api->entity->harm($player->eid, 20, "console", true);
}else{
console("[INFO] Usage: /kill <player>");
}
break;
case "list":
console("[INFO] Player list:");
foreach($this->server->clients as $c){
console("[INFO] ".$c->username." (".$c->ip.":".$c->port."), ClientID ".$c->clientID.", (".round($c->entity->x, 2).", ".round($c->entity->y, 2).", ".round($c->entity->z, 2).")");
}
break;
}
}
public function teleport($name, $target){
$target = $this->get($target);
if($target !== false){
return $this->tppos($name, $target->entity->x, $target->entity->y, $target->entity->z);
}
return false;
}
public function tppos($name, $x, $y, $z){
$player = $this->get($name);
if($player !== false){
$player->dataPacket(MC_MOVE_PLAYER, array(
"eid" => 0,
"x" => $x,
"y" => $y,
"z" => $z,
"yaw" => 0,
"pitch" => 0,
));
return true;
}
return false;
}
public function get($name){
$CID = $this->server->query("SELECT ip,port FROM players WHERE name = '".str_replace("'", "", $name)."';", true);
$CID = $this->server->clientID($CID["ip"], $CID["port"]);
if(isset($this->server->clients[$CID])){
return $this->server->clients[$CID];
}
return false;
}
public function getAll(){
return $this->server->clients;
}
public function getByEID($eid){
$eid = (int) $eid;
$CID = $this->server->query("SELECT ip,port FROM players WHERE EID = '".$eid."';", true);
$CID = $this->server->clientID($CID["ip"], $CID["port"]);
if(isset($this->server->clients[$CID])){
return $this->server->clients[$CID];
}
return false;
}
public function getByClientID($clientID){
$clientID = (int) $clientID;
$CID = $this->server->query("SELECT ip,port FROM players WHERE clientID = '".$clientID."';", true);
$CID = $this->server->clientID($CID["ip"], $CID["port"]);
if(isset($this->server->clients[$CID])){
return $this->server->clients[$CID];
}
return false;
}
public function online(){
$o = array();
foreach($this->server->clients as $p){
if($p->auth === true){
$o[] = $p->username;
}
}
return $o;
}
public function add($CID){
if(isset($this->server->clients[$CID])){
$player = $this->server->clients[$CID];
console("[INFO] Player \"\x1b[33m".$player->username."\x1b[0m\" connected from \x1b[36m".$player->ip.":".$player->port."\x1b[0m");
$player->data = $this->getOffline($player->username);
$this->server->query("INSERT OR REPLACE INTO players (clientID, ip, port, name) VALUES (".$player->clientID.", '".$player->ip."', ".$player->port.", '".$player->username."');");
}
}
public function remove($CID){
if(isset($this->server->clients[$CID])){
$player = $this->server->clients[$CID];
unset($this->server->clients[$CID]);
$player->close();
$this->saveOffline($player->username, $player->data);
$this->server->query("DELETE FROM players WHERE name = '".$player->username."';");
$this->server->api->entity->remove($player->eid);
unset($player);
}
}
public function getOffline($name){
if(!file_exists(FILE_PATH."players/".$name.".dat")){
console("[NOTICE] Player data not found for \"".$name."\", creating new profile");
$data = array(
"spawn" => array(
"x" => $this->server->spawn["x"],
"y" => $this->server->spawn["y"],
"z" => $this->server->spawn["z"],
),
"inventory" => array_fill(0, 36, array(0, 0, 0)),
"health" => 20,
"lastIP" => "",
"lastID" => 0,
);
$this->saveOffline($name, $data);
}else{
$data = unserialize(file_get_contents(FILE_PATH."players/".$name.".dat"));
}
if($this->server->gamemode === 1){
$data["health"] = 20;
}
$this->server->handle("api.player.offline.get", $data);
return $data;
}
public function saveOffline($name, $data){
$this->server->handle("api.player.offline.save", $data);
file_put_contents(FILE_PATH."players/".str_replace("/", "", $name).".dat", serialize($data));
}
}

View File

@ -1,185 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class PluginAPI extends stdClass{
private $server;
private $plugins = array();
public function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function getList(){
$list = array();
foreach($this->plugins as $p){
$list[] = $p[1];
}
return $list;
}
public function getInfo($className){
if(!isset($this->plugins[$className])){
return false;
}
$plugin = $this->plugins[$className];
return array($plugin[1], get_class_methods($plugin[0]));
}
public function load($file){
$content = file_get_contents($file);
$info = strstr($content, "*/", true);
$content = substr(strstr($content, "*/"),2);
if(preg_match_all('#([a-zA-Z0-9\-_]*)=([^\r\n]*)#u', $info, $matches) == 0){ //false or 0 matches
console("[ERROR] [PluginAPI] Failed parsing of ".basename($file));
return false;
}
$info = array();
foreach($matches[1] as $k => $i){
$v = $matches[2][$k];
switch(strtolower($v)){
case "on":
case "true":
case "yes":
$v = true;
break;
case "off":
case "false":
case "no":
$v = false;
break;
}
$info[$i] = $v;
}
if(!isset($info["name"]) or !isset($info["version"]) or !isset($info["class"]) or !isset($info["author"])){
console("[ERROR] [PluginAPI] Failed parsing of ".basename($file));
}
console("[INFO] [PluginAPI] Loading plugin \"\x1b[32m".$info["name"]."\x1b[0m\" \x1b[35m".$info["version"]."\x1b[0m by \x1b[36m".$info["author"]."\x1b[0m");
if(class_exists($info["class"])){
console("[ERROR] [PluginAPI] Failed loading plugin: class exists");
}
if(eval($content) === false or !class_exists($info["class"])){
console("[ERROR] [PluginAPI] Failed loading plugin: evaluation error");
}
$className = trim($info["class"]);
if(isset($info["api"]) and $info["api"] !== true){
console("[NOTICE] [PluginAPI] Plugin \"\x1b[36m".$info["name"]."\x1b[0m\" got raw access to Server methods");
}
$object = new $className($this->server->api, ((isset($info["api"]) and $info["api"] !== true) ? $this->server:false));
if(!($object instanceof Plugin)){
console("[ERROR] [PluginAPI] Plugin \"\x1b[36m".$info["name"]."\x1b[0m\" doesn't use the Plugin Interface");
if(method_exists($object, "__destruct")){
$object->__destruct();
}
$object = null;
unset($object);
}else{
$this->plugins[$className] = array($object, $info);
}
}
public function get(Plugin $plugin){
foreach($this->plugins as &$p){
if($p[0] === $plugin){
return $p;
}
}
return false;
}
public function configPath(Plugin $plugin){
$p = $this->get($plugin);
if($p === false){
return false;
}
$path = FILE_PATH."plugins/".$p[1]["name"]."/";
$this->plugins[$p[1]["class"]][1]["path"] = $path;
return $path;
}
public function createConfig(Plugin $plugin, $default = array()){
$p = $this->get($plugin);
if($p === false){
return false;
}
$path = FILE_PATH."plugins/".$p[1]["name"]."/";
@mkdir($path);
$this->plugins[$p[1]["class"]][1]["path"] = $path;
$cnf = new Config($path."config.yml", CONFIG_YAML, $default);
$cnf->save();
return $path;
}
private function fillDefaults($default, &$yaml){
foreach($default as $k => $v){
if(is_array($v)){
if(!isset($yaml[$k]) or !is_array($yaml[$k])){
$yaml[$k] = array();
}
$this->fillDefaults($v, $yaml[$k]);
}elseif(!isset($yaml[$k])){
$yaml[$k] = $v;
}
}
}
public function readYAML($file){
return Spyc::YAMLLoad(file_get_contents($file));
}
public function writeYAML($file, $data){
return file_put_contents($file, Spyc::YAMLDump($data));
}
public function init(){
$this->server->event("server.start", array($this, "initAll"));
$this->loadAll();
}
public function loadAll(){
console("[INFO] Loading Plugins...");
$dir = dir(FILE_PATH."plugins/");
while(false !== ($file = $dir->read())){
if($file{0} !== "."){
if(strtolower(substr($file, -3)) === "php"){
$this->load(FILE_PATH."plugins/" . $file);
}
}
}
}
public function initAll(){
foreach($this->plugins as $p){
$p[0]->init(); //ARGHHH!!! Plugin loading randomly fails!!
}
}
}
interface Plugin{
public function __construct(ServerAPI $api, $server = false);
public function init();
public function __destruct();
}

View File

@ -1,454 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class ServerAPI{
var $restart = false;
private $server;
private $config;
private $apiList = array();
public function run(){
$this->load();
return $this->init();
}
public function load(){
@mkdir(FILE_PATH."logs/", 0777, true);
@mkdir(FILE_PATH."players/", 0777);
@mkdir(FILE_PATH."worlds/", 0777);
@mkdir(FILE_PATH."plugins/", 0777);
console("[INFO] Starting ServerAPI server handler...");
file_put_contents(FILE_PATH."logs/packets.log", "");
if(!file_exists(FILE_PATH."logs/test.bin.log") or md5_file(FILE_PATH."logs/test.bin.log") !== TEST_MD5){
console("[NOTICE] Executing tests...");
console("[INFO] OS: ".PHP_OS.", ".Utils::getOS());
console("[INFO] uname -a: ".php_uname("a"));
console("[INFO] PHP Version: ".phpversion());
console("[INFO] Endianness: ".ENDIANNESS);
$test = b"";
$test .= Utils::writeLong("5567381823242127440");
$test .= Utils::writeLong("2338608908624488819");
$test .= Utils::writeLong("2333181766244987936");
$test .= Utils::writeLong("2334669371112169504");
$test .= Utils::writeShort(Utils::readShort("\xff\xff\xff\xff"));
$test .= Utils::writeShort(Utils::readShort("\xef\xff\xff\xff"));
$test .= Utils::writeInt(Utils::readInt("\xff\xff\xff\xff"));
$test .= Utils::writeInt(1);
$test .= Utils::writeInt(-1);
$test .= Utils::writeFloat(Utils::readfloat("\xff\xff\xff\xff"));
$test .= Utils::writeFloat(-1.584563155838E+29);
$test .= Utils::writeFloat(1);
$test .= Utils::writeLDouble(Utils::readLDouble("\xff\xff\xff\xff\xff\xff\xff\xff"));
$test .= Utils::writeLong("-1152921504606846977");
$test .= Utils::writeLong("-1152921504606846976");
$test .= Utils::writeTriad(16777215);
$test .= Utils::writeTriad(16777216);
$str = new Java_String("TESTING\x00\n\r\t\xff");
$test .= Utils::writeLong($str->hashCode());
$test .= Utils::writeDataArray(array("a", "b", "c", "\xff\xff\xff\xff"));
$test .= Utils::hexToStr("012334567890");
file_put_contents(FILE_PATH."logs/test.bin.log", $test);
$md5 = md5($test);
console("[INFO] MD5 of test: ".$md5);
if($md5 !== TEST_MD5){
console("[ERROR] Test error, please send your console.log + test.bin.log to the Github repo");
die();
}
}
console("[DEBUG] Loading server.properties...", true, true, 2);
$this->config = new Config(FILE_PATH . "server.properties", CONFIG_PROPERTIES, array(
"server-name" => "Minecraft Server",
"description" => "Server made using PocketMine-MP",
"motd" => "Welcome @username to this server!",
"invisible" => false,
"port" => 19132,
"memory-limit" => "256M",
"last-update" => false,
"update-channel" => "stable",
"white-list" => false,
"debug" => 2,
"max-players" => 20,
"server-type" => "normal",
"time-per-second" => 20,
"gamemode" => 1,
"difficulty" => 1,
"generator" => "",
"generator-settings" => "",
"level-name" => false,
"server-id" => false,
"upnp-forwarding" => false,
));
$this->parseProperties();
define("DEBUG", $this->getProperty("debug"));
$this->server = new PocketMinecraftServer($this->getProperty("server-name"), $this->getProperty("gamemode"), false, $this->getProperty("port"), $this->getProperty("server-id"));
$this->setProperty("server-id", $this->server->serverID);
$this->server->api = $this;
if($this->getProperty("upnp-forwarding") === true){
console("[INFO] [UPnP] Trying to port forward...");
UPnP_PortForward($this->getProperty("port"));
}
if(($ip = Utils::getIP()) !== false){
console("[INFO] External IP: ".$ip);
}
if($this->getProperty("last-update") === false or ($this->getProperty("last-update") + 3600) < time()){
console("[INFO] Checking for new server version");
console("[INFO] Last check: \x1b[36m".date("Y-m-d H:i:s", $this->getProperty("last-update"))."\x1b[0m");
$channel = "stable";
if($this->getProperty("update-channel") == "dev" or $this->getProperty("update-channel") == "development"){
$channel = "dev";
}
$this->setProperty("update-channel", $channel);
if($channel === "dev"){
$info = json_decode(Utils::curl_get("https://api.github.com/repos/shoghicp/PocketMine-MP"), true);
if($info === false or !isset($info["updated_at"])){
console("[ERROR] GitHub API Error");
}else{
$last = new DateTime($info["updated_at"]);
$last = $last->getTimestamp();
if($last >= $this->getProperty("last-update") and $this->getProperty("last-update") !== false){
console("[NOTICE] \x1b[33mA new DEVELOPMENT version of PocketMine-MP has been released");
console("[NOTICE] \x1b[36mIf you want to update, get the latest version at https://github.com/shoghicp/PocketMine-MP/archive/master.zip");
console("[NOTICE] This message will dissapear when you issue the command \"/update-done\"");
sleep(3);
}else{
$this->setProperty("last-update", time());
console("[INFO] \x1b[36mThis is the latest DEVELOPMENT version");
}
}
}else{
$info = json_decode(Utils::curl_get("https://api.github.com/repos/shoghicp/PocketMine-MP/tags"), true);
if($info === false or !isset($info[0])){
console("[ERROR] GitHub API Error");
}else{
$newest = new VersionString(MAJOR_VERSION);
$newest = array(-1, $newest->getNumber());
foreach($info as $i => $tag){
$update = new VersionString($tag["name"]);
$update = $update->getNumber();
if($update > $newest[1]){
$newest = array($i, $update);
}
}
if($newest[0] !== -1){
$target = $info[$newest[0]];
console("[NOTICE] \x1b[33mA new STABLE version of PocketMine-MP has been released");
console("[NOTICE] \x1b[36mVersion \"".(new VersionString($newest[1]))."\" #".$newest[1]." [".substr($target["commit"]["sha"], 0, 10)."]");
console("[NOTICE] Download it at ".$target["zipball_url"]);
console("[NOTICE] This message will dissapear as soon as you update");
sleep(5);
}else{
$this->setProperty("last-update", time());
console("[INFO] \x1b[36mThis is the latest STABLE version");
}
}
}
}
if(file_exists(FILE_PATH."worlds/level.dat")){
console("[NOTICE] Detected unimported map data. Importing...");
$this->importMap(FILE_PATH."worlds/", true);
}
$this->server->mapName = $this->getProperty("level-name");
$this->server->mapDir = FILE_PATH."worlds/".$this->server->mapName."/";
if($this->server->mapName === false or trim($this->server->mapName) === "" or (!file_exists($this->server->mapDir."chunks.dat") and !file_exists($this->server->mapDir."chunks.dat.gz"))){
if($this->server->mapName === false or trim($this->server->mapName) === ""){
$this->server->mapName = "world";
}
$this->server->mapDir = FILE_PATH."worlds/".$this->server->mapName."/";
$generator = "SuperflatGenerator";
if($this->getProperty("generator") !== false and class_exists($this->getProperty("generator"))){
$generator = $this->getProperty("generator");
}
$this->gen = new WorldGenerator($generator, $this->server->seed);
if($this->getProperty("generator-settings") !== false and trim($this->getProperty("generator-settings")) != ""){
$this->gen->set("preset", $this->getProperty("generator-settings"));
}
$this->gen->init();
$this->gen->generate();
$this->gen->save($this->server->mapDir, $this->server->mapName);
$this->setProperty("level-name", $this->server->mapName);
$this->setProperty("gamemode", 1);
}
$this->loadProperties();
$this->server->loadMap();
//Autoload all default APIs
console("[INFO] Loading default APIs");
$dir = dir(FILE_PATH."src/API/");
while(false !== ($file = $dir->read())){
if($file{0} !== "."){ //Hidden and upwards folders
$API = basename($file, ".php");
if(strtolower($API) !== "serverapi" and strtolower($API) !== "pluginapi"){
$name = strtolower(substr($API, 0, -3));
$this->loadAPI($name, $API);
}
}
}
foreach($this->apiList as $ob){
if(is_callable(array($ob, "init"))){
$ob->init(); //Fails sometimes!!!
}
}
$this->loadAPI("plugin", "PluginAPI"); //fix :(
$this->plugin->init();
$this->server->loadEntities();
}
public function __destruct(){
foreach($this->apiList as $ob){
if(is_callable($ob, "__destruct")){
$ob->__destruct();
unset($this->apiList[$ob]);
}
}
}
private function loadProperties(){
if(($memory = $this->getProperty("memory-limit")) !== false){
$value = array("M" => 1, "G" => 1024);
$real = ((int) substr($memory, 0, -1)) * $value[substr($memory, -1)];
if($real < 128){
console("[ERROR] PocketMine doesn't work right with less than 128MB of RAM", true, true, 0);
}
@ini_set("memory_limit", $memory);
}else{
$this->setProperty("memory-limit", "256M");
}
if(!$this->config->exists("invisible")){
$this->config->set("invisible", false);
}
if(is_object($this->server)){
$this->server->setType($this->getProperty("server-type"));
$this->server->timePerSecond = $this->getProperty("time-per-second");
$this->server->invisible = $this->getProperty("invisible");
$this->server->maxClients = $this->getProperty("max-players");
$this->server->description = $this->getProperty("description");
$this->server->motd = $this->getProperty("motd");
$this->server->gamemode = $this->getProperty("gamemode");
$this->server->difficulty = $this->getProperty("difficulty");
$this->server->whitelist = $this->getProperty("white-list");
$this->server->reloadConfig();
}
}
private function writeProperties(){
$this->config->save();
}
private function parseProperties(){
foreach($this->config->getAll() as $n => $v){
switch($n){
case "last-update":
if($v === false){
$v = time();
}else{
$v = (int) $v;
}
break;
case "gamemode":
case "max-players":
case "port":
case "debug":
case "difficulty":
case "time-per-second":
$v = (int) $v;
break;
case "server-id":
if($v !== false){
$v = preg_match("/[^0-9\-]/", $v) > 0 ? Utils::readInt(substr(md5($v, true), 0, 4)):$v;
}
break;
}
$this->config->set($n, $v);
}
}
public function init(){
$this->server->init();
unregister_tick_function(array($this->server, "tick"));
$this->__destruct();
unset($this->server);
if($this->getProperty("upnp-forwarding") === true ){
console("[INFO] [UPnP] Removing port forward...");
UPnP_RemovePortForward($this->getProperty("port"));
}
return $this->restart;
}
/*-------------------------------------------------------------*/
public function addHandler($e, $c, $p = 5){
return $this->server->addHandler($e, $c, $p);
}
public function dhandle($e, $d){
return $this->server->handle($e, $d);
}
public function handle($e, &$d){
return $this->server->handle($e, $d);
}
public function action($t, $c, $r = true){
return $this->server->action($t, $c, $r);
}
public function schedule($t, $c, $d, $r = false, $e = "server.schedule"){
return $this->server->schedule($t, $c, $d, $r, $e);
}
public function event($e, $d){
return $this->server->event($e, $d);
}
public function trigger($e, $d){
return $this->server->trigger($e, $d);
}
public function deleteEvent($id){
return $this->server->deleteEvent($id);
}
public function importMap($dir, $remove = false){
if(file_exists($dir."level.dat")){
$nbt = new NBT();
$level = parseNBTData($nbt->loadFile($dir."level.dat"));
console("[DEBUG] Importing map \"".$level["LevelName"]."\" gamemode ".$level["GameType"]." with seed ".$level["RandomSeed"], true, true, 2);
unset($level["Player"]);
$lvName = $level["LevelName"]."/";
@mkdir(FILE_PATH."worlds/".$lvName, 0777);
file_put_contents(FILE_PATH."worlds/".$lvName."level.dat", serialize($level));
$entities = parseNBTData($nbt->loadFile($dir."entities.dat"));
file_put_contents(FILE_PATH."worlds/".$lvName."entities.dat", serialize($entities["Entities"]));
if(!isset($entities["TileEntities"])){
$entities["TileEntities"] = array();
}
file_put_contents(FILE_PATH."worlds/".$lvName."tileEntities.dat", serialize($entities["TileEntities"]));
console("[DEBUG] Imported ".count($entities["Entities"])." Entities and ".count($entities["TileEntities"])." TileEntities", true, true, 2);
if($remove === true){
rename($dir."chunks.dat", FILE_PATH."worlds/".$lvName."chunks.dat");
unlink($dir."level.dat");
@unlink($dir."level.dat_old");
@unlink($dir."player.dat");
unlink($dir."entities.dat");
}else{
copy($dir."chunks.dat", FILE_PATH."worlds/".$lvName."chunks.dat");
}
if($this->getProperty("level-name") === false){
console("[INFO] Setting default level to \"".$level["LevelName"]."\"");
$this->setProperty("level-name", $level["LevelName"]);
$this->setProperty("gamemode", $level["GameType"]);
$this->server->seed = $level["RandomSeed"];
$this->server->spawn = array("x" => $level["SpawnX"], "y" => $level["SpawnY"], "z" => $level["SpawnZ"]);
$this->writeProperties();
}
console("[INFO] Map \"".$level["LevelName"]."\" importing done!");
unset($level, $entities, $nbt);
return true;
}
return false;
}
public function getProperties(){
return $this->config->getAll();
}
public function getProperty($name){
if(($v = arg($name)) !== false){ //Allow for command-line arguments
switch(strtolower(trim($v))){
case "on":
case "true":
case "yes":
$v = true;
break;
case "off":
case "false":
case "no":
$v = false;
break;
}
switch($name){
case "last-update":
if($v === false){
$v = time();
}else{
$v = (int) $v;
}
break;
case "gamemode":
case "max-players":
case "port":
case "debug":
case "difficulty":
case "time-per-second":
$v = (int) $v;
break;
case "server-id":
if($v !== false){
$v = preg_match("/[^0-9\-]/", $v) > 0 ? Utils::readInt(substr(md5($v, true), 0, 4)):$v;
}
break;
}
return $v;
}
return $this->config->get($name);
}
public function setProperty($name, $value){
$this->config->set($name, $value);
$this->writeProperties();
$this->loadProperties();
}
public function getList(){
return $this->apiList;
}
public function loadAPI($name, $class, $dir = false){
if($dir === false){
$dir = FILE_PATH."src/API/";
}
$file = $dir.$class.".php";
if(!file_exists($file)){
console("[ERROR] API ".$name." [".$class."] in ".$dir." doesn't exist", true, true, 0);
return false;
}
require_once($file);
$this->$name = new $class($this->server);
$this->apiList[] = $this->$name;
console("[INFO] API \x1b[36m".$name."\x1b[0m [\x1b[30;1m".$class."\x1b[0m] loaded");
}
}

View File

@ -1,127 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class TimeAPI{
var $phases = array(
"day" => 0,
"sunset" => 9500,
"night" => 10900,
"sunrise" => 17800,
);
private $server;
function __construct(PocketMinecraftServer $server){
$this->server = $server;
}
public function init(){
$this->server->api->console->register("time", "Manages server time", array($this, "commandHandler"));
}
public function commandHandler($cmd, $params){
switch($cmd){
case "time":
$p = strtolower(array_shift($params));
switch($p){
case "check":
console("[INFO] Time: ".$this->getDate().", ".$this->getPhase()." (".$this->get(true).")");
break;
case "add":
$this->add(array_shift($params));
break;
case "set":
$this->set(array_shift($params));
break;
case "sunrise":
$this->sunrise();
break;
case "day":
$this->day();
break;
case "sunset":
$this->sunset();
break;
case "night":
$this->night();
break;
default:
console("[INFO] Usage: /time <check | set | add | sunrise | day | sunset | night> [time]");
break;
}
break;
}
}
public function night(){
$this->set("night");
}
public function day(){
$this->set("day");
}
public function sunrise(){
$this->set("sunrise");
}
public function sunset(){
$this->set("sunset");
}
public function get($raw = false){
return $raw === true ? $this->server->time:abs($this->server->time) % 19200;
}
public function add($time){
$this->server->time += (int) $time;
}
public function getDate($time = false){
$time = $time === false ? $this->get():$time;
return str_pad(strval((floor($time /800) + 6) % 24), 2, "0", STR_PAD_LEFT).":".str_pad(strval(floor(($time % 800) / 13.33)), 2, "0", STR_PAD_LEFT);
}
public function getPhase($time = false){
$time = $time === false ? $this->get():$time;
if($time < $this->phase["sunset"]){
$time = "day";
}elseif($time < $this->phase["night"]){
$time = "sunset";
}elseif($time < $this->phase["sunrise"]){
$time = "night";
}else{
$time = "sunrise";
}
return $time;
}
public function set($time){
if(is_string($time) and isset($this->phases[$time])){
$this->server->time = $this->phases[$time];
}else{
$this->server->time = (int) $time;
}
}
}

View File

@ -1,71 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Async extends Thread {
/**
* Provide a passthrough to call_user_func_array
**/
public function __construct($method, $params = array()){
$this->method = $method;
$this->params = $params;
$this->result = null;
$this->joined = false;
}
/**
* The smallest thread in the world
**/
public function run(){
if(($this->result=call_user_func_array($this->method, $this->params))){
return true;
}else{
return false;
}
}
/**
* Static method to create your threads from functions ...
**/
public static function call($method, $params = array()){
$thread = new Async($method, $params);
if($thread->start()){
return $thread;
} /** else throw Nastyness **/
}
/**
* Do whatever, result stored in $this->result, don't try to join twice
**/
public function __toString(){
if(!$this->joined) {
$this->joined = true;
$this->join();
}
return $this->result;
}
}

View File

@ -1,31 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
/*
class BlockIterator implements Iterator{
}*/

View File

@ -1,246 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class BlockFace{
const BOTTOM = 0;
const TOP = 1;
const DOWN = 0;
const UP = 1;
const SOUTH = 3;
const EAST = 5;
const NORTH = 2;
const WEST = 4;
public static function setPosition(&$data, $face){
switch((int) $face){
case 0:
--$data["y"];
break;
case 1:
++$data["y"];
break;
case 2:
--$data["z"];
break;
case 3:
++$data["z"];
break;
case 4:
--$data["x"];
break;
case 5:
++$data["x"];
break;
default:
return false;
}
return true;
}
}
class Material{
static $flowable = array(
0 => true,
6 => true,
30 => true,
31 => true,
32 => true,
37 => true,
38 => true,
39 => true,
40 => true,
50 => true,
51 => true,
55 => true,
59 => true,
78 => true,
105 => true,
);
static $unbreakable = array(
0 => true,
7 => true,
8 => true,
9 => true,
10 => true,
11 => true,
);
static $transparent = array(
0 => true,
6 => true,
8 => true,
9 => true,
10 => true,
11 => true,
18 => true,
20 => true,
26 => true,
30 => true,
31 => true,
32 => true,
37 => true,
38 => true,
39 => true,
40 => true,
44 => true,
46 => true,
50 => true,
51 => true,
53 => true,
59 => true,
64 => true,
65 => true,
67 => true,
71 => true,
78 => true,
79 => true,
83 => true,
85 => true,
89 => true,
96 => true,
102 => true,
105 => true,
107 => true,
108 => true,
);
static $replaceable = array(
0 => true,
8 => true,
9 => true,
10 => true,
11 => true,
31 => true,
51 => true,
78 => true,
);
static $activable = array(
2 => true,
3 => true,
6 => true,
26 => true,
31 => true,
//46 => true,
51 => true,
54 => true,
58 => true,
59 => true,
61 => true,
62 => true,
64 => true,
71 => true,
78 => true,
96 => true,
105 => true,
107 => true,
247 => true,
);
static $placeable = array(
1 => true,
2 => true,
3 => true,
4 => true,
5 => true,
6 => true,
//7 => true,
8 => true,
9 => true,
10 => true,
11 => true,
12 => true,
13 => true,
14 => true,
15 => true,
16 => true,
17 => true,
18 => true,
19 => true,
20 => true,
21 => true,
22 => true,
24 => true,
355 => 26,
30 => true,
35 => true,
37 => true,
38 => true,
39 => true,
40 => true,
41 => true,
42 => true,
43 => true,
44 => true,
45 => true,
46 => true,
47 => true,
48 => true,
49 => true,
50 => true,
53 => true,
54 => true,
56 => true,
59 => true,
57 => true,
58 => true,
295 => 59,
61 => true,
324 => 64,
65 => true,
67 => true,
330 => 71,
73 => true,
79 => true,
80 => true,
81 => true,
82 => true,
83 => true,
85 => true,
86 => true,
87 => true,
88 => true,
89 => true,
91 => true,
96 => true,
98 => true,
102 => true,
103 => true,
362 => 105,
107 => true,
108 => true,
246 => true,
247 => true,
);
static $blocks = array(
0 => "Air",
1 => "Stone",
2 => "Grass",
3 => "Dirt",
4 => "Cobblestone",
5 => "Wooden Planks",
6 => "Sapling",
7 => "Bedrock",
);
}

View File

@ -1,35 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Deprecation{
public static $events = array(
"world.block.change" => "block.change",
);
}

View File

@ -1,564 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Player{
private $server;
private $queue = array();
private $buffer = array();
private $evid = array();
var $timeout;
var $connected = true;
var $clientID;
var $ip;
var $port;
var $counter = array(0, 0, 0);
var $username;
var $eid = false;
var $data = array();
var $entity = false;
var $auth = false;
var $CID;
var $MTU;
var $spawned = false;
var $inventory;
var $equipment = array(1, 0);
var $loggedIn = false;
function __construct(PocketMinecraftServer $server, $clientID, $ip, $port, $MTU){
$this->MTU = $MTU;
$this->server = $server;
$this->clientID = $clientID;
$this->CID = $this->server->clientID($ip, $port);
$this->ip = $ip;
$this->port = $port;
$this->timeout = microtime(true) + 25;
$this->inventory = array_fill(0, 36, array(0, 0, 0));
$this->evid[] = $this->server->event("server.tick", array($this, "onTick"));
$this->evid[] = $this->server->event("server.close", array($this, "close"));
console("[DEBUG] New Session started with ".$ip.":".$port.". MTU ".$this->MTU.", Client ID ".$this->clientID, true, true, 2);
}
public function onTick($time, $event){
if($event !== "server.tick"){ //WTF??
return;
}
if($time > $this->timeout){
$this->close("timeout");
}else{
if(!empty($this->queue)){
$cnt = 0;
while($cnt < 4){
$p = array_shift($this->queue);
if($p === null){
break;
}
switch($p[0]){
case 0:
$this->dataPacket($p[1], $p[2], false, $p[3]);
break;
case 1:
eval($p[1]);
break;
}
++$cnt;
}
}
}
}
public function save(){
if(is_object($this->entity)){
$this->data["spawn"] = array(
"x" => $this->entity->x,
"y" => $this->entity->y,
"z" => $this->entity->z,
);
}
}
public function close($reason = "", $msg = true){
if($this->connected === true){
foreach($this->evid as $ev){
$this->server->deleteEvent($ev);
}
$this->server->api->dhandle("player.quit", $this);
$reason = $reason == "" ? "server stop":$reason;
$this->save();
$this->eventHandler(new Container("You have been kicked. Reason: ".$reason), "server.chat");
$this->dataPacket(MC_LOGIN_STATUS, array(
"status" => 1,
));
$this->dataPacket(MC_DISCONNECT);
$this->connected = false;
if($msg === true){
$this->server->api->chat->broadcast($this->username." left the game");
}
console("[INFO] Session with \x1b[36m".$this->ip.":".$this->port."\x1b[0m Client ID ".$this->clientID." closed due to ".$reason);
$this->server->api->player->remove($this->CID);
}
}
public function addItem($type, $damage, $count){
while($count > 0){
$add = 0;
foreach($this->inventory as $s => $data){
if($data[0] === 0){
$add = min(64, $count);
$this->inventory[$s] = array($type, $damage, $add);
break;
}elseif($data[0] === $type and $data[1] === $damage){
$add = min(64 - $data[2], $count);
if($add <= 0){
continue;
}
$this->inventory[$s] = array($type, $damage, $data[2] + $add);
break;
}
}
if($add === 0){
return false;
}
$count -= $add;
}
return true;
}
public function removeItem($type, $damage, $count){
while($count > 0){
$remove = 0;
foreach($this->inventory as $s => $data){
if($data[0] === $type and $data[1] === $damage){
$remove = min($count, $data[2]);
if($remove < $data[2]){
$this->inventory[$s][2] -= $remove;
}else{
$this->inventory[$s] = array(0, 0, 0);
}
break;
}
}
if($remove === 0){
return false;
}
$count -= $remove;
}
return true;
}
public function hasItem($type, $damage = false){
foreach($this->inventory as $s => $data){
if($data[0] === $type and ($data[1] === $damage or $damage === false) and $data[2] > 0){
return true;
}
}
return false;
}
public function eventHandler($data, $event){
switch($event){
case "player.block.place":
if($data["eid"] === $this->eid and $this->server->gamemode === 0){
$this->removeItem($data["original"][0], $data["original"][1], 1);
}
break;
case "player.pickup":
if($data["eid"] === $this->eid){
$data["eid"] = 0;
if($this->server->gamemode === 0){
$this->addItem($data["entity"]->type, $data["entity"]->meta, $data["entity"]->stack);
}
}
$this->dataPacket(MC_TAKE_ITEM_ENTITY, $data);
break;
case "player.equipment.change":
if($data["eid"] === $this->eid){
break;
}
$this->dataPacket(MC_PLAYER_EQUIPMENT, $data);
break;
case "block.change":
$this->dataPacket(MC_UPDATE_BLOCK, $data);
break;
case "entity.move":
if($data->eid === $this->eid){
break;
}
$this->dataPacket(MC_MOVE_ENTITY_POSROT, array(
"eid" => $data->eid,
"x" => $data->x,
"y" => $data->y,
"z" => $data->z,
"yaw" => $data->yaw,
"pitch" => $data->pitch,
));
break;
case "entity.remove":
if($data->eid === $this->eid){
break;
}
$this->dataPacket(MC_REMOVE_ENTITY, array(
"eid" => $data->eid,
));
break;
case "server.time":
$this->dataPacket(MC_SET_TIME, array(
"time" => $data,
));
break;
case "entity.animate":
if($data["eid"] === $this->eid){
break;
}
$this->dataPacket(MC_ANIMATE, array(
"eid" => $data["eid"],
"action" => $data["action"],
));
break;
case "server.chat":
if(($data instanceof Container) === true){
if(!$data->check($this->username)){
return;
}else{
$message = $data->get();
}
}else{
$message = (string) $data;
}
$this->dataPacket(MC_CHAT, array(
"message" => str_replace("@username", $this->username, $message),
));
break;
}
}
public function handle($pid, $data){
if($this->connected === true){
$this->timeout = microtime(true) + 25;
switch($pid){
case 0xa0: //NACK
if(isset($this->buffer[$data[2]])){
array_unshift($this->queue, array(0, $this->buffer[$data[2]][0], $this->buffer[$data[2]][1], $data[2]));
}
if(isset($data[3])){
if(isset($this->buffer[$data[3]])){
array_unshift($this->queue, array(0, $this->buffer[$data[3]][0], $this->buffer[$data[3]][1], $data[3]));
}
}
break;
case 0xc0: //ACK
$diff = $data[2] - $this->counter[2];
if($diff > 8){ //Packet recovery
array_unshift($this->queue, array(0, $this->buffer[$data[2]][0], $this->buffer[$data[2]][1], $data[2]));
}
$this->counter[2] = $data[2];
unset($this->buffer[$data[2]]);
if(isset($data[3])){
$diff = $data[3] - $this->counter[2];
if($diff > 8){ //Packet recovery
array_unshift($this->queue, array(0, $this->buffer[$data[3]][0], $this->buffer[$data[3]][1], $data[3]));
}
$this->counter[2] = $data[3];
unset($this->buffer[$data[3]]);
}
break;
case 0x07:
$this->send(0x08, array(
MAGIC,
$this->server->serverID,
$this->port,
$data[3],
0,
));
break;
case 0x80:
case 0x81:
case 0x82:
case 0x83:
case 0x84:
case 0x85:
case 0x86:
case 0x87:
case 0x88:
case 0x89:
case 0x8a:
case 0x8b:
case 0x8c:
case 0x8d:
case 0x8e:
case 0x8f:
if(isset($data[0])){
$diff = $data[0] - $this->counter[1];
if($diff > 1){ //Packet recovery
for($i = $this->counter[1]; $i < $data[0]; ++$i){
$this->send(0xa0, array(1, true, $i));
}
$this->counter[1] = $data[0];
}elseif($diff === 1){
$this->counter[1] = $data[0];
}
$this->send(0xc0, array(1, true, $data[0]));
}
switch($data["id"]){
case MC_KEEP_ALIVE:
break;
case 0x03:
break;
case MC_DISCONNECT:
$this->close("client disconnect");
break;
case MC_CLIENT_CONNECT:
$this->dataPacket(MC_SERVER_HANDSHAKE, array(
"port" => $this->port,
"session" => $data["session"],
"session2" => Utils::readLong("\x00\x00\x00\x00\x04\x44\x0b\xa9"),
));
break;
case MC_CLIENT_HANDSHAKE:
break;
case MC_LOGIN:
if($this->loggedIn === true){
break;
}
$this->loggedIn = true;
$this->username = str_replace(array("\x00", "/", " ", "\r", "\n"), array("", "-", "_", "", ""), $data["username"]);
if($this->username == ""){
$this->close("bad username", false);
break;
}
$o = $this->server->api->player->getOffline($this->username);
if($this->server->whitelist === true and !$this->server->api->ban->inWhitelist($this->username)){
$this->close("\"\x1b[33m".$this->username."\x1b[0m\" not being on white-list", false);
break;
}elseif($this->server->api->ban->isBanned($this->username) or $this->server->api->ban->isIPBanned($this->ip)){
$this->close("\"\x1b[33m".$this->username."\x1b[0m\" is banned!", false);
}
$u = $this->server->api->player->get($this->username);
$c = $this->server->api->player->getByClientID($this->clientID);
if($u !== false){
$u->close("logged in from another location");
}
if($c !== false){
$c->close("logged in from another location");
}
if($this->server->api->dhandle("player.join", $this) === false){
$this->close();
return;
}
$this->server->api->player->add($this->CID);
$this->auth = true;
if(!isset($this->data["inventory"]) or $this->server->gamemode === 1){
$this->data["inventory"] = $this->inventory;
}
$this->inventory = &$this->data["inventory"];
$this->data["lastIP"] = $this->ip;
$this->data["lastID"] = $this->clientID;
$this->server->api->player->saveOffline($this->username, $this->data);
$this->dataPacket(MC_LOGIN_STATUS, array(
"status" => 0,
));
$this->dataPacket(MC_START_GAME, array(
"seed" => $this->server->seed,
"x" => $this->data["spawn"]["x"],
"y" => $this->data["spawn"]["y"],
"z" => $this->data["spawn"]["z"],
"unknown1" => 0,
"gamemode" => $this->server->gamemode,
"eid" => 0,
));
break;
case MC_READY:
switch($data["status"]){
case 1:
if($this->spawned !== false){
break;
}
$this->spawned = true;
$this->entity = $this->server->api->entity->add(ENTITY_PLAYER, 0, array("player" => $this));
$this->eid = $this->entity->eid;
$this->server->query("UPDATE players SET EID = ".$this->eid." WHERE clientID = ".$this->clientID.";");
$this->entity->x = $this->data["spawn"]["x"];
$this->entity->y = $this->data["spawn"]["y"];
$this->entity->z = $this->data["spawn"]["z"];
$this->entity->setName($this->username);
$this->entity->data["clientID"] = $this->clientID;
$this->server->api->entity->spawnAll($this);
$this->server->api->entity->spawnToAll($this->eid);
$this->evid[] = $this->server->event("server.time", array($this, "eventHandler"));
$this->evid[] = $this->server->event("server.chat", array($this, "eventHandler"));
$this->evid[] = $this->server->event("entity.remove", array($this, "eventHandler"));
$this->evid[] = $this->server->event("entity.move", array($this, "eventHandler"));
$this->evid[] = $this->server->event("entity.animate", array($this, "eventHandler"));
$this->evid[] = $this->server->event("player.equipment.change", array($this, "eventHandler"));
$this->evid[] = $this->server->event("player.pickup", array($this, "eventHandler"));
$this->evid[] = $this->server->event("block.change", array($this, "eventHandler"));
$this->evid[] = $this->server->event("player.block.place", array($this, "eventHandler"));
console("[DEBUG] Player \"".$this->username."\" EID ".$this->eid." spawned at X ".$this->entity->x." Y ".$this->entity->y." Z ".$this->entity->z, true, true, 2);
$this->eventHandler(new Container($this->server->motd), "server.chat");
if($this->MTU <= 548){
$this->eventHandler("Your connection is bad, you may experience lag and slow map loading.", "server.chat");
}
foreach($this->inventory as $s => $data){
if($data[0] > 0 and $data[2] >= 0){
$e = $this->server->api->entity->add(ENTITY_ITEM, $data[0], array(
"x" => $this->entity->x + 0.5,
"y" => $this->entity->y + 0.19,
"z" => $this->entity->z + 0.5,
"meta" => $data[1],
"stack" => $data[2],
));
$this->server->api->entity->spawnTo($e->eid, $this);
}
$this->inventory[$s] = array(0, 0, 0);
}
break;
case 2://Chunk loaded?
break;
}
break;
case MC_MOVE_PLAYER:
if(is_object($this->entity)){
$this->entity->setPosition($data["x"], $data["y"], $data["z"], $data["yaw"], $data["pitch"]);
$this->server->api->dhandle("player.move", $this->entity);
}
break;
case MC_PLAYER_EQUIPMENT:
$data["eid"] = $this->eid;
if($this->server->handle("player.equipment.change", $data) !== false){
$this->equipment[0] = $data["block"];
$this->equipment[1] = $data["meta"];
console("[DEBUG] EID ".$this->eid." has now ".$data["block"].":".$data["meta"]." in their hands!", true, true, 2);
}
break;
case MC_REQUEST_CHUNK:
$this->actionQueue('
$max = max(1, floor(($this->MTU - 16 - 255) / 192));
$chunk = $this->server->api->level->getOrderedChunk('.$data["x"].', '.$data["z"].', $max);
foreach($chunk as $d){
$this->dataPacket(MC_CHUNK_DATA, array(
"x" => '.$data["x"].',
"z" => '.$data["z"].',
"data" => $d,
), true);
}
');
console("[INTERNAL] Chunk X ".$data["x"]." Z ".$data["z"]." requested", true, true, 3);
break;
case MC_USE_ITEM:
$data["eid"] = $this->eid;
if(Utils::distance($this->entity->position, $data) > 10){
break;
}elseif($this->server->gamemode === 0 and !$this->hasItem($data["block"], $data["meta"])){
console("[DEBUG] Player \"".$this->username."\" tried to place not got block (or crafted block)", true, true, 2);
//break;
}
$this->server->handle("player.block.action", $data);
break;
case MC_REMOVE_BLOCK:
$data["eid"] = $this->eid;
if(Utils::distance($this->entity->position, $data) > 8){
break;
}
$this->server->handle("player.block.break", $data);
break;
case MC_INTERACT:
if(isset($this->server->entities[$data["target"]]) and Utils::distance($this->entity->position, $this->server->entities[$data["target"]]->position) <= 8){
if($this->handle("player.interact", $data) !== false){
console("[DEBUG] EID ".$this->eid." attacked EID ".$data["target"], true, true, 2);
if($this->server->gamemode !== 1 and $this->server->difficulty > 0){
$this->server->api->entity->harm($data["target"], $this->server->difficulty, $this->eid);
}
}
}
break;
case MC_ANIMATE:
$this->server->api->dhandle("entity.animate", array("eid" => $this->eid, "action" => $data["action"]));
break;
case MC_RESPAWN:
$this->entity->invincible = true;
$this->entity->setHealth(20, "respawn");
$this->entity->setPosition($data["x"], $data["y"], $data["z"], 0, 0);
$this->entity->invincible = false;
break;
case MC_SET_HEALTH:
if($this->server->gamemode === 1){
break;
}
//$this->entity->setHealth($data["health"], "client");
break;
case MC_DROP_ITEM:
if($this->server->handle("player.drop", $data) !== false){
$this->server->api->block->drop($this->entity->x, $this->entity->y, $this->entity->z, $data["block"], $data["meta"], $data["stack"]);
}
break;
default:
console("[DEBUG] Unhandled 0x".dechex($data["id"])." Data Packet for Client ID ".$this->clientID.": ".print_r($data, true), true, true, 2);
break;
}
break;
}
}
}
public function send($pid, $data = array(), $raw = false){
if($this->connected === true){
$this->server->send($pid, $data, $raw, $this->ip, $this->port);
}
}
public function actionQueue($code){
$this->queue[] = array(1, $code);
}
public function dataPacket($id, $data = array(), $queue = false, $count = false){
if($queue === true){
$this->queue[] = array(0, $id, $data, $count);
}else{
if($count === false){
$count = $this->counter[0];
++$this->counter[0];
if(count($this->buffer) >= 512){
array_shift($this->buffer);
}
$this->buffer[$count] = array($id, $data);
}
$data["id"] = $id;
$this->send(0x80, array(
$count,
0x00,
$data,
));
}
}
}

View File

@ -1,643 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class PocketMinecraftServer{
var $version, $invisible, $api, $tickMeasure, $preparedSQL, $seed, $gamemode, $name, $maxClients, $clients, $eidCnt, $custom, $description, $motd, $timePerSecond, $spawn, $entities, $mapDir, $mapName, $map, $levelData, $tileEntities;
private $database, $interface, $evCnt, $handCnt, $events, $handlers, $serverType, $lastTick, $ticker;
private function load(){
$this->version = new VersionString();
console("[INFO] \x1b[33;1mPocketMine-MP ".MAJOR_VERSION." #".$this->version->getNumber()." by @shoghicp, LGPL License", true, true, 0);
console("[INFO] Target Minecraft PE: \x1b[36;1m".CURRENT_MINECRAFT_VERSION."\x1b[0m, protocol #".CURRENT_PROTOCOL, true, true, 0);
if($this->version->isDev()){
console("[INFO] \x1b[31;1mThis is a Development version");
}
console("[INFO] Starting Minecraft PE Server at *:".$this->port);
if($this->port < 19132 or $this->port > 19135){
console("[WARNING] You've selected a not-standard port. Normal port range is from 19132 to 19135 included");
}
$this->serverID = $this->serverID === false ? Utils::readLong(Utils::getRandomBytes(8)):$this->serverID;
$this->seed = $this->seed === false ? Utils::readInt(Utils::getRandomBytes(4)):$this->seed;
console("[INFO] Loading database...");
$this->startDatabase();
$this->doTick = false;
$this->api = false;
$this->mapDir = false;
$this->mapName = false;
$this->events = array();
$this->handlers = array();
$this->map = false;
$this->invisible = false;
$this->levelData = false;
$this->difficulty = 1;
$this->tileEntities = array();
$this->entities = array();
$this->custom = array();
$this->evCnt = 0;
$this->handCnt = 0;
$this->eidCnt = 1;
$this->maxClients = 20;
$this->schedule = array();
$this->scheduleCnt = 0;
$this->description = "";
$this->whitelist = false;
$this->clients = array();
$this->spawn = array("x" => 128.5,"y" => 100,"z" => 128.5);
$this->time = 0;
$this->timePerSecond = 10;
$this->tickMeasure = array_fill(0, 40, 0);
$this->setType("normal");
$this->interface = new MinecraftInterface("255.255.255.255", $this->port, true, false);
$this->reloadConfig();
console("[INFO] Server Name: \x1b[36m".$this->name."\x1b[0m");
console("[DEBUG] Server ID: ".$this->serverID, true, true, 2);
$this->stop = false;
}
function __construct($name, $gamemode = 1, $seed = false, $port = 19132, $serverID = false){
$this->port = (int) $port; //19132 - 19135
$this->gamemode = (int) $gamemode;
$this->name = $name;
$this->motd = "Welcome to ".$name;
$this->serverID = $serverID;
$this->seed = $seed;
$this->load();
}
public function getTPS(){
$v = array_values($this->tickMeasure);
$tps = 40 / ($v[39] - $v[0]);
return round($tps, 4);
}
public function loadEvents(){
$this->action(500000, '$this->time += (int) ($this->timePerSecond / 2);$this->api->dhandle("server.time", $this->time);');
$this->action(5000000, 'if($this->difficulty < 2){$this->api->dhandle("server.regeneration", 1);}');
$this->action(1000000 * 60, '$this->reloadConfig();');
$this->action(1000000 * 60 * 10, '$this->custom = array();');
if($this->api !== false){
$this->action(1000000 * 80, '$cnt = count($this->clients); if($cnt > 1){$this->api->chat->broadcast("Online (".$cnt."): ".implode(", ",$this->api->player->online()));}');
}
$this->action(1000000 * 120, '$this->debugInfo(true);');
}
public function startDatabase(){
$this->preparedSQL = new stdClass();
$this->database = new SQLite3(":memory:");
//$this->query("PRAGMA journal_mode = OFF;");
//$this->query("PRAGMA encoding = \"UTF-8\";");
//$this->query("PRAGMA secure_delete = OFF;");
$this->query("CREATE TABLE players (clientID INTEGER PRIMARY KEY, EID NUMERIC, ip TEXT, port NUMERIC, name TEXT UNIQUE);");
$this->query("CREATE TABLE entities (EID INTEGER PRIMARY KEY, type NUMERIC, class NUMERIC, name TEXT, x NUMERIC, y NUMERIC, z NUMERIC, yaw NUMERIC, pitch NUMERIC, health NUMERIC);");
$this->query("CREATE TABLE metadata (EID INTEGER PRIMARY KEY, name TEXT, value TEXT);");
$this->query("CREATE TABLE actions (ID INTEGER PRIMARY KEY, interval NUMERIC, last NUMERIC, code TEXT, repeat NUMERIC);");
$this->query("CREATE TABLE events (ID INTEGER PRIMARY KEY, name TEXT);");
$this->query("CREATE TABLE handlers (ID INTEGER PRIMARY KEY, name TEXT, priority NUMERIC);");
//$this->query("PRAGMA synchronous = OFF;");
$this->preparedSQL->selectHandlers = $this->database->prepare("SELECT DISTINCT ID FROM handlers WHERE name = :name ORDER BY priority DESC;");
$this->preparedSQL->selectEvents = $this->database->prepare("SELECT DISTINCT ID FROM events WHERE name = :name;");
$this->preparedSQL->selectActions = $this->database->prepare("SELECT ID,code,repeat FROM actions WHERE last <= (:time - interval);");
$this->preparedSQL->updateActions = $this->database->prepare("UPDATE actions SET last = :time WHERE last <= (:time - interval);");
}
public function query($sql, $fetch = false){
console("[INTERNAL] [SQL] ".$sql, true, true, 3);
$result = $this->database->query($sql) or console("[ERROR] [SQL Error] ".$this->database->lastErrorMsg().". Query: ".$sql, true, true, 0);
if($fetch === true and ($result !== false and $result !== true)){
$result = $result->fetchArray(SQLITE3_ASSOC);
}
return $result;
}
public function reloadConfig(){
}
public function debugInfo($console = false){
$info = array();
$info["tps"] = $this->getTPS();
$info["memory_usage"] = round((memory_get_usage(true) / 1024) / 1024, 2)."MB";
$info["memory_peak_usage"] = round((memory_get_peak_usage(true) / 1024) / 1024, 2)."MB";
$info["entities"] = $this->query("SELECT count(EID) as count FROM entities;", true);
$info["entities"] = $info["entities"]["count"];
$info["events"] = $this->query("SELECT count(ID) as count FROM events;", true);
$info["events"] = $info["events"]["count"];
$info["handlers"] = $this->query("SELECT count(ID) as count FROM handlers;", true);
$info["handlers"] = $info["handlers"]["count"];
$info["actions"] = $this->query("SELECT count(ID) as count FROM actions;", true);
$info["actions"] = $info["actions"]["count"];
$info["garbage"] = gc_collect_cycles();
$this->handle("server.debug", $info);
if($console === true){
console("[DEBUG] TPS: ".$info["tps"].", Memory usage: ".$info["memory_usage"]." (Peak ".$info["memory_peak_usage"]."), Entities: ".$info["entities"].", Events: ".$info["events"].", Handlers: ".$info["handlers"].", Actions: ".$info["actions"].", Garbage: ".$info["garbage"], true, true, 2);
}
return $info;
}
public function close($reason = "stop"){
if($this->stop !== true){
if(is_int($reason)){
$reason = "signal stop";
}
if(($this->api instanceof ServerAPI) === true){
if(($this->api->chat instanceof ChatAPI) === true){
$this->api->chat->send(false, "Stopping server...");
}
}
//$this->ticker->stop = true;
$this->save(true);
$this->stop = true;
$this->trigger("server.close", $reason);
$this->interface->close();
}
}
public function chat($owner, $text, $target = false){
$this->api->chat->send($owner, $text, $target);
}
public function setType($type = "normal"){
switch($type){
case "normal":
$this->serverType = "MCCPP;Demo;";
break;
case "minecon":
$this->serverType = "MCCPP;MINECON;";
break;
}
}
public function addHandler($event, $callable, $priority = 5){
if(!is_callable($callable)){
return false;
}elseif(isset(Deprecation::$events[$event])){
$sub = "";
if(Deprecation::$events[$event] !== false){
$sub = " Substitute \"".Deprecation::$events[$event]."\" found.";
}
console("[ERROR] Event \"$event\" has been deprecated.$sub [Adding handle to ".(is_array($callable) ? get_class($callable[0])."::".$callable[1]:$callable)."]");
}
$priority = (int) $priority;
$hnid = $this->handCnt++;
$this->handlers[$hnid] = $callable;
$this->query("INSERT INTO handlers (ID, name, priority) VALUES (".$hnid.", '".str_replace("'", "\\'", $event)."', ".$priority.");");
console("[INTERNAL] New handler ".(is_array($callable) ? get_class($callable[0])."::".$callable[1]:$callable)." to special event ".$event." (ID ".$hnid.")", true, true, 3);
return $hnid;
}
public function handle($event, &$data){
$this->preparedSQL->selectHandlers->reset();
$this->preparedSQL->selectHandlers->clear();
$this->preparedSQL->selectHandlers->bindValue(":name", $event, SQLITE3_TEXT);
$handlers = $this->preparedSQL->selectHandlers->execute();
$result = true;
if($handlers !== false and $handlers !== true){
console("[INTERNAL] Handling ".$event, true, true, 3);
$call = array();
while(($hn = $handlers->fetchArray(SQLITE3_ASSOC)) !== false){
$call[(int) $hn["ID"]] = true;
}
$handlers->finalize();
foreach($call as $hnid => $boolean){
if($result !== false){
$called[$hnid] = true;
$handler = $this->handlers[$hnid];
if(is_array($handler)){
$method = $handler[1];
$result = $handler[0]->$method($data, $event);
}else{
$result = $handler($data, $event);
}
}else{
break;
}
}
}elseif(isset(Deprecation::$events[$event])){
$sub = "";
if(Deprecation::$events[$event] !== false){
$sub = " Substitute \"".Deprecation::$events[$event]."\" found.";
}
console("[ERROR] Event \"$event\" has been deprecated.$sub [Handler]");
}
if($result !== false){
$this->trigger($event, $data);
}
return $result;
}
public function eventHandler($data, $event){
switch($event){
}
}
public function loadMap(){
if($this->mapName !== false and trim($this->mapName) !== ""){
$this->levelData = unserialize(file_get_contents($this->mapDir."level.dat"));
if($this->levelData === false){
console("[ERROR] Invalid world data for \"".$this->mapDir."\. Please import the world correctly");
$this->close("invalid world data");
}
console("[INFO] Map: ".$this->levelData["LevelName"]);
$this->time = (int) $this->levelData["Time"];
$this->seed = (int) $this->levelData["RandomSeed"];
if(isset($this->levelData["SpawnX"])){
$this->spawn = array("x" => $this->levelData["SpawnX"], "y" => $this->levelData["SpawnY"], "z" => $this->levelData["SpawnZ"]);
}else{
$this->levelData["SpawnX"] = $this->spawn["x"];
$this->levelData["SpawnY"] = $this->spawn["y"];
$this->levelData["SpawnZ"] = $this->spawn["z"];
}
$this->levelData["Time"] = $this->time;
console("[INFO] Spawn: X \x1b[36m".$this->levelData["SpawnX"]."\x1b[0m Y \x1b[36m".$this->levelData["SpawnY"]."\x1b[0m Z \x1b[36m".$this->levelData["SpawnZ"]."\x1b[0m");
console("[INFO] Time: \x1b[36m".$this->time."\x1b[0m");
console("[INFO] Seed: \x1b[36m".$this->seed."\x1b[0m");
console("[INFO] Gamemode: \x1b[36m".($this->gamemode === 0 ? "survival":"creative")."\x1b[0m");
$d = array(0 => "peaceful", 1 => "easy", 2 => "normal", 3 => "hard");
console("[INFO] Difficulty: \x1b[36m".$d[$this->difficulty]."\x1b[0m");
console("[INFO] Loading map...");
$this->map = new ChunkParser();
if(!$this->map->loadFile($this->mapDir."chunks.dat")){
console("[ERROR] Couldn't load the map \"\x1b[32m".$this->levelData["LevelName"]."\x1b[0m\"!", true, true, 0);
$this->map = false;
}else{
$this->map->loadMap();
}
}else{
console("[INFO] Time: \x1b[36m".$this->time."\x1b[0m");
console("[INFO] Seed: \x1b[36m".$this->seed."\x1b[0m");
console("[INFO] Gamemode: \x1b[36m".($this->gamemode === 0 ? "survival":"creative")."\x1b[0m");
}
}
public function loadEntities(){
if($this->map !== false){
console("[INFO] Loading entities...");
$entities = unserialize(file_get_contents($this->mapDir."entities.dat"));
if($entities === false or !is_array($entities)){
console("[ERROR] Invalid world data for \"".$this->mapDir."\. Please import the world correctly");
$this->close("invalid world data");
}
foreach($entities as $entity){
if(!isset($entity["id"])){
break;
}
if(isset($this->api) and $this->api !== false){
if($entity["id"] === 64){ //Item Drop
$e = $this->api->entity->add(ENTITY_ITEM, $entity["Item"]["id"], array(
"meta" => $entity["Item"]["Damage"],
"stack" => $entity["Item"]["Count"],
"x" => $entity["Pos"][0],
"y" => $entity["Pos"][1],
"z" => $entity["Pos"][2],
"yaw" => $entity["Rotation"][0],
"pitch" => $entity["Rotation"][1],
));
}else{
$e = $this->api->entity->add(ENTITY_MOB, $entity["id"]);
$e->setPosition($entity["Pos"][0], $entity["Pos"][1], $entity["Pos"][2], $entity["Rotation"][0], $entity["Rotation"][1]);
$e->setHealth($entity["Health"]);
}
}
}
console("[DEBUG] Loaded ".count($this->entities)." Entities", true, true, 2);
$this->action(1000000 * 60 * 15, '$this->api->chat->broadcast("Forcing save...");$this->save();');
}
}
public function save($final = false){
if($this->mapName !== false){
$this->levelData["Time"] = $this->time;
file_put_contents($this->mapDir."level.dat", serialize($this->levelData));
$this->map->saveMap($final);
console("[INFO] Saving entities...");
foreach($this->entities as $entity){
}
$this->trigger("server.save", $final);
}
}
public function init(){
if($this->mapName !== false and $this->map === false){
$this->loadMap();
$this->loadEntities();
}
console("[INFO] Loading events...");
$this->loadEvents();
//$this->ticker = new TickLoop($this);
//$this->ticker->start();
declare(ticks=15);
register_tick_function(array($this, "tick"));
register_shutdown_function(array($this, "dumpError"));
register_shutdown_function(array($this, "close"));
if(function_exists("pcntl_signal")){
pcntl_signal(SIGTERM, array($this, "close"));
pcntl_signal(SIGINT, array($this, "close"));
pcntl_signal(SIGHUP, array($this, "close"));
}
$this->trigger("server.start", microtime(true));
console("[INFO] Server started!");
$this->process();
}
public function dumpError(){
console("[ERROR] An Unrecovereable has ocurred and the server has Crashed. Creating an Error Dump");
$dump = "# PocketMine-MP Error Dump ".date("D M j H:i:s T Y")."\r\n";
$dump .= "Error: ".var_export(error_get_last(), true)."\r\n\r\n";
$version = new VersionString();
$dump .= "PM Version: ".$version." #".$version->getNumber()." [Protocol ".CURRENT_PROTOCOL."]\r\n";
$dump .= "uname -a: ".php_uname("a")."\r\n";
$dump .= "PHP Version: " .phpversion()."\r\n";
$dump .= "Zend version: ".zend_version()."\r\n";
$dump .= "OS : " .PHP_OS.", ".Utils::getOS()."\r\n";
$dump .= "Debug Info: ".var_export($this->debugInfo(false), true)."\r\n\r\n\r\n";
global $arguments;
$dump .= "Parameters: ".var_export($arguments, true)."\r\n\r\n\r\n";
$dump .= "server.properties: ".var_export($this->api->getProperties(), true)."\r\n\r\n\r\n";
global $lasttrace;
$dump .= "Last Backtrace: ".$lasttrace."\r\n\r\n\r\n";
$dump .= "Loaded Modules: ".var_export(get_loaded_extensions(), true)."\r\n\r\n";
$name = "error_dump_".time();
logg($dump, $name, true, 0, true);
console("[ERROR] Please submit the \"logs/{$name}.log\" file to the Bug Reporting page. Give as much info as you can.", true, true, 0);
}
public function tick(){
/*if($this->ticker->tick === true and $this->ticker->isWaiting() === true){
$this->ticker->tick = false;
$time = microtime(true);
array_shift($this->tickMeasure);
$this->tickMeasure[] = $this->lastTick = $time;
$this->tickerFunction($time);
$this->trigger("server.tick", $time);
$this->ticker->notify();
}*/
$time = microtime(true);
if($this->lastTick <= ($time - 0.05)){
array_shift($this->tickMeasure);
$this->tickMeasure[] = $this->lastTick = $time;
$this->tickerFunction($time);
$this->trigger("server.tick", $time);
}
}
public function clientID($ip, $port){
return md5($ip . $port, true);
}
public function packetHandler($packet){
$data =& $packet["data"];
$CID = $this->clientID($packet["ip"], $packet["port"]);
if(isset($this->clients[$CID])){
$this->clients[$CID]->handle($packet["pid"], $data);
}else{
if($this->handle("server.noauthpacket", $packet) === false){
return;
}
switch($packet["pid"]){
case 0x02:
if($this->invisible === true){
$this->send(0x1c, array(
$data[0],
$this->serverID,
MAGIC,
$this->serverType,
), false, $packet["ip"], $packet["port"]);
break;
}
if($this->api->ban->isIPBanned($packet["ip"])){
$this->send(0x1c, array(
$data[0],
$this->serverID,
MAGIC,
$this->serverType. $this->name . " [You're banned]",
), false, $packet["ip"], $packet["port"]);
break;
}
if(!isset($this->custom["times_".$CID])){
$this->custom["times_".$CID] = 0;
}
$ln = 15;
$this->description .= " ";
$txt = substr($this->description, $this->custom["times_".$CID], $ln);
$txt .= substr($this->description, 0, $ln - strlen($txt));
$this->send(0x1c, array(
$data[0],
$this->serverID,
MAGIC,
$this->serverType. $this->name . " [".($this->gamemode === 1 ? "C":"S").($this->whitelist !== false ? "W":"")." ".count($this->clients)."/".$this->maxClients."] ".$txt,
), false, $packet["ip"], $packet["port"]);
$this->custom["times_".$CID] = ($this->custom["times_".$CID] + 1) % strlen($this->description);
break;
case 0x05:
if($this->api->ban->isIPBanned($packet["ip"]) or count($this->clients) >= $this->maxClients){
$this->send(0x80, array(
0,
0x00,
array(
"id" => MC_LOGIN_STATUS,
"status" => 1,
),
), false, $packet["ip"], $packet["port"]);
$this->send(0x80, array(
1,
0x00,
array(
"id" => MC_DISCONNECT,
),
), false, $packet["ip"], $packet["port"]);
break;
}
$version = $data[1];
$size = strlen($data[2]);
if($version !== CURRENT_PROTOCOL){
$this->send(0x1a, array(
CURRENT_PROTOCOL,
MAGIC,
$this->serverID,
), false, $packet["ip"], $packet["port"]);
}else{
$this->send(0x06, array(
MAGIC,
$this->serverID,
0,
strlen($packet["raw"]),
), false, $packet["ip"], $packet["port"]);
}
break;
case 0x07:
if($this->api->ban->isIPBanned($packet["ip"]) or count($this->clients) >= $this->maxClients){
$this->send(0x80, array(
0,
0x00,
array(
"id" => MC_LOGIN_STATUS,
"status" => 1,
),
), false, $packet["ip"], $packet["port"]);
$this->send(0x80, array(
1,
0x00,
array(
"id" => MC_DISCONNECT,
),
), false, $packet["ip"], $packet["port"]);
break;
}
$port = $data[2];
$MTU = $data[3];
$clientID = $data[4];
$this->clients[$CID] = new Player($this, $clientID, $packet["ip"], $packet["port"], $MTU); //New Session!
$this->clients[$CID]->handle(0x07, $data);
break;
}
}
}
public function send($pid, $data = array(), $raw = false, $dest = false, $port = false){
$this->interface->writePacket($pid, $data, $raw, $dest, $port);
}
public function process(){
while($this->stop === false){
$packet = $this->interface->readPacket();
if($packet !== false){
$this->packetHandler($packet);
}else{
usleep(1);
}
}
}
public function trigger($event, $data = ""){
$this->preparedSQL->selectEvents->reset();
$this->preparedSQL->selectEvents->clear();
$this->preparedSQL->selectEvents->bindValue(":name", $event, SQLITE3_TEXT);
$events = $this->preparedSQL->selectEvents->execute();
if($events === false or $events === true){
return;
}
$call = array();
while(($evn = $events->fetchArray(SQLITE3_ASSOC)) !== false){
$call[(int) $evn["ID"]] = true;
}
$events->finalize();
if(count($call) > 0){
foreach($call as $evid => $boolean){
$ev = $this->events[$evid];
if(!is_callable($ev)){
$this->deleteEvent($evid);
continue;
}
if(is_array($ev)){
$method = $ev[1];
$ev[0]->$method($data, $event);
}else{
$ev($data, $event);
}
}
}elseif(isset(Deprecation::$events[$event])){
$sub = "";
if(Deprecation::$events[$event] !== false){
$sub = " Substitute \"".Deprecation::$events[$event]."\" found.";
}
console("[ERROR] Event \"$event\" has been deprecated.$sub [Trigger]");
}
return true;
}
public function schedule($ticks, $callback, $data = array(), $repeat = false, $eventName = "server.schedule"){
if(!is_callable($callback)){
return false;
}
$add = "";
$chcnt = $this->scheduleCnt++;
if($repeat === false){
$add = ' unset($this->schedule['.$chcnt.']);';
}
$this->schedule[$chcnt] = array($callback, $data, $eventName);
$this->action(50000 * $ticks, '$schedule = $this->schedule['.$chcnt.'];'.$add.'if(!is_callable($schedule[0])){unset($this->schedule['.$chcnt.']);return false;} return call_user_func($schedule[0], $schedule[1], $schedule[2]);', (bool) $repeat);
return $chcnt;
}
public function action($microseconds, $code, $repeat = true){
$this->query("INSERT INTO actions (interval, last, code, repeat) VALUES(".($microseconds / 1000000).", ".microtime(true).", '".base64_encode($code)."', ".($repeat === true ? 1:0).");");
console("[INTERNAL] Attached to action ".$microseconds, true, true, 3);
}
public function tickerFunction($time){
//actions that repeat every x time will go here
$this->preparedSQL->selectActions->reset();
$this->preparedSQL->selectActions->clear();
$this->preparedSQL->selectActions->bindValue(":time", $time, SQLITE3_FLOAT);
$actions = $this->preparedSQL->selectActions->execute();
if($actions === false or $actions === true){
return;
}
while(($action = $actions->fetchArray(SQLITE3_ASSOC)) !== false){
$return = eval(base64_decode($action["code"]));
if($action["repeat"] === 0 or $return === false){
$this->query("DELETE FROM actions WHERE ID = ".$action["ID"].";");
}
}
$actions->finalize();
$this->preparedSQL->updateActions->reset();
$this->preparedSQL->updateActions->clear();
$this->preparedSQL->updateActions->bindValue(":time", $time, SQLITE3_FLOAT);
$this->preparedSQL->updateActions->execute();
}
public function event($event, $func){
if(!is_callable($func)){
return false;
}elseif(isset(Deprecation::$events[$event])){
$sub = "";
if(Deprecation::$events[$event] !== false){
$sub = " Substitute \"".Deprecation::$events[$event]."\" found.";
}
console("[ERROR] Event \"$event\" has been deprecated.$sub [Attach to ".(is_array($func) ? get_class($func[0])."::".$func[1]:$func)."]");
}
$evid = $this->evCnt++;
$this->events[$evid] = $func;
$this->query("INSERT INTO events (ID, name) VALUES (".$evid.", '".str_replace("'", "\\'", $event)."');");
console("[INTERNAL] Attached ".(is_array($func) ? get_class($func[0])."::".$func[1]:$func)." to event ".$event." (ID ".$evid.")", true, true, 3);
return $evid;
}
public function deleteEvent($id){
$id = (int) $id;
unset($this->events[$id]);
$this->query("DELETE FROM events WHERE ID = ".$id.";");
}
}

View File

@ -1,38 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Sapling{
const OAK = 0;
const SPRUCE = 1;
const BIRCH = 2;
const BURN_TIME = 5;
public static function growTree(LevelAPI $level, $block, $type){
$type = $type & 0x03;
TreeObject::growTree($level, $block, $type);
}
}

View File

@ -1,49 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Item{
public $id;
protected $maxStackSize = 64;
private $durability = 0;
private $name = "Unknown";
public function __construct($id){
$this->id = (int) $id;
}
public function setMaxStackSize($size = 64){
$this->maxStackSize = (int) $size;
}
public function getDestroySpeed(Item $item, Entity $entity){
return 1;
}
public function getMaxStackSize(){
return $this->maxStackSize;
}
}

View File

@ -1,39 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
define("WINDOW_CHEST", 0);
define("WINDOW_WORKBENCH", 1);
define("WINDOW_FURNACE", 2);
class Window{
private $server;
public function __construct(PocketMinecraftServer $server){
}
}
?>

View File

@ -1,110 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Vector2{
public $x, $y;
public function __construct($x = 0, $y = 0){
if(($x instanceof Vector2) === true){
$this->__construct($x->x, $x->y);
}else{
$this->x = $x;
$this->y = $y;
}
}
public function getX(){
return $this->x;
}
public function getY(){
return $this->y;
}
public function getFloorX(){
return (int) $this->x;
}
public function getFloorY(){
return (int) $this->y;
}
public function add($x = 0, $y = 0){
if(($x instanceof Vector2) === true){
return $this->add($x->x, $x->y);
}else{
$this->x += $x;
$this->y += $y;
return new Vector3($this->x + $x, $this->y + $y);
}
}
public function subtract($x = 0, $y = 0){
if(($x instanceof Vector2) === true){
return $this->add(-$x->x, -$x->y);
}else{
return $this->add(-$x, -$y);
}
}
public function ceil(){
return new Vector2((int) ($this->x + 1), (int) ($this->y + 1));
}
public function floor(){
return new Vector2((int) $this->x, (int) $this->y);
}
public function round(){
return new Vector2(round($this->x), round($this->y));
}
public function abs(){
return new Vector2(abs($this->x), abs($this->y));
}
public function distance($x = 0, $y = 0){
if(($x instanceof Vector2) === true){
return sqrt($this->distanceSquared($x->x, $x->y));
}else{
return sqrt($this->distanceSquared($x, $y));
}
}
public function distanceSquared($x = 0, $y = 0){
if(($x instanceof Vector2) === true){
return $this->distanceSquared($x->x, $x->y);
}else{
return pow($this->x - $x, 2) + pow($this->y - $y, 2);
}
}
public function __toString(){
return "Vector2(x=".$this->x.",y=".$this->y.")";
}
}

View File

@ -1,167 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Vector3{
public $x, $y, $z;
public function __construct($x = 0, $y = 0, $z = 0){
if(($x instanceof Vector3) === true){
$this->__construct($x->x, $x->y, $x->z);
}else{
$this->x = $x;
$this->y = $y;
$this->z = $z;
}
}
public function getX(){
return $this->x;
}
public function getY(){
return $this->y;
}
public function getZ(){
return $this->z;
}
public function getFloorX(){
return (int) $this->x;
}
public function getFloorY(){
return (int) $this->y;
}
public function getFloorZ(){
return (int) $this->z;
}
public function getRight(){
return $this->getX();
}
public function getUp(){
return $this->getY();
}
public function getForward(){
return $this->getZ();
}
public function getSouth(){
return $this->getX();
}
public function getWest(){
return $this->getZ();
}
public function add($x = 0, $y = 0, $z = 0){
if(($x instanceof Vector3) === true){
return $this->add($x->x, $x->y, $x->z);
}else{
$this->x += $x;
$this->y += $y;
$this->z += $z;
return new Vector3($this->x + $x, $this->y + $y, $this->z + $z);
}
}
public function subtract($x = 0, $y = 0, $z = 0){
if(($x instanceof Vector3) === true){
return $this->add(-$x->x, -$x->y, -$x->z);
}else{
return $this->add(-$x, -$y, -$z);
}
}
public function ceil(){
return new Vector3((int) ($this->x + 1), (int) ($this->y + 1), (int) ($this->z + 1));
}
public function floor(){
return new Vector3((int) $this->x, (int) $this->y, (int) $this->z);
}
public function round(){
return new Vector3(round($this->x), round($this->y), round($this->z));
}
public function abs(){
return new Vector3(abs($this->x), abs($this->y), abs($this->z));
}
public function getSide($side){
switch((int) $side){
case 0:
return new Vector3($this->x, $this->y - 1, $this->z);
case 1:
return new Vector3($this->x, $this->y + 1, $this->z);
case 2:
return new Vector3($this->x, $this->y, $this->z - 1);
case 3:
return new Vector3($this->x, $this->y, $this->z + 1);
case 4:
return new Vector3($this->x - 1, $this->y, $this->z);
case 5:
return new Vector3($this->x + 1, $this->y, $this->z);
default:
return $this;
}
}
public function distance($x = 0, $y = 0, $z = 0){
if(($x instanceof Vector3) === true){
return sqrt($this->distanceSquared($x->x, $x->y, $x->z));
}else{
return sqrt($this->distanceSquared($x, $y, $z));
}
}
public function distanceSquared($x = 0, $y = 0, $z = 0){
if(($x instanceof Vector3) === true){
return $this->distanceSquared($x->x, $x->y, $x->z);
}else{
return pow($this->x - $x, 2) + pow($this->y - $y, 2) + pow($this->z - $z, 2);
}
}
public function maxPlainDistance($x = 0, $z = 0){
if(($x instanceof Vector3) === true){
return $this->maxPlainDistance($x->x, $x->z);
}else{
return max(abs($this->x - $x), abs($this->z - $z));
}
}
public function __toString(){
return "Vector3(x=".$this->x.",y=".$this->y.",z=".$this->z.")";
}
}

View File

@ -1,615 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class CustomPacketHandler{
var $offset, $raw, $c, $data, $name = "";
private function get($len = true, $check = true){
if($len === true){
$data = substr($this->raw, $this->offset);
if($check === true){
$this->offset = strlen($this->raw);
}
return $data;
}
$data = substr($this->raw, $this->offset, $len);
if($check === true){
$this->offset += $len;
}
return $data;
}
public function __construct($pid, $raw = "", $data = array(), $create = false){
$this->raw = $raw;
$this->data = $data;
$this->offset = 0;
$this->c = (bool) $create;
switch($pid){
case MC_KEEP_ALIVE:
if($this->c === false){
$this->data["payload"] = Utils::readLong($this->get(8));
}else{
$this->raw .= Utils::writeLong($this->data["payload"]);
}
break;
case 0x03:
if($this->c === false){
$this->data["unknown1"] = Utils::readLong($this->get(8));
$this->data["unknown2"] = Utils::readLong($this->get(8));
}else{
$this->raw .= Utils::writeLong($this->data["unknown1"]);
$this->raw .= Utils::writeLong($this->data["unknown2"]);
}
break;
case MC_CLIENT_CONNECT:
if($this->c === false){
$this->data["clientID"] = Utils::readLong($this->get(8));
$this->data["session"] = Utils::readLong($this->get(8));
$this->data["unknown2"] = $this->get(1);
}else{
$this->raw .= Utils::writeLong($this->data["clientID"]);
$this->raw .= Utils::writeLong($this->data["session"]);
$this->raw .= "\x00";
}
break;
case MC_SERVER_HANDSHAKE:
if($this->c === false){
$this->data["cookie"] = $this->get(4); // 043f57fe
$this->data["security"] = $this->get(1);
$this->data["port"] = Utils::readShort($this->get(2), false);
$this->data["dataArray"] = Utils::readDataArray($this->get(true, false), 10, $offset);
$this->get($offset);
$this->data["unknown1"] = $this->get(2);
$this->data["session"] = Utils::readLong($this->get(8));
$this->data["session2"] = Utils::readLong($this->get(8));
}else{
$this->raw .= "\x04\x3f\x57\xfe";
$this->raw .= "\xcd";
$this->raw .= Utils::writeShort($this->data["port"]);
$this->raw .= Utils::writeDataArray(array(
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
"\xff\xff\xff\xff",
));
$this->raw .= "\x00\x00";
$this->raw .= Utils::writeLong($this->data["session"]);
$this->raw .= Utils::writeLong($this->data["session2"]);
}
break;
case MC_CLIENT_HANDSHAKE:
if($this->c === false){
$this->data["cookie"] = $this->get(4); // 043f57fe
$this->data["security"] = $this->get(1);
$this->data["port"] = Utils::readShort($this->get(2), false);
$this->data["dataArray0"] = $this->get(ord($this->get(1)));
$this->data["dataArray"] = Utils::readDataArray($this->get(true, false), 9, $offset);
$this->get($offset);
$this->data["unknown1"] = $this->get(2);
$this->data["session2"] = Utils::readLong($this->get(8));
$this->data["session"] = Utils::readLong($this->get(8));
}else{
$this->raw .= "\x04\x3f\x57\xfe";
$this->raw .= "\xed";
$this->raw .= Utils::writeShort($this->data["port"]);
$w = array_shift($this->data["dataArray"]);
$this->raw .= chr(strlen($w)).$w;
$this->raw .= Utils::writeDataArray($this->data["dataArray"]);
$this->raw .= "\x00\x00";
$this->raw .= Utils::writeLong($this->data["session2"]);
$this->raw .= Utils::writeLong($this->data["session"]);
}
break;
case MC_DISCONNECT:
//null
break;
case 0x18:
//null
break;
case MC_LOGIN:
if($this->c === false){
$this->data["username"] = $this->get(Utils::readShort($this->get(2), false));
$this->data["maxX"] = Utils::readInt($this->get(4));
$this->data["maxY"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeShort(strlen($this->data["username"])).$this->data["username"];
$this->raw .= "\x00\x00\x00\x08\x00\x00\x00\x08";
}
break;
case MC_LOGIN_STATUS:
if($this->c === false){
$this->data["status"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["status"]);
}
break;
case MC_READY:
if($this->c === false){
$this->data["status"] = ord($this->get(1));
}else{
$this->raw .= chr($this->data["status"]);
}
break;
case MC_CHAT:
if($this->c === false){
$this->data["message"] = $this->get(Utils::readShort($this->get(2), false));
}else{
$this->raw .= Utils::writeShort(strlen($this->data["message"])).$this->data["message"];
}
break;
case MC_SET_TIME:
if($this->c === false){
$this->data["time"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["time"]);
}
break;
case MC_START_GAME:
if($this->c === false){
$this->data["seed"] = Utils::readInt($this->get(4));
$this->data["unknown1"] = Utils::readInt($this->get(4));
$this->data["gamemode"] = Utils::readInt($this->get(4));
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["seed"]);
$this->raw .= Utils::writeInt($this->data["unknown1"]);
$this->raw .= Utils::writeInt($this->data["gamemode"]);
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
}
break;
case MC_ADD_MOB:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["type"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["metadata"] = Utils::readMetadata($this->get(true));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeInt($this->data["type"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeMetadata(array(
1 => array("type" => 1, "value" => 300),
16 => array("type" => 0, "value" => 0),
17 => array("type" => 6, "value" => array(0, 0, 0)),
));
}
break;
case MC_ADD_PLAYER:
if($this->c === false){
$this->data["clientID"] = Utils::readLong($this->get(8));
$this->data["username"] = $this->get(Utils::readShort($this->get(2), false));
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["metadata"] = Utils::readMetadata($this->get(true));
}else{
$this->raw .= Utils::writeLong($this->data["clientID"]);
$this->raw .= Utils::writeShort(strlen($this->data["username"])).$this->data["username"];
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeMetadata(array(
1 => array("type" => 1, "value" => 300),
16 => array("type" => 0, "value" => 0),
17 => array("type" => 6, "value" => array(0, 0, 0)),
));
}
break;
case MC_ADD_ENTITY:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["type"] = ord($this->get(1));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= chr($this->data["type"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::hexToStr("000000020000ffd30000");//Utils::writeInt(0);
/*$this->raw .= Utils::writeShort(0);
$this->raw .= Utils::writeShort(0);
$this->raw .= Utils::writeShort(0);*/
}
break;
case MC_REMOVE_ENTITY:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
}
break;
case MC_ADD_ITEM_ENTITY:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["block"] = Utils::readShort($this->get(2), false);
$this->data["stack"] = ord($this->get(1));
$this->data["meta"] = Utils::readShort($this->get(2), false);
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["yaw"] = Utils::readByte($this->get(1));
$this->data["pitch"] = Utils::readByte($this->get(1));
$this->data["roll"] = Utils::readByte($this->get(1));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeShort($this->data["block"]);
$this->raw .= chr($this->data["stack"]);
$this->raw .= Utils::writeShort($this->data["meta"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeByte($this->data["yaw"]);
$this->raw .= Utils::writeByte($this->data["pitch"]);
$this->raw .= Utils::writeByte($this->data["roll"]);
}
break;
case MC_TAKE_ITEM_ENTITY:
if($this->c === false){
$this->data["target"] = Utils::readInt($this->get(4));
$this->data["eid"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["target"]);
$this->raw .= Utils::writeInt($this->data["eid"]);
}
break;
case MC_MOVE_ENTITY:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
}
break;
case MC_MOVE_ENTITY_POSROT:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["yaw"] = Utils::readFloat($this->get(4));
$this->data["pitch"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeFloat($this->data["yaw"]);
$this->raw .= Utils::writeFloat($this->data["pitch"]);
}
break;
case MC_MOVE_PLAYER:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["yaw"] = Utils::readFloat($this->get(4));
$this->data["pitch"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeFloat($this->data["yaw"]);
$this->raw .= Utils::writeFloat($this->data["pitch"]);
}
break;
case MC_PLACE_BLOCK:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["y"] = ord($this->get(1));
$this->data["block"] = ord($this->get(1));
$this->data["meta"] = ord($this->get(1));
$this->data["face"] = Utils::readByte($this->get(1));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
$this->raw .= chr($this->data["y"]);
$this->raw .= chr($this->data["block"]);
$this->raw .= chr($this->data["meta"]);
$this->raw .= chr($this->data["face"]);
}
break;
case MC_REMOVE_BLOCK:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["y"] = ord($this->get(1));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
$this->raw .= chr($this->data["y"]);
}
break;
case MC_UPDATE_BLOCK:
if($this->c === false){
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["y"] = ord($this->get(1));
$this->data["block"] = ord($this->get(1));
$this->data["meta"] = ord($this->get(1));
}else{
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
$this->raw .= chr($this->data["y"]);
$this->raw .= chr($this->data["block"]);
$this->raw .= chr($this->data["meta"]);
}
break;
case MC_EXPLOSION:
if($this->c === false){
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
$this->data["radius"] = Utils::readFloat($this->get(4));
$this->data["count"] = Utils::readInt($this->get(4));
$this->data["records"] = array();
for($r = 0; $r < $this->data["count"]; ++$r){
$this->data["records"][] = array(Utils::readByte($this->get(1)), Utils::readByte($this->get(1)), Utils::readByte($this->get(1)));
}
}else{
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
$this->raw .= Utils::writeFloat($this->data["radius"]);
$this->data["records"] = (array) $this->data["records"];
$this->raw .= Utils::writeInt(count($this->data["records"]));
if(count($this->data["records"]) > 0){
foreach($this->data["records"] as $record){
$this->raw .= Utils::writeByte($record[0]) . Utils::writeByte($record[1]) . Utils::writeByte($record[2]);
}
}
}
break;
case MC_REQUEST_CHUNK:
if($this->c === false){
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
}
break;
case MC_CHUNK_DATA:
if($this->c === false){
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["data"] = $this->get(true);
}else{
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
$this->raw .= $this->data["data"];
}
break;
case MC_PLAYER_EQUIPMENT:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["block"] = Utils::readShort($this->get(2), false);
$this->data["meta"] = Utils::readShort($this->get(2), false);
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeShort($this->data["block"]);
$this->raw .= Utils::writeShort($this->data["meta"]);
}
break;
case MC_INTERACT:
if($this->c === false){
$this->data["action"] = Utils::readByte($this->get(1));
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["target"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeByte($this->data["action"]);
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeInt($this->data["target"]);
}
break;
case MC_USE_ITEM:
if($this->c === false){
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["y"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["face"] = Utils::readInt($this->get(4));
$this->data["block"] = Utils::readShort($this->get(2));
$this->data["meta"] = Utils::readByte($this->get(1));
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["fx"] = Utils::readFloat($this->get(4));
$this->data["fy"] = Utils::readFloat($this->get(4));
$this->data["fz"] = Utils::readFloat($this->get(4));
}else{
/*$this->raw .= Utils::writeByte($this->data["action"]);
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeInt($this->data["target"]);*/
}
break;
case MC_SET_ENTITY_DATA:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeMetadata(array(
));
}
break;
case MC_SET_HEALTH:
if($this->c === false){
$this->data["health"] = Utils::readByte($this->get(1));
}else{
$this->raw .= Utils::writeByte($this->data["health"]);
}
break;
case MC_ANIMATE:
if($this->c === false){
$this->data["action"] = Utils::readByte($this->get(1));
$this->data["eid"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeByte($this->data["action"]);
$this->raw .= Utils::writeInt($this->data["eid"]);
}
break;
case MC_RESPAWN:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readFloat($this->get(4));
$this->data["y"] = Utils::readFloat($this->get(4));
$this->data["z"] = Utils::readFloat($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= Utils::writeFloat($this->data["x"]);
$this->raw .= Utils::writeFloat($this->data["y"]);
$this->raw .= Utils::writeFloat($this->data["z"]);
}
break;
case MC_DROP_ITEM:
if($this->c === false){
$this->data["eid"] = Utils::readInt($this->get(4));
$this->data["unknown1"] = ord($this->get(1));
$this->data["block"] = Utils::readShort($this->get(2), false);
$this->data["stack"] = ord($this->get(1));
$this->data["meta"] = Utils::readShort($this->get(2), false);
}else{
$this->raw .= Utils::writeInt($this->data["eid"]);
$this->raw .= chr($this->data["unknown1"]);
$this->raw .= Utils::writeShort($this->data["block"]);
$this->raw .= chr($this->data["stack"]);
$this->raw .= Utils::writeShort($this->data["meta"]);
}
break;
case MC_CONTAINER_OPEN:
if($this->c === false){
$this->data["windowid"] = ord($this->get(1));
$this->data["type"] = ord($this->get(1));
$this->data["slots"] = Utils::readShort($this->get(2), false);
$this->data["title"] = $this->get(Utils::readShort($this->get(2), false));
}else{
$this->raw .= chr($this->data["windowid"]);
$this->raw .= chr($this->data["type"]);
$this->raw .= Utils::writeShort($this->data["slots"]);
$this->raw .= Utils::writeShort(strlen($this->data["title"])).$this->data["title"];
}
break;
case MC_CONTAINER_CLOSE:
if($this->c === false){
$this->data["windowid"] = ord($this->get(1));
}else{
$this->raw .= chr($this->data["windowid"]);
}
break;
case MC_CONTAINER_SET_SLOT:
if($this->c === false){
$this->data["windowid"] = ord($this->get(1));
$this->data["slot"] = Utils::readShort($this->get(2), false);
$this->data["block"] = Utils::readShort($this->get(2), false);
$this->data["stack"] = ord($this->get(1));
$this->data["meta"] = Utils::readShort($this->get(2), false);
}else{
$this->raw .= chr($this->data["windowid"]);
$this->raw .= Utils::writeShort($this->data["slot"]);
$this->raw .= Utils::writeShort($this->data["block"]);
$this->raw .= chr($this->data["stack"]);
$this->raw .= Utils::writeShort($this->data["meta"]);
}
break;
case MC_CLIENT_MESSAGE:
if($this->c === false){
$this->data["message"] = $this->get(Utils::readShort($this->get(2), false));
}else{
$this->raw .= Utils::writeShort(strlen($this->data["message"])).$this->data["message"];
}
break;
case MC_SIGN_UPDATE:
if($this->c === false){
$this->data["x"] = Utils::readShort($this->get(2));
$this->data["y"] = ord($this->get(1));
$this->data["z"] = Utils::readShort($this->get(2));
for($i = 0; $i < 4; ++$i){
$this->data["line$i"] = $this->get(Utils::readLShort($this->get(2), false));
}
}else{
$this->raw .= Utils::writeShort($this->data["x"]);
$this->raw .= chr($this->data["y"]);
$this->raw .= Utils::writeShort($this->data["z"]);
for($i = 0; $i < 4; ++$i){
$this->raw .= Utils::writeLShort(strlen($this->data["line$i"])).$this->data["line$i"];
}
}
break;
case MC_ADVENTURE_SETTINGS:
if($this->c === false){
$this->data["x"] = Utils::readShort($this->get(2));
$this->data["y"] = ord($this->get(1));
$this->data["z"] = Utils::readShort($this->get(2));
for($i = 0; $i < 4; ++$i){
$this->data["line$i"] = $this->get(Utils::readLShort($this->get(2), false));
}
}else{
$this->raw .= $this->data["unknown1"];
$this->raw .= $this->data["unknown2"];
}
break;
default:
if($this->c === false){
console("[DEBUG] Received unknown Data Packet ID 0x".dechex($pid), true, true, 2);
}else{
console("[DEBUG] Sent unknown Data Packet ID 0x".dechex($pid), true, true, 2);
}
break;
}
}
}

View File

@ -1,136 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class MinecraftInterface{
var $pstruct;
var $name;
var $client;
var $dataName;
private $socket;
private $data;
function __construct($server, $port = 25565, $listen = false, $client = true){
$this->socket = new UDPSocket($server, $port, (bool) $listen);
require("protocol/RakNet.php");
require("protocol/packetName.php");
require("protocol/current.php");
require("protocol/dataName.php");
$this->pstruct = $pstruct;
$this->name = $packetName;
$this->dataName = $dataName;
$this->client = (bool) $client;
$this->start = microtime(true);
}
public function close(){
return $this->socket->close(false);
}
protected function getStruct($pid){
if(isset($this->pstruct[$pid])){
return $this->pstruct[$pid];
}
return false;
}
protected function writeDump($pid, $raw, $data, $origin = "client", $ip = "", $port = 0){
if(LOG === true and DEBUG >= 3){
$p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: ".(isset($data["id"]) ? "MC Packet ".$this->dataName[$pid]:$this->name[$pid])." (0x".Utils::strTohex(chr($pid)).") [length ".strlen($raw)."]".PHP_EOL;
$p .= Utils::hexdump($raw);
if(is_array($data)){
foreach($data as $i => $d){
$p .= $i ." => ".(!is_array($d) ? $this->pstruct[$pid][$i]."(".(($this->pstruct[$pid][$i] === "magic" or substr($this->pstruct[$pid][$i], 0, 7) === "special" or is_int($this->pstruct[$pid][$i])) ? Utils::strToHex($d):Utils::printable($d)).")":$this->pstruct[$pid][$i]."(\"".serialize(array_map("Utils::printable", $d))."\")").PHP_EOL;
}
}
$p .= PHP_EOL;
logg($p, "packets", false);
}
}
public function readPacket(){
$p = $this->popPacket();
if($p !== false){
return $p;
}
if($this->socket->connected === false){
return false;
}
$data = $this->socket->read();
if($data[3] === false){
return false;
}
$pid = ord($data[0]);
$struct = $this->getStruct($pid);
if($struct === false){
console("[ERROR] Unknown Packet ID 0x".Utils::strToHex(chr($pid)), true, true, 0);
$p = "[".(microtime(true) - $this->start)."] [".((($origin === "client" and $this->client === true) or ($origin === "server" and $this->client === false)) ? "CLIENT->SERVER":"SERVER->CLIENT")." ".$ip.":".$port."]: Error, bad packet id 0x".Utils::strTohex(chr($pid))." [length ".strlen($raw)."]".PHP_EOL;
$p .= Utils::hexdump($data[0]);
$p .= PHP_EOL;
logg($p, "packets", true, 2);
return false;
}
$packet = new Packet($pid, $struct, $data[0]);
@$packet->parse();
$this->data[] = array($pid, $packet->data, $data[0], $data[1], $data[2]);
return $this->popPacket();
}
public function popPacket(){
if(count($this->data) > 0){
$p = array_shift($this->data);
if(isset($p[1]["packets"]) and is_array($p[1]["packets"])){
foreach($p[1]["packets"] as $d){
$this->data[] = array($p[0], $d[1], $d[2], $p[3], $p[4]);
}
}
$c = (isset($p[1]["id"]) ? true:false);
$p[2] = $c ? chr($p[1]["id"]).$p[2]:$p[2];
$this->writeDump(($c ? $p[1]["id"]:$p[0]), $p[2], $p[1], "server", $p[3], $p[4]);
return array("pid" => $p[0], "data" => $p[1], "raw" => $p[2], "ip" => $p[3], "port" => $p[4]);
}
return false;
}
public function writePacket($pid, $data = array(), $raw = false, $dest = false, $port = false){
$struct = $this->getStruct($pid);
if($raw === false){
$packet = new Packet($pid, $struct);
$packet->data = $data;
@$packet->create();
$write = $this->socket->write($packet->raw, $dest, $port);
$this->writeDump($pid, $packet->raw, $data, "client", $dest, $port);
}else{
$write = $this->socket->write($data, $dest, $port);
$this->writeDump($pid, $data, false, "client", $dest, $port);
}
return true;
}
}
?>

View File

@ -1,238 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Packet{
private $struct, $sock;
protected $pid, $packet;
public $data, $raw;
function __construct($pid, $struct, $data = ""){
$this->pid = $pid;
$this->offset = 1;
$this->raw = $data;
$this->data = array();
if($data === ""){
$this->addRaw(chr($pid));
}
$this->struct = $struct;
$this->sock = $sock;
}
public function create($raw = false){
foreach($this->struct as $field => $type){
if(!isset($this->data[$field])){
$this->data[$field] = "";
}
if($raw === true){
$this->addRaw($this->data[$field]);
continue;
}
if(is_int($type)){
$this->addRaw($this->data[$field]);
continue;
}
switch($type){
case "special1":
switch($this->pid){
case 0xc0:
case 0xa0:
if($this->data[1] === false){
$this->addRaw($this->data[$field]);
}
break;
case 0x05:
$this->addRaw($this->data[$field]);
break;
}
break;
case "customData":
switch($this->data[1]){
case 0x40:
$reply = new CustomPacketHandler($this->data[$field]["id"], "", $this->data[$field], true);
$this->addRaw(Utils::writeShort((strlen($reply->raw) + 1) << 3));
$this->addRaw(Utils::writeTriad(strrev($this->data[$field]["count"])));
$this->addRaw(chr($this->data[$field]["id"]));
$this->addRaw($reply->raw);
break;
case 0x00:
$reply = new CustomPacketHandler($this->data[$field]["id"], "", $this->data[$field], true);
$this->addRaw(Utils::writeShort((strlen($reply->raw) + 1) << 3));
$this->addRaw(chr($this->data[$field]["id"]));
$this->addRaw($reply->raw);
break;
}
break;
case "magic":
$this->addRaw(MAGIC);
break;
case "float":
$this->addRaw(Utils::writeFloat($this->data[$field]));
break;
case "triad":
$this->addRaw(Utils::writeTriad($this->data[$field]));
break;
case "itriad":
$this->addRaw(strrev(Utils::writeTriad($this->data[$field])));
break;
case "int":
$this->addRaw(Utils::writeInt($this->data[$field]));
break;
case "double":
$this->addRaw(Utils::writeDouble($this->data[$field]));
break;
case "long":
$this->addRaw(Utils::writeLong($this->data[$field]));
break;
case "bool":
case "boolean":
$this->addRaw(Utils::writeBool($this->data[$field]));
break;
case "ubyte":
case "byte":
$this->addRaw(Utils::writeByte($this->data[$field]));
break;
case "short":
$this->addRaw(Utils::writeShort($this->data[$field]));
break;
case "byteArray":
$this->addRaw($this->data[$field]);
break;
case "string":
$this->addRaw(Utils::writeShort(strlen($this->data[$field])));
$this->addRaw($this->data[$field]);
break;
case "slotData":
$this->addRaw(Utils::writeShort($this->data[$field][0]));
if($this->data[$field][0]!=-1){
$this->addRaw(Utils::writeByte($this->data[$field][1]));
$this->addRaw(Utils::writeShort($this->data[$field][2]));
}
break;
default:
$this->addRaw(Utils::writeByte($this->data[$field]));
break;
}
}
}
private function get($len = true){
if($len === true){
$data = substr($this->raw, $this->offset);
$this->offset = strlen($this->raw);
return $data;
}
$data = substr($this->raw, $this->offset, $len);
$this->offset += $len;
return $data;
}
protected function addRaw($str){
$this->raw .= $str;
return $str;
}
public function parse(){
$continue = true;
foreach($this->struct as $field => $type){
if(is_int($type)){
$this->data[] = $this->get($type);
continue;
}
switch($type){
case "special1":
switch($this->pid){
case 0xc0:
case 0xa0:
if($this->data[1] === false){
$this->data[] = $this->get(3);
}
break;
case 0x05:
$this->data[] = $this->get(true);
break;
}
break;
case "customData":
$d = new SerializedPacketHandler($this->data[1], $this->get(true));
if(isset($d->data["packets"])){
$this->data["packets"] = $d->data["packets"];
}else{
$this->data[] = $d->data;
}
break;
case "magic":
$this->data[] = $this->get(16);
break;
case "triad":
$this->data[] = Utils::readTriad($this->get(3));
break;
case "itriad":
$this->data[] = Utils::readTriad(strrev($this->get(3)));
break;
case "int":
$this->data[] = Utils::readInt($this->get(4));
break;
case "string":
$this->data[] = $this->get(Utils::readShort($this->get(2)));
break;
case "long":
$this->data[] = Utils::readLong($this->get(8));
break;
case "byte":
$this->data[] = Utils::readByte($this->get(1));
break;
case "ubyte":
$this->data[] = ord($this->get(1));
break;
case "float":
$this->data[] = Utils::readFloat($this->get(4));
break;
case "double":
$this->data[] = Utils::readDouble($this->get(8));
break;
case "ushort":
$this->data[] = Utils::readShort($this->get(2), false);
break;
case "short":
$this->data[] = Utils::readShort($this->get(2));
break;
case "bool":
case "boolean":
$this->data[] = Utils::readBool($this->get(1));
break;
}
if($continue === false){
break;
}
}
}
}

View File

@ -1,87 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class SerializedPacketHandler{
var $offset, $raw, $c, $data, $name = "";
private function get($len = true, $check = true){
if($len === true){
$data = substr($this->raw, $this->offset);
if($check === true){
$this->offset = strlen($this->raw);
}
return $data;
}
$data = substr($this->raw, $this->offset, $len);
if($check === true){
$this->offset += $len;
}
return $data;
}
public function __construct($pid, $raw = "", $data = array(), $create = false){
$this->raw = $raw;
$this->data = $data;
$this->offset = 0;
$this->c = (bool) $create;
switch($pid){
case 0x60:
case 0x40:
case 0x00:
if($this->c === false){
$this->data["packets"] = array();
$i = 0;
while($this->offset < strlen($this->raw)){
if($i > 0){
$pid = ord($this->get(1));
}
$len = ceil(Utils::readShort($this->get(2), false) / 8); //Utils::readShort($this->get(2), false) >> 3;
if($pid !== 0x00){
$c = Utils::readTriad(strrev($this->get(3)));
}
if($pid === 0x60 and $i === 0){
$this->data["unknown1"] = $this->get(4);
}
$id = ord($this->get(1));
$raw = $this->get($len - 1);
$pk = new CustomPacketHandler($id, $raw);
$pk->data["length"] = $len;
$pk->data["id"] = $id;
if($pid !== 0x00){
$pk->data["counter"] = $c;
}
$pk->data["packetName"] = $pk->name;
$this->data["packets"][] = array($pid, $pk->data, $raw);
++$i;
}
}
break;
}
}
}

View File

@ -1,92 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class UDPSocket{
private $encrypt;
var $buffer, $connected, $errors, $sock, $server;
function __construct($server, $port, $listen = false){
$this->errors = array_fill(88,(125 - 88) + 1, true);
$this->server = $server;
$this->port = $port;
$this->sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_set_option($this->sock, SOL_SOCKET, SO_BROADCAST, 1); //Allow sending broadcast messages
if($listen !== true){
$this->connected = true;
$this->buffer = array();
$this->unblock();
}else{
if(socket_bind($this->sock, "0.0.0.0", $port) === true){
$this->unblock();
}else{
console("[ERROR] Couldn't bind to 0.0.0.0:".$port, true, true, 0);
die();
}
}
}
public function listenSocket(){
$sock = @socket_accept($this->sock);
if($sock !== false){
$sock = new Socket(false, false, false, $sock);
$sock->unblock();
return $sock;
}
return false;
}
public function close($error = 125){
$this->connected = false;
if($error !== false){
console("[ERROR] [Socket] Socket closed, Error $error: ".socket_strerror($error));
}
return @socket_close($this->sock);
}
public function block(){
socket_set_block($this->sock);
}
public function unblock(){
socket_set_nonblock($this->sock);
}
public function read(){
$source = false;
$port = 1;
$len = @socket_recvfrom($this->sock, $buf, 65536, 0, $source, $port);
return array($buf, $source, $port, $len);
}
public function write($data, $dest = false, $port = false){
return @socket_sendto($this->sock, $data, strlen($data), 0, ($dest === false ? $this->server:$dest), ($port === false ? $this->port:$port));
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,231 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
define("CONFIG_DETECT", -1); //Detect by file extension
define("CONFIG_PROPERTIES", 0); // .properties
define("CONFIG_CNF", CONFIG_PROPERTIES); // .cnf
define("CONFIG_JSON", 1); // .js, .json
define("CONFIG_YAML", 2); // .yml, .yaml
//define("CONFIG_EXPORT", 3); // .export, .xport
define("CONFIG_SERIALIZED", 4); // .sl
define("CONFIG_LIST", 5); // .txt, .list
class Config{
private $config;
private $file;
private $correct;
private $type = CONFIG_DETECT;
public static $formats = array(
"properties" => CONFIG_PROPERTIES,
"cnf" => CONFIG_CNF,
"conf" => CONFIG_CNF,
"config" => CONFIG_CNF,
"json" => CONFIG_JSON,
"js" => CONFIG_JSON,
"yml" => CONFIG_YAML,
"yaml" => CONFIG_YAML,
//"export" => CONFIG_EXPORT,
//"xport" => CONFIG_EXPORT,
"sl" => CONFIG_SERIALIZED,
"serialize" => CONFIG_SERIALIZED,
"txt" => CONFIG_LIST,
"list" => CONFIG_LIST,
);
public function __construct($file, $type = CONFIG_DETECT, $default = array(), &$correct = null){
$this->load($file, $type, $default);
$correct = $this->check();
}
public function load($file, $type = CONFIG_DETECT, $default = array()){
$this->correct = true;
$this->type = (int) $type;
$this->file = $file;
if(!is_array($default)){
$default = array();
}
if(!file_exists($file)){
$this->config = $default;
}else{
if($this->type === CONFIG_DETECT){
$extension = explode(".", basename($this->file));
$extension = strtolower(trim(array_pop($extension)));
if(isset(Config::$formats[$extension])){
$this->type = Config::$formats[$extension];
}else{
$this->correct = false;
}
}
if($this->correct === true){
$content = @file_get_contents($this->file);
switch($this->type){
case CONFIG_PROPERTIES:
case CONFIG_CNF:
$this->parseProperties($content);
break;
case CONFIG_JSON:
$this->config = @json_decode($content, true);
break;
case CONFIG_YAML:
$this->config = Spyc::YAMLLoad($content);
break;
case CONFIG_SERIALIZED:
$this->config = @unserialize($content);
break;
case CONFIG_LIST:
$this->parseList($content);
break;
default:
$this->correct = false;
return false;
break;
}
if(!is_array($this->config)){
$this->config = $default;
}
$this->fillDefaults($default, $this->config);
}else{
return false;
}
}
return true;
}
public function check(){
return $this->correct === true;
}
public function save(){
if($this->correct === true){
switch($this->type){
case CONFIG_PROPERTIES:
case CONFIG_CNF:
$content = $this->writeProperties();
break;
case CONFIG_JSON:
$content = json_encode($this->config);
break;
case CONFIG_YAML:
$content = Spyc::YAMLDump($this->config);
break;
case CONFIG_SERIALIZED:
$content = @serialize($this->config);
break;
case CONFIG_LIST:
$content = implode("\r\n", array_keys($this->config));
break;
}
@file_put_contents($this->file, $content, LOCK_EX);
return true;
}else{
return false;
}
}
public function get($k){
if($this->correct === false or !isset($this->config[$k])){
return false;
}
return ($this->config[$k]);
}
public function set($k, $v = true){
$this->config[$k] = $v;
}
public function exists($k){
return isset($this->config[$k]);
}
public function remove($k){
unset($this->config[$k]);
}
public function getAll($keys = false){
return ($keys === true ? array_keys($this->config):$this->config);
}
private function fillDefaults($default, &$data){
foreach($default as $k => $v){
if(is_array($v)){
if(!isset($data[$k]) or !is_array($data[$k])){
$data[$k] = array();
}
$this->fillDefaults($v, $data[$k]);
}elseif(!isset($data[$k])){
$data[$k] = $v;
}
}
}
private function parseList($content){
foreach(explode("\n", trim(str_replace("\r", "", $content))) as $v){
$v = trim($v);
if($v == ""){
continue;
}
$this->config[$v] = true;
}
}
private function writeProperties(){
$content = "#Properties Config file\r\n#".date("D M j H:i:s T Y")."\r\n";
foreach($this->config as $k => $v){
if(is_bool($v) === true){
$v = $v === true ? "on":"off";
}elseif(is_array($v)){
$v = implode(";", $v);
}
$content .= $k."=".$v."\r\n";
}
return $content;
}
private function parseProperties($content){
if(preg_match_all('/([a-zA-Z0-9\-_]*)=([^\r\n]*)/u', $content, $matches) > 0){ //false or 0 matches
foreach($matches[1] as $i => $k){
$v = trim($matches[2][$i]);
switch(strtolower($v)){
case "on":
case "true":
case "yes":
$v = true;
break;
case "off":
case "false":
case "no":
$v = false;
break;
}
if(isset($this->config[$k])){
console("[NOTICE] [Config] Repeated property ".$k." on file ".$this->file, true, true, 2);
}
$this->config[$k] = $v;
}
}
}
}

View File

@ -1,73 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Container{
private $payload = "", $whitelist = false, $blacklist = false;
public function __construct($payload = "", $whitelist = false, $blacklist = false){
$this->payload = $payload;
if(is_array($whitelist)){
$this->whitelist = $whitelist;
}
if(is_array($blacklist)){
$this->blacklist = $blacklist;
}
}
public function get(){
return $this->payload;
}
public function check($target){
$w = true;
$b = false;
if($this->whitelist !== false){
$w = false;
if(in_array($target, $this->whitelist, true)){
$w = true;
}
}else{
$w = true;
}
if($this->blacklist !== false){
$b = true;
if(in_array($target, $this->blacklist, true)){
$b = false;
}
}else{
$b = false;
}
if($w === false or $b === true){
return false;
}
return true;
}
public function __toString(){
return $this->payload;
}
}

View File

@ -1,126 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class Java_String{
private $value = "", $count = 0, $hash = 0;
public function __construct($string = false){
if($string !== false){
$this->value = (string) $string;
$this->count = strlen($this->value);
}
}
public function __toString(){
return $this->value;
}
public function lenght(){
return $this->count;
}
public function isEmpty(){
return $this->count === 0;
}
public function charAt($index){
$index = (int) $index;
if($index < 0 or $index >= $this->count){
trigger_error("Undefined offset $index", E_USER_WARNING);
return false;
}
return $this->value{$index};
}
public function hashCode(){
$h = $this->hash;
if($h === 0 and $this->count > 0){
for($i = 0; $i < $this->count; ++$i){
$h = (($h << 5) - $h) + ord($this->charAt($i));
$h = $h & 0xFFFFFFFF;
$this->hash = $h;
}
$this->hash = $h;
}
return $h;
}
}
class Java_Random{
private $haveNextNextGaussian, $nextNextGaussian, $seed, $n1, $n2, $n3, $zero;
public function __construct($seed = false){
$this->n1 = new Math_BigInteger(0x5DEECE66D);
$this->n2 = new Math_BigInteger(1);
$this->n2 = $this->n2->bitwise_leftShift(48)->subtract($this->n2);
$this->n3 = new Math_BigInteger(0xB);
$this->zero = new Math_BigInteger(0);
if($seed === false){
$seed = microtime(true) * 1000000;
}
$this->setSeed($seed);
}
public function setSeed($seed){
$seed = new Math_BigInteger($seed);
$this->seed = $seed->bitwise_xor($this->n1)->bitwise_and($this->n2);
$this->haveNextNextGaussian = false;
}
protected function next($bits){
$bits = (int) $bits;
$this->seed = $this->seed->multiply($this->n1)->add($this->n3)->bitwise_and($this->n2);
return $this->_tripleRightShift($this->seed, (48 - $bits));
}
private function _tripleRightShift($number, $places){
if($number->compare($this->zero) >= 0){
return $number->bitwise_rightShift($places);
}
$n1 = new Math_BigInteger(2);
return $number->bitwise_rightShift($places)->add($n1->bitwise_leftShift(~$places));
}
public function nextBytes($bytes){
$bytes = (int) $bytes;
$b = b"";
$max = $bytes & ~0x3;
for($i = 0; $i < $max; $i += 4){
$b .= $this->next(32)->toBytes();
}
if($max < $bytes){
$random = $this->next(32)->toBytes();
for($j = $max; $j < $bytes; ++$j){
$b .= $random{$j-$max};
}
}
return $b;
}
}

View File

@ -1,102 +0,0 @@
<?php
/**
* Class for reading in NBT-format files.
*
* @author Justin Martin <frozenfire@thefrozenfire.com>
* @version 1.0
* MODIFIED BY @shoghicp
*
* Dependencies:
* PHP 4.3+ (5.3+ recommended)
*/
class NBT {
public $root = array();
const TAG_END = 0;
const TAG_BYTE = 1;
const TAG_SHORT = 2;
const TAG_INT = 3;
const TAG_LONG = 4;
const TAG_FLOAT = 5;
const TAG_DOUBLE = 6;
const TAG_BYTE_ARRAY = 7;
const TAG_STRING = 8;
const TAG_LIST = 9;
const TAG_COMPOUND = 10;
public function loadFile($filename) {
if(is_file($filename)) {
$fp = fopen($filename, "rb");
}else{
trigger_error("First parameter must be a filename", E_USER_WARNING);
return false;
}
switch(basename($filename, ".dat")){
case "level":
$version = Utils::readLInt(fread($fp, 4));
$lenght = Utils::readLInt(fread($fp, 4));
break;
case "entities":
fread($fp, 12);
break;
}
$this->traverseTag($fp, $this->root);
return end($this->root);
}
public function traverseTag($fp, &$tree) {
if(feof($fp)) {
return false;
}
$tagType = $this->readType($fp, self::TAG_BYTE); // Read type byte.
if($tagType == self::TAG_END) {
return false;
} else {
$tagName = $this->readType($fp, self::TAG_STRING);
$tagData = $this->readType($fp, $tagType);
$tree[] = array("type"=>$tagType, "name"=>$tagName, "value"=>$tagData);
return true;
}
}
public function readType($fp, $tagType) {
switch($tagType) {
case self::TAG_BYTE: // Signed byte (8 bit)
return Utils::readByte(fread($fp, 1));
case self::TAG_SHORT: // Signed short (16 bit, big endian)
return Utils::readLShort(fread($fp, 2));
case self::TAG_INT: // Signed integer (32 bit, big endian)
return Utils::readLInt(fread($fp, 4));
case self::TAG_LONG: // Signed long (64 bit, big endian)
return Utils::readLLong(fread($fp, 8));
case self::TAG_FLOAT: // Floating point value (32 bit, big endian, IEEE 754-2008)
return Utils::readLFloat(fread($fp, 4));
case self::TAG_DOUBLE: // Double value (64 bit, big endian, IEEE 754-2008)
return Utils::readLDouble(fread($fp, 8));
case self::TAG_BYTE_ARRAY: // Byte array
$arrayLength = $this->readType($fp, self::TAG_INT);
$array = array();
for($i = 0; $i < $arrayLength; $i++) $array[] = $this->readType($fp, self::TAG_BYTE);
return $array;
case self::TAG_STRING: // String
if(!$stringLength = $this->readType($fp, self::TAG_SHORT)) return "";
$string = fread($fp, $stringLength); // Read in number of bytes specified by string length, and decode from utf8.
return $string;
case self::TAG_LIST: // List
$tagID = $this->readType($fp, self::TAG_BYTE);
$listLength = $this->readType($fp, self::TAG_INT);
$list = array("type"=>$tagID, "value"=>array());
for($i = 0; $i < $listLength; $i++) {
if(feof($fp)) break;
$list["value"][] = $this->readType($fp, $tagID);
}
return $list;
case self::TAG_COMPOUND: // Compound
$tree = array();
while($this->traverseTag($fp, $tree));
return $tree;
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class TickLoop extends Thread{
public $tick, $stop, $lastTic;
private $server;
public function __construct(PocketMinecraftServer $server){
$this->tick = false;
$this->lastTick = 0;
$this->server = $server;
}
public function run(){
while($this->stop !== true){
usleep(1);
$time = microtime(true);
if($this->lastTick <= ($time - 0.05)){
$this->lastTick = $time;
$this->tick = true;
$this->wait();
$this->tick = false;
}
}
exit(0);
}
}

View File

@ -1,67 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
function UPnP_PortForward($port){
if(Utils::$online === false){
return false;
}
if(Utils::getOS() != "win" or !class_exists("COM")){
return false;
}
$port = (int) $port;
$myLocalIP = gethostbyname(trim(`hostname`));
try{
$com = new COM("HNetCfg.NATUPnP");
if($com === false or !is_object($com->StaticPortMappingCollection)){
return false;
}
$com->StaticPortMappingCollection->Add($port, "UDP", $port, $myLocalIP, true, "PocketMine-MP");
}catch(Exception $e){
return false;
}
return true;
}
function UPnP_RemovePortForward($port){
if(Utils::$online === false){
return false;
}
if(Utils::getOS() != "win" or !class_exists("COM")){
return false;
}
$port = (int) $port;
try{
$com = new COM("HNetCfg.NATUPnP") or false;
if($com === false or !is_object($com->StaticPortMappingCollection)){
return false;
}
$com->StaticPortMappingCollection->Remove($port, "UDP");
}catch(Exception $e){
return false;
}
return true;
}

View File

@ -1,539 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
if(!defined("HEX2BIN")){
@define("HEX2BIN", false);
}
define("BIG_ENDIAN", 0x00);
define("LITTLE_ENDIAN", 0x01);
define("ENDIANNESS", (pack("d", 1) === "\77\360\0\0\0\0\0\0" ? BIG_ENDIAN:LITTLE_ENDIAN));
class Utils extends Thread{
public static $online = true;
public function run(){
}
public static function isOnline(){
return (checkdnsrr("google.com", "ANY") && checkdnsrr("yahoo.com", "ANY") && checkdnsrr("microsoft.com", "ANY"));
}
public static function getIP(){
if(Utils::$online === false){
return false;
}
$ip = "";//trim(Utils::curl_get("http://automation.whatismyip.com/n09230945.asp"));
if($ip != ""){
return $ip;
}else{
trim(strip_tags(Utils::curl_get("http://checkip.dyndns.org/")));
if(preg_match('#Current IP Address\: ([0-9a-fA-F\:\.]*)#', $ip, $matches) > 0){
return $matches[1];
}else{
$ip = Utils::curl_get("http://www.checkip.org/");
if(preg_match('#">([0-9a-fA-F\:\.]*)</span>#', $ip, $matches) > 0){
return $matches[1];
}else{
$ip = Utils::curl_get("http://checkmyip.org/");
if(preg_match('#Your IP address is ([0-9a-fA-F\:\.]*)#', $ip, $matches) > 0){
return $matches[1];
}else{
return false;
}
}
}
}
}
public static function getOS(){
$uname = strtoupper(php_uname("s"));
if(strpos($uname, "WIN") !== false){
return "win";
}elseif(strpos($uname, "DARWIN") !== false){
return "mac";
}else{
return "linux";
}
}
public static function hexdump($bin){
$output = "";
$bin = str_split($bin, 16);
foreach($bin as $counter => $line){
$hex = chunk_split(chunk_split(str_pad(bin2hex($line), 32, " ", STR_PAD_RIGHT), 2, " "), 24, " ");
$ascii = preg_replace('#([^\x20-\x7E])#', ".", $line);
$output .= str_pad(dechex($counter << 4), 4, "0", STR_PAD_LEFT). " " . $hex . " " . $ascii . PHP_EOL;
}
return $output;
}
public static function printable($str){
if(!is_string($str)){
return gettype($str);
}
return preg_replace('#([^\x20-\x7E])#', '.', $str);
}
public static function readTriad($str){
list(,$unpacked) = unpack("N", "\x00".$str);
return (int) $unpacked;
}
public static function writeTriad($value){
return substr(pack("N", $value), 1);
}
public static function writeMetadata($data){
$m = "";
foreach($data as $bottom => $d){
$m .= chr(($d["type"] << 5) & (0xE0 | $bottom));
switch($d["type"]){
case 0:
$m .= Utils::writeByte($data["value"]);
break;
case 1:
$m .= Utils::writeLShort($data["value"]);
break;
case 2:
$m .= Utils::writeLInt($data["value"]);
break;
case 3:
$m .= Utils::writeLFloat($data["value"]);
break;
case 4:
$m .= Utils::writeLShort(strlen($data["value"]));
$m .= $data["value"];
break;
case 5:
$m .= Utils::writeLShort($data["value"][0]);
$m .= Utils::writeByte($data["value"][1]);
$m .= Utils::writeLShort($data["value"][2]);
break;
case 6:
for($i=0; $i < 3; ++$i){
$m .= Utils::writeLInt($data["value"][$i]);
}
break;
}
}
$m .= "\x7f";
return $m;
}
public static function readMetadata($value, $types = false){
$offset = 0;
$m = array();
$b = ord($value{$offset});
++$offset;
while($b !== 127){
$bottom = $b & 0x1F;
$type = $b >> 5;
switch($type){
case 0:
$r = Utils::readByte($value{$offset});
++$offset;
break;
case 1:
$r = Utils::readLShort(substr($value, $offset, 2));
$offset += 2;
break;
case 2:
$r = Utils::readLInt(substr($value, $offset, 4));
$offset += 4;
break;
case 3:
$r = Utils::readLFloat(substr($value, $offset, 4));
$offset += 4;
break;
case 4:
$len = Utils::readLShort(substr($value, $offset, 2));
$offset += 2;
$r = substr($value, $offset, $len);
$offset += $len;
break;
case 5:
$r = array();
$r[] = Utils::readLShort(substr($value, $offset, 2));
$offset += 2;
$r[] = Utils::readByte($value{$offset});
++$offset;
$r[] = Utils::readLShort(substr($value, $offset, 2));
$offset += 2;
break;
case 6:
$r = array();
for($i=0; $i < 3; ++$i){
$r[] = Utils::readLInt(substr($value, $offset, 4));
$offset += 4;
}
break;
}
if($types === true){
$m[$bottom] = array($r, $type);
}else{
$m[$bottom] = $r;
}
$b = ord($value{$offset});
++$offset;
}
return $m;
}
public static function readDataArray($str, $len = 10, &$offset = null){
$data = array();
$offset = 0;
for($i = 1; $i <= $len; ++$i){
$l = Utils::readTriad(substr($str, $offset, 3));
$offset += 3;
$data[] = substr($str, $offset, $l);
$offset += $l;
}
return $data;
}
public static function writeDataArray($data){
$raw = "";
foreach($data as $v){
$raw .= Utils::writeTriad(strlen($v));
$raw .= $v;
}
return $raw;
}
public static function getRandomBytes($length = 16, $secure = true, $raw = true, $startEntropy = "", &$rounds = 0, &$drop = 0){
$output = b"";
$length = abs((int) $length);
$secureValue = "";
$rounds = 0;
$drop = 0;
while(!isset($output{$length - 1})){
//some entropy, but works ^^
$weakEntropy = array(
is_array($startEntropy) ? implode($startEntropy):$startEntropy,
serialize(stat(__FILE__)),
__DIR__,
PHP_OS,
microtime(),
(string) lcg_value(),
serialize($_SERVER),
serialize(get_defined_constants()),
get_current_user(),
serialize(ini_get_all()),
(string) memory_get_usage(),
php_uname(),
phpversion(),
extension_loaded("gmp") ? gmp_strval(gmp_random(4)):microtime(),
zend_version(),
(string) getmypid(),
(string) mt_rand(),
(string) rand(),
function_exists("zend_thread_id") ? ((string) zend_thread_id()):microtime(),
function_exists("sys_getloadavg") ? implode(";", sys_getloadavg()):microtime(),
serialize(get_loaded_extensions()),
sys_get_temp_dir(),
(string) disk_free_space("."),
(string) disk_total_space("."),
uniqid(microtime(),true),
);
shuffle($weakEntropy);
$value = hash("sha256", implode($weakEntropy), true);
foreach($weakEntropy as $k => $c){ //mixing entropy values with XOR and hash randomness extractor
$c = (string) $c;
str_shuffle($c); //randomize characters
$value ^= hash("md5", $c . microtime() . $k, true) . hash("md5", microtime() . $k . $c, true);
$value ^= hash("sha256", $c . microtime() . $k, true);
}
unset($weakEntropy);
if($secure === true){
$strongEntropy = array(
is_array($startEntropy) ? $startEntropy[($rounds + $drop) % count($startEntropy)]:$startEntropy, //Get a random index of the startEntropy, or just read it
file_exists("/dev/urandom") ? fread(fopen("/dev/urandom", "rb"), 512):"",
(function_exists("openssl_random_pseudo_bytes") and version_compare(PHP_VERSION, "5.3.4", ">=")) ? openssl_random_pseudo_bytes(512):"",
function_exists("mcrypt_create_iv") ? mcrypt_create_iv(512, MCRYPT_DEV_URANDOM) : "",
$value,
);
shuffle($strongEntropy);
$strongEntropy = implode($strongEntropy);
$value = "";
//Von Neumann randomness extractor, increases entropy
$len = strlen($strongEntropy) * 8;
for($i = 0; $i < $len; $i += 2){
$a = ord($strongEntropy{$i >> 3});
$b = 1 << ($i % 8);
$c = 1 << (($i % 8) + 1);
$b = ($a & $b) === $b ? "1":"0";
$c = ($a & $c) === $c ? "1":"0";
if($b !== $c){
$secureValue .= $b;
if(isset($secureValue{7})){
$value .= chr(bindec($secureValue));
$secureValue = "";
}
++$drop;
}else{
$drop += 2;
}
}
}
$output .= substr($value, 0, min($length - strlen($output), $length));
unset($value);
++$rounds;
}
return $raw === false ? bin2hex($output):$output;
}
public static function round($number){
return round($number, 0, PHP_ROUND_HALF_DOWN);
}
public static function distance($pos1, $pos2){
return sqrt(pow($pos1["x"] - $pos2["x"], 2) + pow($pos1["y"] - $pos2["y"], 2) + pow($pos1["z"] - $pos2["z"], 2));
}
public static function angle3D($pos1, $pos2){
$X = $pos1["x"] - $pos2["x"];
$Z = $pos1["z"] - $pos2["z"];
$dXZ = sqrt(pow($X, 2) + pow($Z, 2));
$Y = $pos1["y"] - $pos2["y"];
$hAngle = rad2deg(atan2($Z, $X) - M_PI_2);
$vAngle = rad2deg(-atan2($Y, $dXZ));
return array("yaw" => $hAngle, "pitch" => $vAngle);
}
public static function sha1($input){
$number = new Math_BigInteger(sha1($input, true), -256);
$zero = new Math_BigInteger(0);
return ($zero->compare($number) <= 0 ? "":"-") . ltrim($number->toHex(), "0");
}
public static function microtime(){
return microtime(true);
}
public static function curl_get($page){
if(Utils::$online === false){
return false;
}
$ch = curl_init($page);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 PocketMine-MP"));
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
public static function curl_post($page, $args, $timeout = 10){
if(Utils::$online === false){
return false;
}
$ch = curl_init($page);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 PocketMine-MP"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (int) $timeout);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
public static function strToHex($str){
return bin2hex($str);
}
public static function hexToStr($hex){
if(HEX2BIN === true){
return hex2bin($hex);
}
return pack("H*" , $hex);
}
public static function readBool($b){
return Utils::readByte($b, false) === 0 ? false:true;
}
public static function writeBool($b){
return Utils::writeByte($b === true ? 1:0);
}
public static function readByte($c, $signed = true){
$b = ord($c{0});
if($signed === true and ($b & 0x80) === 0x80){ //calculate Two's complement
$b = -0x80 + ($b & 0x7f);
}
return $b;
}
public static function writeByte($c){
if($c > 0xff){
return false;
}
if($c < 0 and $c >= -0x80){
$c = 0xff + $c + 1;
}
return chr($c);
}
public static function readShort($str, $signed = true){
list(,$unpacked) = unpack("n", $str);
if($unpacked > 0x7fff and $signed === true){
$unpacked -= 0x10000; // Convert unsigned short to signed short
}
return $unpacked;
}
public static function writeShort($value){
if($value < 0){
$value += 0x10000;
}
return pack("n", $value);
}
public static function readLShort($str, $signed = true){
list(,$unpacked) = unpack("v", $str);
if($unpacked > 0x7fff and $signed === true){
$unpacked -= 0x10000; // Convert unsigned short to signed short
}
return $unpacked;
}
public static function writeLShort($value){
if($value < 0){
$value += 0x10000;
}
return pack("v", $value);
}
public static function readInt($str){
list(,$unpacked) = unpack("N", $str);
if($unpacked >= 2147483648){
$unpacked -= 4294967296;
}
return (int) $unpacked;
}
public static function writeInt($value){
if($value < 0){
$value += 0x100000000;
}
return pack("N", $value);
}
public static function readLInt($str){
list(,$unpacked) = unpack("V", $str);
if($unpacked >= 2147483648){
$unpacked -= 4294967296;
}
return (int) $unpacked;
}
public static function writeLInt($value){
if($value < 0){
$value += 0x100000000;
}
return pack("V", $value);
}
public static function readFloat($str){
list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("f", $str):unpack("f", strrev($str));
return $value;
}
public static function writeFloat($value){
return ENDIANNESS === BIG_ENDIAN ? pack("f", $value):strrev(pack("f", $value));
}
public static function readLFloat($str){
list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("f", strrev($str)):unpack("f", $str);
return $value;
}
public static function writeLFloat($value){
return ENDIANNESS === BIG_ENDIAN ? strrev(pack("f", $value)):pack("f", $value);
}
public static function printFloat($value){
return preg_replace("/(\.\d+?)0+$/", "$1", sprintf("%F", $value));
}
public static function readDouble($str){
list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("d", $str):unpack("d", strrev($str));
return $value;
}
public static function writeDouble($value){
return ENDIANNESS === BIG_ENDIAN ? pack("d", $value):strrev(pack("d", $value));
}
public static function readLDouble($str){
list(,$value) = ENDIANNESS === BIG_ENDIAN ? unpack("d", strrev($str)):unpack("d", $str);
return $value;
}
public static function writeLDouble($value){
return ENDIANNESS === BIG_ENDIAN ? strrev(pack("d", $value)):pack("d", $value);
}
public static function readLong($str){
$long = new Math_BigInteger($str, -256);
return $long->toString();
}
public static function writeLong($value){
$long = new Math_BigInteger($value, -10);
return str_pad($long->toBytes(true), 8, "\x00", STR_PAD_LEFT);
}
public static function readLLong($str){
$long = new Math_BigInteger(strrev($str), -256);
return $long->toString();
}
public static function writeLLong($value){
$long = new Math_BigInteger($value, -10);
return strrev(str_pad($long->toBytes(true), 8, "\x00", STR_PAD_LEFT));
}
}
if(Utils::isOnline() === false){
Utils::$online = false;
}

View File

@ -1,371 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
define("ENTITY_PLAYER", 0);
define("ENTITY_MOB", 1);
define("ENTITY_OBJECT", 2);
define("ENTITY_ITEM", 3);
define("ENTITY_PAINTING", 4);
class Entity extends stdClass{
var $invincible, $air, $dmgcounter, $eid, $type, $name, $x, $y, $z, $speedX, $speedY, $speedZ, $speed, $last = array(0, 0, 0, 0), $yaw, $pitch, $dead, $data, $class, $attach, $metadata, $closed, $player, $onTick;
private $server;
function __construct($server, $eid, $class, $type = 0, $data = array()){
$this->server = $server;
$this->eid = (int) $eid;
$this->type = (int) $type;
$this->class = (int) $class;
$this->player = false;
$this->attach = false;
$this->data = $data;
$this->status = 0;
$this->health = 20;
$this->dmgcounter = array(0, 0);
$this->air = 300;
$this->invincible = false;
$this->dead = false;
$this->closed = false;
$this->name = "";
$this->server->query("INSERT OR REPLACE INTO entities (EID, type, class, health) VALUES (".$this->eid.", ".$this->type.", ".$this->class.", ".$this->health.");");
$this->server->schedule(4, array($this, "update"), array(), true);
$this->server->schedule(10, array($this, "environmentUpdate"), array(), true);
$this->metadata = array();
$this->x = isset($this->data["x"]) ? $this->data["x"]:0;
$this->y = isset($this->data["y"]) ? $this->data["y"]:0;
$this->z = isset($this->data["z"]) ? $this->data["z"]:0;
$this->speedX = isset($this->data["speedX"]) ? $this->data["speedX"]:0;
$this->speedY = isset($this->data["speedY"]) ? $this->data["speedY"]:0;
$this->speedZ = isset($this->data["speedZ"]) ? $this->data["speedZ"]:0;
$this->speed = 0;
$this->yaw = isset($this->data["yaw"]) ? $this->data["yaw"]:0;
$this->pitch = isset($this->data["pitch"]) ? $this->data["pitch"]:0;
$this->position = array("x" => &$this->x, "y" => &$this->y, "z" => &$this->z, "yaw" => &$this->yaw, "pitch" => &$this->pitch);
switch($this->class){
case ENTITY_PLAYER:
$this->player = $this->data["player"];
$this->health = &$this->player->data["health"];
break;
case ENTITY_ITEM:
$this->meta = (int) $this->data["meta"];
$this->stack = (int) $this->data["stack"];
break;
case ENTITY_MOB:
//$this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
break;
case ENTITY_OBJECT:
//$this->setName((isset($objects[$this->type]) ? $objects[$this->type]:$this->type));
break;
}
}
public function environmentUpdate(){
if($this->closed === true){
return false;
}
$startX = (int) (round($this->x - 0.5) - 1);
$startY = (int) (round($this->y) - 1);
$startZ = (int) (round($this->z - 0.5) - 1);
$endX = $startX + 2;
$endY = $startY + 2;
$endZ = $startZ + 2;
for($y = $startY; $y <= $endY; ++$y){
for($x = $startX; $x <= $endX; ++$x){
for($z = $startZ; $z <= $endZ; ++$z){
$b = $this->server->api->level->getBlock($x, $y, $z);
switch($b[0]){
case 8:
case 9: //Drowing
if($this->air <= 0){
$this->harm(2, "water");
}elseif($x == ($endX - 1) and $y == $endY and $z == ($endZ - 1)){
$this->air -= 10;
}
break;
case 10: //Lava damage
case 11:
if($this->inBlock($x, $y, $z)){
$this->harm(5, "lava");
}
break;
case 51: //Fire block damage
if($this->inBlock($x, $y, $z)){
$this->harm(1, "fire");
}
break;
case 81: //Cactus damage
if($this->touchingBlock($x, $y, $z)){
$this->harm(1, "cactus");
}
break;
default:
if($this->inBlock($x, $y, $z, 0.7) and !isset(Material::$transparent[$b[0]])){
$this->harm(1, "suffocation"); //Suffocation
}elseif($x == ($endX - 1) and $y == $endY and $z == ($endZ - 1)){
$this->air = 300; //Breathing
}
break;
}
}
}
}
}
public function update(){
if($this->closed === true){
return false;
}
$this->calculateVelocity();
$this->server->api->dhandle("entity.move", $this);
if($this->class === ENTITY_ITEM and $this->server->gamemode === 0){
$player = $this->server->query("SELECT EID FROM entities WHERE class == ".ENTITY_PLAYER." AND abs(x - {$this->x}) <= 1.5 AND abs(y - {$this->y}) <= 1.5 AND abs(z - {$this->z}) <= 1.5 LIMIT 1;", true);
if($player !== true and $player !== false){
if($this->server->api->dhandle("player.pickup", array(
"eid" => $player["EID"],
"entity" => $this,
"block" => $this->type,
"meta" => $this->meta,
"target" => $this->eid
)) !== false){
$this->close();
return false;
}
}
}
}
public function getDirection(){
$rotation = ($this->yaw - 90) % 360;
if ($rotation < 0) {
$rotation += 360.0;
}
if(0 <= $rotation && $rotation < 45) {
return 2;
}elseif(45 <= $rotation && $rotation < 135) {
return 3;
}elseif(135 <= $rotation && $rotation < 225) {
return 0;
}elseif(225 <= $rotation && $rotation < 315) {
return 1;
}elseif(315 <= $rotation && $rotation < 360) {
return 2;
}else{
return null;
}
}
public function spawn($player){
if(!is_object($player)){
$player = $this->server->api->player->get($player);
}
if($player->eid === $this->eid){
return false;
}
switch($this->class){
case ENTITY_PLAYER:
$player->dataPacket(MC_ADD_PLAYER, array(
"clientID" => $this->player->clientID,
"username" => $this->player->username,
"eid" => $this->eid,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
));
$player->dataPacket(MC_PLAYER_EQUIPMENT, array(
"eid" => $this->eid,
"block" => $this->player->equipment[0],
"meta" => $this->player->equipment[1],
));
break;
case ENTITY_ITEM:
$player->dataPacket(MC_ADD_ITEM_ENTITY, array(
"eid" => $this->eid,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
"block" => $this->type,
"meta" => $this->meta,
"stack" => $this->stack,
));
break;
case ENTITY_MOB:
$player->dataPacket(MC_ADD_MOB, array(
"type" => $this->type,
"eid" => $this->eid,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z,
));
break;
case ENTITY_OBJECT:
//$this->setName((isset($objects[$this->type]) ? $objects[$this->type]:$this->type));
break;
}
}
public function close(){
if($this->closed === false){
$this->server->api->entity->remove($this->eid);
$this->closed = true;
}
}
public function __destruct(){
$this->close();
}
public function getEID(){
return $this->eid;
}
public function getName(){
return $this->name;
}
public function setName($name){
$this->name = $name;
$this->server->query("UPDATE entities SET name = '".str_replace("'", "", $this->name)."' WHERE EID = ".$this->eid.";");
}
public function look($pos2){
$pos = $this->getPosition();
$angle = Utils::angle3D($pos2, $pos);
$this->yaw = $angle["yaw"];
$this->pitch = $angle["pitch"];
$this->server->query("UPDATE entities SET pitch = ".$this->pitch.", yaw = ".$this->yaw." WHERE EID = ".$this->eid.";");
}
public function setCoords($x, $y, $z){
$this->x = $x;
$this->y = $y;
$this->z = $z;
$this->server->query("UPDATE entities SET x = ".$this->x.", y = ".$this->y.", z = ".$this->z." WHERE EID = ".$this->eid.";");
}
public function move($x, $y, $z, $yaw = 0, $pitch = 0){
$this->x += $x;
$this->y += $y;
$this->z += $z;
$this->yaw += $yaw;
$this->yaw %= 360;
$this->pitch += $pitch;
$this->pitch %= 90;
$this->server->query("UPDATE entities SET x = ".$this->x.", y = ".$this->y.", z = ".$this->z.", pitch = ".$this->pitch.", yaw = ".$this->yaw." WHERE EID = ".$this->eid.";");
}
public function setPosition($x, $y, $z, $yaw, $pitch){
$this->x = $x;
$this->y = $y;
$this->z = $z;
$this->yaw = $yaw;
$this->pitch = $pitch;
$this->server->query("UPDATE entities SET x = ".$this->x.", y = ".$this->y.", z = ".$this->z.", pitch = ".$this->pitch.", yaw = ".$this->yaw." WHERE EID = ".$this->eid.";");
}
public function inBlock($x, $y, $z, $radius = 0.8){
$block = new Vector3($x, $y, $z);
$me = new Vector3($this->x - 0.5, $this->y, $this->z - 0.5);
if(($y == ((int) $this->y) or $y == (((int) $this->y) + 1)) and $block->maxPlainDistance($me) < $radius){
return true;
}
return false;
}
public function touchingBlock($x, $y, $z, $radius = 0.9){
$block = new Vector3($x, $y, $z);
$me = new Vector3($this->x - 0.5, $this->y, $this->z - 0.5);
if(($y == (((int) $this->y) - 1) or $y == ((int) $this->y) or $y == (((int) $this->y) + 1)) and $block->maxPlainDistance($me) < $radius){
return true;
}
return false;
}
public function calculateVelocity(){
$diffTime = microtime(true) - $this->last[3];
$this->last[3] = microtime(true);
$origin = new Vector3($this->last[0], $this->last[1], $this->last[2]);
$final = new Vector3($this->x, $this->y, $this->z);
$speedX = abs($this->x - $this->last[0]) / $diffTime;
$this->last[0] = $this->x;
$speedY = ($this->y - $this->last[1]) / $diffTime;
$this->last[1] = $this->y;
$speedZ = abs($this->z - $this->last[2]) / $diffTime;
$this->last[2] = $this->z;
$this->speedX = $speedX;
$this->speedY = $speedY;
$this->speedZ = $speedZ;
$this->speed = $origin->distance($final) / $diffTime;
}
public function getPosition($round = false){
return !isset($this->position) ? false:($round === true ? array_map("floor", $this->position):$this->position);
}
public function harm($dmg, $cause = ""){
return $this->setHealth($this->getHealth() - ((int) $dmg), $cause);
}
public function setHealth($health, $cause = "", $force = false){
$health = (int) $health;
if($health < $this->health){
$dmg = $this->health - $health;
if(($this->server->gamemode === 0 or $force === true) and ($this->dmgcounter[0] < microtime(true) or $this->dmgcounter[1] < $dmg) and !$this->dead){
$this->dmgcounter = array(microtime(true) + 0.5, $dmg);
}else{
return false; //Entity inmunity
}
}elseif($health === $this->health){
return false;
}
if($this->server->api->dhandle("entity.health.change", array("entity" => $this, "eid" => $this->eid, "health" => $health, "cause" => $cause)) !== false){
$this->health = min(127, max(-127, $health));
$this->server->query("UPDATE entities SET health = ".$this->health." WHERE EID = ".$this->eid.";");
if($this->player instanceof Player){
$this->player->dataPacket(MC_SET_HEALTH, array(
"health" => $this->health,
));
}
if($this->health <= 0 and $this->dead === false){
$this->dead = true;
if($this->player !== false){
$this->server->api->dhandle("player.death", array("name" => $this->name, "cause" => $cause));
}
}elseif($this->health > 0){
$this->dead = false;
}
return true;
}
return false;
}
public function getHealth(){
return $this->health;
}
}
?>

View File

@ -1,36 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class TileEntity extends stdClass{
private $server;
function __construct(PocketMinecraftServer $server){
}
}
?>

View File

@ -1,357 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class WorldGenerator{
private $gen, $seed, $genName, $raw;
public function __construct($genName, $seed){
$this->seed = (int) $seed;
$this->raw = b"";
$this->genName = $genName;
$this->gen = new $genName($this->seed);
}
public function getSpawn(){
return $this->gen->getSpawn();
}
public function set($name, $value){
$this->gen->set($name, $value);
}
public function init(){
$this->raw = "\x15\x01\x00\x00\x15\x16\x00\x00\x15\x2b\x00\x00\x15\x40\x00\x00". //Location Header
"\x15\x55\x00\x00\x15\x6a\x00\x00\x15\x7f\x00\x00\x15\x94\x00\x00".
"\x15\xa9\x00\x00\x15\xbe\x00\x00\x15\xd3\x00\x00\x15\xe8\x00\x00".
"\x15\xfd\x00\x00\x15\x12\x01\x00\x15\x27\x01\x00\x15\x3c\x01\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x51\x01\x00\x15\x66\x01\x00\x15\x7b\x01\x00\x15\x90\x01\x00".
"\x15\xa5\x01\x00\x15\xba\x01\x00\x15\xcf\x01\x00\x15\xe4\x01\x00".
"\x15\xf9\x01\x00\x15\x0e\x02\x00\x15\x23\x02\x00\x15\x38\x02\x00".
"\x15\x4d\x02\x00\x15\x62\x02\x00\x15\x77\x02\x00\x15\x8c\x02\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\xa1\x02\x00\x15\xb6\x02\x00\x15\xcb\x02\x00\x15\xe0\x02\x00".
"\x15\xf5\x02\x00\x15\x0a\x03\x00\x15\x1f\x03\x00\x15\x34\x03\x00".
"\x15\x49\x03\x00\x15\x5e\x03\x00\x15\x73\x03\x00\x15\x88\x03\x00".
"\x15\x9d\x03\x00\x15\xb2\x03\x00\x15\xc7\x03\x00\x15\xdc\x03\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\xf1\x03\x00\x15\x06\x04\x00\x15\x1b\x04\x00\x15\x30\x04\x00".
"\x15\x45\x04\x00\x15\x5a\x04\x00\x15\x6f\x04\x00\x15\x84\x04\x00".
"\x15\x99\x04\x00\x15\xae\x04\x00\x15\xc3\x04\x00\x15\xd8\x04\x00".
"\x15\xed\x04\x00\x15\x02\x05\x00\x15\x17\x05\x00\x15\x2c\x05\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x41\x05\x00\x15\x56\x05\x00\x15\x6b\x05\x00\x15\x80\x05\x00".
"\x15\x95\x05\x00\x15\xaa\x05\x00\x15\xbf\x05\x00\x15\xd4\x05\x00".
"\x15\xe9\x05\x00\x15\xfe\x05\x00\x15\x13\x06\x00\x15\x28\x06\x00".
"\x15\x3d\x06\x00\x15\x52\x06\x00\x15\x67\x06\x00\x15\x7c\x06\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x91\x06\x00\x15\xa6\x06\x00\x15\xbb\x06\x00\x15\xd0\x06\x00".
"\x15\xe5\x06\x00\x15\xfa\x06\x00\x15\x0f\x07\x00\x15\x24\x07\x00".
"\x15\x39\x07\x00\x15\x4e\x07\x00\x15\x63\x07\x00\x15\x78\x07\x00".
"\x15\x8d\x07\x00\x15\xa2\x07\x00\x15\xb7\x07\x00\x15\xcc\x07\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\xe1\x07\x00\x15\xf6\x07\x00\x15\x0b\x08\x00\x15\x20\x08\x00".
"\x15\x35\x08\x00\x15\x4a\x08\x00\x15\x5f\x08\x00\x15\x74\x08\x00".
"\x15\x89\x08\x00\x15\x9e\x08\x00\x15\xb3\x08\x00\x15\xc8\x08\x00".
"\x15\xdd\x08\x00\x15\xf2\x08\x00\x15\x07\x09\x00\x15\x1c\x09\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x31\x09\x00\x15\x46\x09\x00\x15\x5b\x09\x00\x15\x70\x09\x00".
"\x15\x85\x09\x00\x15\x9a\x09\x00\x15\xaf\x09\x00\x15\xc4\x09\x00".
"\x15\xd9\x09\x00\x15\xee\x09\x00\x15\x03\x0a\x00\x15\x18\x0a\x00".
"\x15\x2d\x0a\x00\x15\x42\x0a\x00\x15\x57\x0a\x00\x15\x6c\x0a\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x81\x0a\x00\x15\x96\x0a\x00\x15\xab\x0a\x00\x15\xc0\x0a\x00".
"\x15\xd5\x0a\x00\x15\xea\x0a\x00\x15\xff\x0a\x00\x15\x14\x0b\x00".
"\x15\x29\x0b\x00\x15\x3e\x0b\x00\x15\x53\x0b\x00\x15\x68\x0b\x00".
"\x15\x7d\x0b\x00\x15\x92\x0b\x00\x15\xa7\x0b\x00\x15\xbc\x0b\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\xd1\x0b\x00\x15\xe6\x0b\x00\x15\xfb\x0b\x00\x15\x10\x0c\x00".
"\x15\x25\x0c\x00\x15\x3a\x0c\x00\x15\x4f\x0c\x00\x15\x64\x0c\x00".
"\x15\x79\x0c\x00\x15\x8e\x0c\x00\x15\xa3\x0c\x00\x15\xb8\x0c\x00".
"\x15\xcd\x0c\x00\x15\xe2\x0c\x00\x15\xf7\x0c\x00\x15\x0c\x0d\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x21\x0d\x00\x15\x36\x0d\x00\x15\x4b\x0d\x00\x15\x60\x0d\x00".
"\x15\x75\x0d\x00\x15\x8a\x0d\x00\x15\x9f\x0d\x00\x15\xb4\x0d\x00".
"\x15\xc9\x0d\x00\x15\xde\x0d\x00\x15\xf3\x0d\x00\x15\x08\x0e\x00".
"\x15\x1d\x0e\x00\x15\x32\x0e\x00\x15\x47\x0e\x00\x15\x5c\x0e\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x71\x0e\x00\x15\x86\x0e\x00\x15\x9b\x0e\x00\x15\xb0\x0e\x00".
"\x15\xc5\x0e\x00\x15\xda\x0e\x00\x15\xef\x0e\x00\x15\x04\x0f\x00".
"\x15\x19\x0f\x00\x15\x2e\x0f\x00\x15\x43\x0f\x00\x15\x58\x0f\x00".
"\x15\x6d\x0f\x00\x15\x82\x0f\x00\x15\x97\x0f\x00\x15\xac\x0f\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\xc1\x0f\x00\x15\xd6\x0f\x00\x15\xeb\x0f\x00\x15\x00\x10\x00".
"\x15\x15\x10\x00\x15\x2a\x10\x00\x15\x3f\x10\x00\x15\x54\x10\x00".
"\x15\x69\x10\x00\x15\x7e\x10\x00\x15\x93\x10\x00\x15\xa8\x10\x00".
"\x15\xbd\x10\x00\x15\xd2\x10\x00\x15\xe7\x10\x00\x15\xfc\x10\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x11\x11\x00\x15\x26\x11\x00\x15\x3b\x11\x00\x15\x50\x11\x00".
"\x15\x65\x11\x00\x15\x7a\x11\x00\x15\x8f\x11\x00\x15\xa4\x11\x00".
"\x15\xb9\x11\x00\x15\xce\x11\x00\x15\xe3\x11\x00\x15\xf8\x11\x00".
"\x15\x0d\x12\x00\x15\x22\x12\x00\x15\x37\x12\x00\x15\x4c\x12\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\x61\x12\x00\x15\x76\x12\x00\x15\x8b\x12\x00\x15\xa0\x12\x00".
"\x15\xb5\x12\x00\x15\xca\x12\x00\x15\xdf\x12\x00\x15\xf4\x12\x00".
"\x15\x09\x13\x00\x15\x1e\x13\x00\x15\x33\x13\x00\x15\x48\x13\x00".
"\x15\x5d\x13\x00\x15\x72\x13\x00\x15\x87\x13\x00\x15\x9c\x13\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x15\xb1\x13\x00\x15\xc6\x13\x00\x15\xdb\x13\x00\x15\xf0\x13\x00".
"\x15\x05\x14\x00\x15\x1a\x14\x00\x15\x2f\x14\x00\x15\x44\x14\x00".
"\x15\x59\x14\x00\x15\x6e\x14\x00\x15\x83\x14\x00\x15\x98\x14\x00".
"\x15\xad\x14\x00\x15\xc2\x14\x00\x15\xd7\x14\x00\x15\xec\x14\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00".
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
$this->gen->init();
}
public function generate(){
for($Z = 0; $Z < 16; ++$Z){
for($X = 0; $X < 16; ++$X){
$chunk = str_pad($this->getChunk($X, $Z), 86012, "\x00", STR_PAD_RIGHT);
$this->raw .= Utils::writeLInt(strlen($chunk)) . $chunk;
}
console("[DEBUG] Generating level ".ceil(($Z + 1)/0.16)."%", true, true, 2);
}
return true;
}
private function getChunk($X, $Z){
$chunk = b"";
$columns = array();
$X *= 16;
$Z *= 16;
for($x = 0; $x < 16; ++$x){
for($z = 0; $z < 16; ++$z){
$columns[$x * 16 + $z] = $this->gen->getColumn($X + $x, $Z + $z);
}
}
for($i = 0; $i < 4; ++$i){
for($x = 0; $x < 16; ++$x){
for($z = 0; $z < 16; ++$z){
$chunk .= $columns[$x * 16 + $z][$i];
}
}
}
unset($columns);
return $chunk;
}
public function save($dir, $name){
@mkdir($dir, 0777, true);
file_put_contents($dir."chunks.dat", $this->raw);
$s = $this->getSpawn();
$array = array();
file_put_contents($dir."entities.dat", serialize($array));
file_put_contents($dir."tileEntities.dat", serialize($array));
$level = array(
"LevelName" => $name,
"Time" => 0,
"Gamemode" => 1,
"RandomSeed" => $this->seed,
"Generator" => $this->genName,
"SpawnX" => $s[0],
"SpawnY" => $s[1],
"SpawnZ" => $s[2],
);
file_put_contents($dir."level.dat", serialize($level));
}
}

View File

@ -1,66 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class NormalGenerator{
private $config, $spawn, $structure;
public function __construct($seed){
$this->config = array(
"seed" => (int) $seed,
);
}
public function set($name, $value){
$this->config[$name] = $value;
}
public function init(){
$this->spawn = array(128, 128, 128);
}
public function getSpawn(){
return $this->spawn;
}
public function getColumn($x, $z){
$x = (int) $x;
$z = (int) $z;
$column = $this->structure;
if(floor(sqrt(pow($x - $this->spawn[0], 2) + pow($z - $this->spawn[2], 2))) <= $this->config["spawn-radius"]){
$column[0]{strlen($column[0])-1} = chr($this->config["spawn-surface"]);
}
if(($x % 8) === 0 and ($z % 8) === 0 and $this->config["torches"] == "1"){
$column[0] .= chr(50);
}
$column[0] .= str_repeat(chr(0), 128 - strlen($column[0]));
$column[1] .= str_repeat(chr(0), 64 - strlen($column[1]));
$column[2] .= str_repeat(chr(0), 64 - strlen($column[2]));
$column[3] .= str_repeat(chr(0), 64 - strlen($column[3]));
return $column;
}
}

View File

@ -1,107 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class SuperflatGenerator{
private $config, $spawn, $structure;
public function __construct($seed){
$this->config = array(
"preset" => "7;20x1;3x3;2",
"spawn-surface" => 24,
"spawn-radius" => 10,
"torches" => 0,
"seed" => (int) $seed,
);
$this->parsePreset();
}
public function set($name, $value){
$this->config[$name] = $value;
if($name === "preset"){
$this->parsePreset();
}
}
private function parsePreset(){
$this->structure = array(
0 => "",
1 => "",
2 => str_repeat("\x00", 64),
3 => str_repeat("\x00", 64),
);
$preset = explode(";", trim($this->config["preset"]));
foreach($preset as $i => $data){
$num = 1;
if(preg_match('#([a-zA-Z\-_]*)\((.*)\)#', $data, $matches) > 0){ //Property
$this->config[$matches[1]] = $matches[2];
continue;
}elseif(preg_match('#([0-9]*)x([0-9:]*)#', $data, $matches) > 0){
$num = (int) $matches[1];
$d = explode(":", $matches[2]);
}else{
$d = explode(":", $data);
}
$block = (int) array_shift($d);
$meta = (int) @array_shift($d);
for($j = 0; $j < $num; ++$j){
$this->structure[0] .= chr($block & 0xFF);
$this->structure[1] .= substr(dechex($meta & 0x0F), -1);
}
}
$this->structure[1] = pack("h*", str_pad($this->structure[1], (strlen($this->structure[1])&0xFE) + 2, "0", STR_PAD_RIGHT)); //invert nibbles
$this->structure[0] = substr($this->structure[0], 0, 128);
$this->structure[1] = substr($this->structure[1], 0, 64);
$this->structure[2] = substr($this->structure[2], 0, 64);
$this->structure[3] = substr($this->structure[3], 0, 64);
}
public function init(){
$this->spawn = array(128, strlen($this->structure[0]), 128);
}
public function getSpawn(){
return $this->spawn;
}
public function getColumn($x, $z){
$x = (int) $x;
$z = (int) $z;
$column = $this->structure;
if(floor(sqrt(pow($x - $this->spawn[0], 2) + pow($z - $this->spawn[2], 2))) <= $this->config["spawn-radius"]){
$column[0]{strlen($column[0])-1} = chr($this->config["spawn-surface"]);
}
if(($x % 8) === 0 and ($z % 8) === 0 and $this->config["torches"] == "1"){
$column[0] .= chr(50);
}
$column[0] .= str_repeat(chr(0), 128 - strlen($column[0]));
$column[1] .= str_repeat(chr(0), 64 - strlen($column[1]));
$column[2] .= str_repeat(chr(0), 64 - strlen($column[2]));
$column[3] .= str_repeat(chr(0), 64 - strlen($column[3]));
return $column;
}
}

View File

@ -1,97 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
require_once("classes/world/generator/object/tree/TreeObject.php");
class PineTreeObject extends TreeObject{
var $type = 1;
private $totalHeight = 8;
private $leavesSizeY = -1;
private $leavesAbsoluteMaxRadius = -1;
public function canPlaceObject(LevelAPI $level, $x, $y, $z){
$this->findRandomLeavesSize();
$checkRadius = 0;
for($yy = 0; $yy < $this->totalHeight; ++$yy) {
if($yy === $this->leavesSizeY) {
$checkRadius = $this->leavesAbsoluteMaxRadius;
}
for($xx = -$checkRadius; $xx < ($checkRadius + 1); ++$xx){
for($zz = -$checkRadius; $zz < ($checkRadius + 1); ++$zz){
$block = $level->getBlock($x + $xx, $y + $yy, $z + $zz);
if(!isset($this->overridable[$block[0]])){
return false;
}
}
}
}
return true;
}
private function findRandomLeavesSize(){
$this->totalHeight += mt_rand(-1, 2);
$this->leavesSizeY = 1 + mt_rand(0,2);
$this->leavesAbsoluteMaxRadius = 2 + mt_rand(0, 2);
}
public function placeObject(LevelAPI $level, $x, $y, $z){
if($this->leavesSizeY === -1 or $this->leavesAbsoluteMaxRadius === -1) {
$this->findRandomLeavesSize();
}
$level->setBlock($x, $y - 1, $z, 3, 0);
$leavesRadius = mt_rand(0,2);
$leavesMaxRadius = 1;
$leavesBottomY = $this->totalHeight - $this->leavesSizeY;
$firstMaxedRadius = false;
for($leavesY = 0; $leavesY < ($leavesBottomY + 1); ++$leavesY) {
$yy = $this->totalHeight - $leavesY;
for ($xx = -$leavesRadius; $xx < ($leavesRadius + 1); ++$xx) {
for ($zz = -$leavesRadius; $zz < ($leavesRadius + 1); ++$zz) {
if (abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
$level->setBlock($x + $xx, $y + $yy, $z + $zz, 18, $this->type);
}
}
}
if ($leavesRadius >= $leavesMaxRadius) {
$leavesRadius = $firstMaxedRadius ? 1 : 0;
$firstMaxedRadius = true;
if (++$leavesMaxRadius > $this->leavesAbsoluteMaxRadius) {
$leavesMaxRadius = $this->leavesAbsoluteMaxRadius;
}
}else{
++$leavesRadius;
}
}
$trunkHeightReducer = mt_rand(0,3);
for($yy = 0; $yy < ($this->totalHeight - $trunkHeightReducer); ++$yy){
$level->setBlock($x, $y + $yy, $z, 17, $this->type);
}
}
}

View File

@ -1,79 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
require_once("classes/world/generator/object/tree/TreeObject.php");
class SmallTreeObject extends TreeObject{
var $type = 0;
private $totalHeight = 6;
private $leavesHeight = 3;
protected $radiusIncrease = 0;
private $addLeavesVines = false;
private $addLogVines = false;
private $addCocoaPlants = false;
public function canPlaceObject(LevelAPI $level, $x, $y, $z){
$radiusToCheck = $this->radiusIncrease;
for ($yy = 0; $yy < $this->totalHeight + 2; ++$yy) {
if ($yy == 1 or $yy === $this->totalHeight - 1) {
++$radiusToCheck;
}
for($xx = -$radiusToCheck; $xx < ($radiusToCheck + 1); ++$xx){
for($zz = -$radiusToCheck; $zz < ($radiusToCheck + 1); ++$zz){
$block = $level->getBlock($x + $xx, $y + $yy, $z + $zz);
if(!isset($this->overridable[$block[0]])){
return false;
}
}
}
}
return true;
}
public function placeObject(LevelAPI $level, $x, $y, $z){
$level->setBlock($x, $y - 1, $z, 3, 0);
$this->totalHeight += mt_rand(-1, 3);
$this->leavesHeight += mt_rand(0, 1);
for($yy = ($this->totalHeight - $this->leavesHeight); $yy < ($this->totalHeight + 1); ++$yy){
$yRadius = ($yy - $this->totalHeight);
$xzRadius = (int) (($this->radiusIncrease + 1) - $yRadius / 2);
for($xx = -$xzRadius; $xx < ($xzRadius + 1); ++$xx){
for($zz = -$xzRadius; $zz < ($xzRadius + 1); ++$zz){
if((abs($xx) != $xzRadius or abs($zz) != $xzRadius) and $yRadius != 0){
$level->setBlock($x + $xx, $y + $yy, $z + $zz, 18, $this->type);
}
}
}
}
for($yy = 0; $yy < ($this->totalHeight - 1); ++$yy){
$level->setBlock($x, $y + $yy, $z, 17, $this->type);
}
}
}

View File

@ -1,88 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
require_once("classes/world/generator/object/tree/TreeObject.php");
class SpruceTreeObject extends TreeObject{
var $type = 1;
private $totalHeight = 8;
private $leavesBottomY = -1;
private $leavesMaxRadius = -1;
public function canPlaceObject(LevelAPI $level, $x, $y, $z){
$this->findRandomLeavesSize();
$checkRadius = 0;
for($yy = 0; $yy < $this->totalHeight + 2; ++$yy) {
if($yy === $this->leavesBottomY) {
$checkRadius = $this->leavesMaxRadius;
}
for($xx = -$checkRadius; $xx < ($checkRadius + 1); ++$xx){
for($zz = -$checkRadius; $zz < ($checkRadius + 1); ++$zz){
$block = $level->getBlock($x + $xx, $y + $yy, $z + $zz);
if(!isset($this->overridable[$block[0]])){
return false;
}
}
}
}
return true;
}
private function findRandomLeavesSize(){
$this->totalHeight += mt_rand(-1, 2);
$this->leavesBottomY = (int) ($this->totalHeight - mt_rand(1,2) - 3);
$this->leavesMaxRadius = 1 + mt_rand(0, 1);
}
public function placeObject(LevelAPI $level, $x, $y, $z){
if($this->leavesBottomY === -1 or $this->leavesMaxRadius === -1) {
$this->findRandomLeavesSize();
}
$level->setBlock($x, $y - 1, $z, 3, 0);
$leavesRadius = 0;
for($yy = $this->totalHeight; $yy >= $this->leavesBottomY; --$yy){
for ($xx = -$leavesRadius; $xx < ($leavesRadius + 1); ++$xx) {
for ($zz = -$leavesRadius; $zz < ($leavesRadius + 1); ++$zz) {
if (abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
$level->setBlock($x + $xx, $y + $yy, $z + $zz, 18, $this->type);
}
}
}
if ($leavesRadius > 0 and $yy === ($y + $this->leavesBottomY + 1)) {
--$leavesRadius;
}elseif($leavesRadius < $this->leavesMaxRadius){
++$leavesRadius;
}
}
for($yy = 0; $yy < ($this->totalHeight - 1); ++$yy){
$level->setBlock($x, $y + $yy, $z, 17, $this->type);
}
}
}

View File

@ -1,62 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
class TreeObject{
var $overridable = array(
0 => true,
6 => true,
17 => true,
18 => true,
);
public static function growTree(LevelAPI $level, $block, $type){
switch($type){
case Sapling::SPRUCE:
if(mt_rand(0,1) == 1){
$tree = new SpruceTreeObject();
}else{
$tree = new PineTreeObject();
}
break;
case Sapling::BIRCH:
$tree = new SmallTreeObject();
$tree->type = Sapling::BIRCH;
break;
default:
case Sapling::OAK:
if(mt_rand(0,9) === 0){
$tree = new BigTreeObject();
}else{
$tree = new SmallTreeObject();
}
break;
}
if($tree->canPlaceObject($level, $block[2][0], $block[2][1], $block[2][2])){
$tree->placeObject($level, $block[2][0], $block[2][1], $block[2][2]);
}
}
}

View File

@ -1,43 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
set_time_limit(0);
date_default_timezone_set(@date_default_timezone_get());
gc_enable();
error_reporting(E_ALL ^ E_NOTICE);
ini_set("allow_url_fopen", 1);
ini_set("display_errors", 1);
ini_set('default_charset', 'utf-8');
define("FILE_PATH", dirname(__FILE__)."/../../");
set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH . PATH_SEPARATOR . FILE_PATH . "/src/" . PATH_SEPARATOR . FILE_PATH . "/src/classes/");
ini_set("memory_limit", "256M");
define("LOG", true);
define("MAGIC", "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78");
define("TEST_MD5", "d0ca3786e53b615bb4fb9f5094d5c9a7");
define("MAJOR_VERSION", "Alpha_1.0.8");
define("CURRENT_PROTOCOL", 5);
define("CURRENT_MINECRAFT_VERSION", "v0.5.0 alpha");

View File

@ -1,90 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
require_once(dirname(__FILE__)."/config.php");
require_once("common/functions.php");
if(strpos(strtoupper(php_uname("s")), "WIN") === false or arg("enable-ansi", false) === true){
define("ENABLE_ANSI", true);
}else{
define("ENABLE_ANSI", false);
}
set_error_handler("fatal_handler", E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_DEPRECATED);
$errors = 0;
if(version_compare("5.3.3", PHP_VERSION) > 0){
console("[ERROR] Use PHP >= 5.3.3", true, true, 0);
++$errors;
}elseif(version_compare("5.5.0", PHP_VERSION) <= 0){
console("[NOTICE] PocketMine-MP hasn't been tested with PHP >= 5.5", true, true, 0);
++$errors;
}
if(version_compare("5.4.0", PHP_VERSION) > 0){
console("[NOTICE] Use PHP >= 5.4.0 to increase performance", true, true, 0);
define("HEX2BIN", false);
}else{
define("HEX2BIN", true);
}
if(php_sapi_name() !== "cli"){
console("[ERROR] Use PHP-CLI to execute the library or create your own", true, true, 0);
++$errors;
}
if(!extension_loaded("sockets") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "sockets." . PHP_SHLIB_SUFFIX) === false){
console("[ERROR] Unable to find Socket extension", true, true, 0);
++$errors;
}
if(!extension_loaded("pthreads") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "pthreads." . PHP_SHLIB_SUFFIX) === false){
console("[ERROR] Unable to find pthreads extension. Use the Installer available in the Homepage", true, true, 0);
++$errors;
}
if(!extension_loaded("curl") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "curl." . PHP_SHLIB_SUFFIX) === false){
console("[ERROR] Unable to find cURL extension", true, true, 0);
++$errors;
}
if(!extension_loaded("sqlite3") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "sqlite3." . PHP_SHLIB_SUFFIX) === false){
console("[ERROR] Unable to find SQLite3 extension", true, true, 0);
++$errors;
}
if(!extension_loaded("zlib") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "zlib." . PHP_SHLIB_SUFFIX) === false){
console("[ERROR] Unable to find Zlib extension", true, true, 0);
++$errors;
}
if($errors > 0){
die();
}
require_all(FILE_PATH . "src/classes/");
?>

View File

@ -1,232 +0,0 @@
<?php
/*
-
/ \
/ \
/ PocketMine \
/ MP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
function kill($pid){
switch(Utils::getOS()){
case "win":
ob_start();
passthru("%WINDIR%\\System32\\taskkill.exe /F /PID ".((int) $pid));
ob_end_clean();
break;
case "mac":
case "linux":
default:
ob_start();
passthru("kill -9 ".((int) $pid));
ob_end_clean();
}
}
function require_all($path, &$count = 0){
$dir = dir($path."/");
while(false !== ($file = $dir->read())){
if($file !== "." and $file !== ".."){
if(!is_dir($path.$file) and strtolower(substr($file, -3)) === "php"){
require_once($path.$file);
++$count;
}elseif(is_dir($path.$file)){
require_all($path.$file."/", $count);
}
}
}
}
function hard_unset(&$var){
if(is_object($var)){
$unset = new ReflectionClass($var);
foreach($unset->getProperties() as $prop){
$prop->setAccessible(true);
@hard_unset($prop->getValue($var));
$prop->setValue($var, null);
}
$var = null;
unset($var);
}elseif(is_array($var)){
foreach($var as $i => $v){
hard_unset($var[$i]);
}
$var = null;
unset($var);
}else{
$var = null;
unset($var);
}
}
function parseNBTData($data){
$x = array();
if(isset($data["value"])){
return parseNBTData($data["value"]);
}
foreach($data as $d){
if(!isset($d["value"]) and is_array($d) and count($d) == 1){
return parseNBTData(array_pop($d));
}elseif(!isset($d["value"]) and is_array($d)){
$x[] = parseNBTData($d);
}elseif(is_array($d["value"]) and isset($d["name"])){
$x[$d["name"]] = parseNBTData($d["value"]);
}elseif(is_array($d["value"]) and $d["type"] == 10){
return parseNBTData($d["value"]);
}elseif($d["name"] != ""){
$x[$d["name"]] = $d["value"];
}
}
if(count($x) == 0){
$x = $data;
}
return $x;
}
function arg($name, $default = false){
global $arguments, $argv;
if(!isset($arguments)){
$arguments = arguments($argv);
}
if(isset($arguments["commands"][$name])){
return $arguments["commands"][$name];
}else{
return $default;
}
}
function arguments ( $args ){
if(!is_array($args)){
$args = array();
}
array_shift( $args );
$args = join( $args, ' ' );
preg_match_all('/ (--[\w\-]+ (?:[= ] [^-]+ [^\s-] )? ) | (-\w+) | (\w+) /x', $args, $match );
$args = array_shift( $match );
$ret = array(
'input' => array(),
'commands' => array(),
'flags' => array()
);
foreach ( $args as $arg ) {
// Is it a command? (prefixed with --)
if ( substr( $arg, 0, 2 ) === '--' ) {
$value = preg_split( '/[= ]/', $arg, 2 );
$com = substr( array_shift($value), 2 );
$value = join($value);
$ret['commands'][$com] = !empty($value) ? $value : true;
continue;
}
// Is it a flag? (prefixed with -)
if ( substr( $arg, 0, 1 ) === '-' ) {
$ret['flags'][] = substr( $arg, 1 );
continue;
}
$ret['input'][] = $arg;
continue;
}
return $ret;
}
function console($message, $EOL = true, $log = true, $level = 1){
if(!defined("DEBUG") or DEBUG >= $level){
$message .= $EOL === true ? PHP_EOL:"";
$time = (ENABLE_ANSI === true ? "\x1b[36m".date("H:i:s")."\x1b[0m":date("H:i:s")) . " ";
$replaced = preg_replace('/\x1b\[[0-9;]*m/', "", $time . $message);
if($log === true and (!defined("LOG") or LOG === true)){
logg($replaced, "console", false, $level);
}
if(ENABLE_ANSI === true){
if(preg_match("/\[([a-zA-Z0-9]*)\]/", $message, $matches) > 0){
$add = "\x1b";
switch($matches[1]){
case "ERROR":
$add .= "[31;1m";
break;
case "INTERNAL":
case "DEBUG":
$add .= "[30;1m";
break;
case "WARNING":
$add .= "[33;1m";
break;
case "NOTICE":
$add .= "[37;1m";
break;
default:
$add = "";
break;
}
$message = $time . $add . $message . "\x1b[0m";
}
}else{
$message = $replaced;
}
echo $message;
}
}
function fatal_handler($errno, $errstr, $errfile, $errline){
global $lasttrace;
console("[ERROR] A level ".$errno." error happened: \"$errstr\" in \"$errfile\" at line $errline", true, true, 0);
ob_start();
debug_print_backtrace();
$lasttrace = ob_get_contents();
ob_end_clean();
console("[ERROR] [Backtrace] $lasttrace", true, true, 0);
return false;
}
function logg($message, $name, $EOL = true, $level = 2, $close = false){
global $fpointers;
if((!defined("DEBUG") or DEBUG >= $level) and (!defined("LOG") or LOG === true)){
$message .= $EOL === true ? PHP_EOL:"";
if(!isset($fpointers)){
$fpointers = array();
}
if(!isset($fpointers[$name]) or $fpointers[$name] === false){
$fpointers[$name] = @fopen(FILE_PATH."logs/".$name.".log", "ab");
}
@fwrite($fpointers[$name], $message);
if($close === true){
fclose($fpointers[$name]);
unset($fpointers[$name]);
}
}
}

View File

@ -0,0 +1,135 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
*
*
*/
namespace pocketmine;
use pocketmine\utils\TextFormat;
/**
* Handles the achievement list and a bit more
*/
abstract class Achievement{
/**
* @var array[]
*/
public static $list = [
/*"openInventory" => array(
"name" => "Taking Inventory",
"requires" => [],
),*/
"mineWood" => [
"name" => "Getting Wood",
"requires" => [ //"openInventory",
],
],
"buildWorkBench" => [
"name" => "Benchmarking",
"requires" => [
"mineWood",
],
],
"buildPickaxe" => [
"name" => "Time to Mine!",
"requires" => [
"buildWorkBench",
],
],
"buildFurnace" => [
"name" => "Hot Topic",
"requires" => [
"buildPickaxe",
],
],
"acquireIron" => [
"name" => "Acquire hardware",
"requires" => [
"buildFurnace",
],
],
"buildHoe" => [
"name" => "Time to Farm!",
"requires" => [
"buildWorkBench",
],
],
"makeBread" => [
"name" => "Bake Bread",
"requires" => [
"buildHoe",
],
],
"bakeCake" => [
"name" => "The Lie",
"requires" => [
"buildHoe",
],
],
"buildBetterPickaxe" => [
"name" => "Getting an Upgrade",
"requires" => [
"buildPickaxe",
],
],
"buildSword" => [
"name" => "Time to Strike!",
"requires" => [
"buildWorkBench",
],
],
"diamonds" => [
"name" => "DIAMONDS!",
"requires" => [
"acquireIron",
],
],
];
public static function broadcast(Player $player, $achievementId){
if(isset(Achievement::$list[$achievementId])){
if(Server::getInstance()->getConfigString("announce-player-achievements", true) === true){
Server::getInstance()->broadcastMessage($player->getDisplayName() . " has just earned the achievement " . TextFormat::GREEN . Achievement::$list[$achievementId]["name"]);
}else{
$player->sendMessage("You have just earned the achievement " . TextFormat::GREEN . Achievement::$list[$achievementId]["name"]);
}
return true;
}
return false;
}
public static function add($achievementId, $achievementName, array $requires = []){
if(!isset(Achievement::$list[$achievementId])){
Achievement::$list[$achievementId] = [
"name" => $achievementName,
"requires" => $requires,
];
return true;
}
return false;
}
}

View File

@ -0,0 +1,32 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
class CompatibleClassLoader extends \BaseClassLoader{
/**
* @deprecated
*/
public function add($namespace, $paths){
$this->addPath(array_shift($paths));
}
}

View File

@ -0,0 +1,248 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
*
*
*/
namespace pocketmine;
use pocketmine\network\protocol\Info;
use pocketmine\plugin\PluginBase;
use pocketmine\plugin\PluginLoadOrder;
use pocketmine\utils\Utils;
use pocketmine\utils\VersionString;
use raklib\RakLib;
class CrashDump{
/** @var Server */
private $server;
private $fp;
private $time;
private $data = [];
private $encodedData = null;
private $path;
public function __construct(Server $server){
$this->time = time();
$this->server = $server;
$this->path = $this->server->getDataPath() . "CrashDump_" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
$this->fp = fopen($this->path, "wb");
$this->data["time"] = $this->time;
$this->addLine($this->server->getName() . " Crash Dump " . date("D M j H:i:s T Y", $this->time));
$this->addLine();
$this->baseCrash();
$this->generalData();
$this->pluginsData();
$this->extraData();
$this->encodeData();
}
public function getPath(){
return $this->path;
}
public function getEncodedData(){
return $this->encodedData;
}
public function getData(){
return $this->data;
}
private function encodeData(){
$this->addLine();
$this->addLine("----------------------REPORT THE DATA BELOW THIS LINE-----------------------");
$this->addLine();
$this->addLine("===BEGIN CRASH DUMP===");
$this->encodedData = zlib_encode(json_encode($this->data, JSON_UNESCAPED_SLASHES), ZLIB_ENCODING_DEFLATE, 9);
foreach(str_split(base64_encode($this->encodedData), 76) as $line){
$this->addLine($line);
}
$this->addLine("===END CRASH DUMP===");
}
private function pluginsData(){
if(class_exists("pocketmine\\plugin\\PluginManager", false)){
$this->addLine();
$this->addLine("Loaded plugins:");
$this->data["plugins"] = [];
foreach($this->server->getPluginManager()->getPlugins() as $p){
$d = $p->getDescription();
$this->data["plugins"][$d->getName()] = [
"name" => $d->getName(),
"version" => $d->getVersion(),
"authors" => $d->getAuthors(),
"api" => $d->getCompatibleApis(),
"enabled" => $p->isEnabled(),
"depends" => $d->getDepend(),
"softDepends" => $d->getSoftDepend(),
"main" => $d->getMain(),
"load" => $d->getOrder() === PluginLoadOrder::POSTWORLD ? "POSTWORLD" : "STARTUP",
"website" => $d->getWebsite()
];
$this->addLine($d->getName() . " " . $d->getVersion() . " by " . implode(", ", $d->getAuthors()) . " for API(s) " . implode(", ", $d->getCompatibleApis()));
}
}
}
private function extraData(){
global $arguments;
if($this->server->getProperty("auto-report.send-settings", true) !== false){
$this->data["parameters"] = (array) $arguments;
$this->data["server.properties"] = @file_get_contents($this->server->getDataPath() . "server.properties");
$this->data["server.properties"] = preg_replace("#^rcon\\.password=(.*)$#m", "rcon.password=******", $this->data["server.properties"]);
$this->data["pocketmine.yml"] = @file_get_contents($this->server->getDataPath() . "pocketmine.yml");
}else{
$this->data["pocketmine.yml"] = "";
$this->data["server.properties"] = "";
$this->data["parameters"] = [];
}
$extensions = [];
foreach(get_loaded_extensions() as $ext){
$extensions[$ext] = phpversion($ext);
}
$this->data["extensions"] = $extensions;
if($this->server->getProperty("auto-report.send-phpinfo", true) !== false){
ob_start();
phpinfo();
$this->data["phpinfo"] = ob_get_contents();
ob_end_clean();
}
}
private function baseCrash(){
global $lastExceptionError, $lastError;
if(isset($lastExceptionError)){
$error = $lastExceptionError;
}else{
$error = (array) error_get_last();
$error["trace"] = @getTrace(4);
$errorConversion = [
E_ERROR => "E_ERROR",
E_WARNING => "E_WARNING",
E_PARSE => "E_PARSE",
E_NOTICE => "E_NOTICE",
E_CORE_ERROR => "E_CORE_ERROR",
E_CORE_WARNING => "E_CORE_WARNING",
E_COMPILE_ERROR => "E_COMPILE_ERROR",
E_COMPILE_WARNING => "E_COMPILE_WARNING",
E_USER_ERROR => "E_USER_ERROR",
E_USER_WARNING => "E_USER_WARNING",
E_USER_NOTICE => "E_USER_NOTICE",
E_STRICT => "E_STRICT",
E_RECOVERABLE_ERROR => "E_RECOVERABLE_ERROR",
E_DEPRECATED => "E_DEPRECATED",
E_USER_DEPRECATED => "E_USER_DEPRECATED",
];
$error["fullFile"] = $error["file"];
$error["file"] = cleanPath($error["file"]);
$error["type"] = isset($errorConversion[$error["type"]]) ? $errorConversion[$error["type"]] : $error["type"];
if(($pos = strpos($error["message"], "\n")) !== false){
$error["message"] = substr($error["message"], 0, $pos);
}
}
if(isset($lastError)){
$this->data["lastError"] = $lastError;
}
$this->data["error"] = $error;
unset($this->data["error"]["fullFile"]);
unset($this->data["error"]["trace"]);
$this->addLine("Error: " . $error["message"]);
$this->addLine("File: " . $error["file"]);
$this->addLine("Line: " . $error["line"]);
$this->addLine("Type: " . $error["type"]);
if(strpos($error["file"], "src/pocketmine/") === false and strpos($error["file"], "src/raklib/") === false and file_exists($error["fullFile"])){
$this->addLine();
$this->addLine("THIS CRASH WAS CAUSED BY A PLUGIN");
$this->data["plugin"] = true;
$reflection = new \ReflectionClass(PluginBase::class);
$file = $reflection->getProperty("file");
$file->setAccessible(true);
foreach($this->server->getPluginManager()->getPlugins() as $plugin){
$filePath = \pocketmine\cleanPath($file->getValue($plugin));
if(strpos($error["file"], $filePath) === 0){
$this->data["plugin"] = $plugin->getName();
$this->addLine("BAD PLUGIN: " . $plugin->getDescription()->getFullName());
break;
}
}
}else{
$this->data["plugin"] = false;
}
$this->addLine();
$this->addLine("Code:");
$this->data["code"] = [];
if($this->server->getProperty("auto-report.send-code", true) !== false){
$file = @file($error["fullFile"], FILE_IGNORE_NEW_LINES);
for($l = max(0, $error["line"] - 10); $l < $error["line"] + 10; ++$l){
$this->addLine("[" . ($l + 1) . "] " . @$file[$l]);
$this->data["code"][$l + 1] = @$file[$l];
}
}
$this->addLine();
$this->addLine("Backtrace:");
foreach(($this->data["trace"] = $error["trace"]) as $line){
$this->addLine($line);
}
$this->addLine();
}
private function generalData(){
$version = new VersionString();
$this->data["general"] = [];
$this->data["general"]["version"] = $version->get(false);
$this->data["general"]["build"] = $version->getBuild();
$this->data["general"]["protocol"] = Info::CURRENT_PROTOCOL;
$this->data["general"]["api"] = \pocketmine\API_VERSION;
$this->data["general"]["git"] = \pocketmine\GIT_COMMIT;
$this->data["general"]["raklib"] = RakLib::VERSION;
$this->data["general"]["uname"] = php_uname("a");
$this->data["general"]["php"] = phpversion();
$this->data["general"]["zend"] = zend_version();
$this->data["general"]["php_os"] = PHP_OS;
$this->data["general"]["os"] = Utils::getOS();
$this->addLine("PocketMine-MP version: " . $version->get(false) . " #" . $version->getBuild() . " [Protocol " . Info::CURRENT_PROTOCOL . "; API " . API_VERSION . "]");
$this->addLine("Git commit: " . GIT_COMMIT);
$this->addLine("uname -a: " . php_uname("a"));
$this->addLine("PHP Version: " . phpversion());
$this->addLine("Zend version: " . zend_version());
$this->addLine("OS : " . PHP_OS . ", " . Utils::getOS());
}
public function addLine($line = ""){
fwrite($this->fp, $line . PHP_EOL);
}
public function add($str){
fwrite($this->fp, $str);
}
}

View File

@ -0,0 +1,78 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
use pocketmine\permission\ServerOperator;
interface IPlayer extends ServerOperator{
/**
* @return bool
*/
public function isOnline();
/**
* @return string
*/
public function getName();
/**
* @return bool
*/
public function isBanned();
/**
* @param bool $banned
*/
public function setBanned($banned);
/**
* @return bool
*/
public function isWhitelisted();
/**
* @param bool $value
*/
public function setWhitelisted($value);
/**
* @return Player|null
*/
public function getPlayer();
/**
* @return int|double
*/
public function getFirstPlayed();
/**
* @return int|double
*/
public function getLastPlayed();
/**
* @return mixed
*/
public function hasPlayedBefore();
}

View File

@ -0,0 +1,134 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
use pocketmine\metadata\MetadataValue;
use pocketmine\nbt\tag\Compound;
use pocketmine\plugin\Plugin;
class OfflinePlayer implements IPlayer{
private $name;
private $server;
private $namedtag;
/**
* @param Server $server
* @param string $name
*/
public function __construct(Server $server, $name){
$this->server = $server;
$this->name = $name;
if(file_exists($this->server->getDataPath() . "players/" . strtolower($this->getName()) . ".dat")){
$this->namedtag = $this->server->getOfflinePlayerData($this->name);
}else{
$this->namedtag = null;
}
}
public function isOnline(){
return $this->getPlayer() !== null;
}
public function getName(){
return $this->name;
}
public function getServer(){
return $this->server;
}
public function isOp(){
return $this->server->isOp(strtolower($this->getName()));
}
public function setOp($value){
if($value === $this->isOp()){
return;
}
if($value === true){
$this->server->addOp(strtolower($this->getName()));
}else{
$this->server->removeOp(strtolower($this->getName()));
}
}
public function isBanned(){
return $this->server->getNameBans()->isBanned(strtolower($this->getName()));
}
public function setBanned($value){
if($value === true){
$this->server->getNameBans()->addBan($this->getName(), null, null, null);
}else{
$this->server->getNameBans()->remove($this->getName());
}
}
public function isWhitelisted(){
return $this->server->isWhitelisted(strtolower($this->getName()));
}
public function setWhitelisted($value){
if($value === true){
$this->server->addWhitelist(strtolower($this->getName()));
}else{
$this->server->removeWhitelist(strtolower($this->getName()));
}
}
public function getPlayer(){
return $this->server->getPlayerExact($this->getName());
}
public function getFirstPlayed(){
return $this->namedtag instanceof Compound ? $this->namedtag["firstPlayed"] : null;
}
public function getLastPlayed(){
return $this->namedtag instanceof Compound ? $this->namedtag["lastPlayed"] : null;
}
public function hasPlayedBefore(){
return $this->namedtag instanceof Compound;
}
public function setMetadata($metadataKey, MetadataValue $metadataValue){
$this->server->getPlayerMetadata()->setMetadata($this, $metadataKey, $metadataValue);
}
public function getMetadata($metadataKey){
return $this->server->getPlayerMetadata()->getMetadata($this, $metadataKey);
}
public function hasMetadata($metadataKey){
return $this->server->getPlayerMetadata()->hasMetadata($this, $metadataKey);
}
public function removeMetadata($metadataKey, Plugin $plugin){
$this->server->getPlayerMetadata()->removeMetadata($this, $metadataKey, $plugin);
}
}

2681
src/pocketmine/Player.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,471 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace {
function safe_var_dump(){
static $cnt = 0;
foreach(func_get_args() as $var){
switch(true){
case is_array($var):
echo str_repeat(" ", $cnt) . "array(" . count($var) . ") {" . PHP_EOL;
foreach($var as $key => $value){
echo str_repeat(" ", $cnt + 1) . "[" . (is_integer($key) ? $key : '"' . $key . '"') . "]=>" . PHP_EOL;
++$cnt;
safe_var_dump($value);
--$cnt;
}
echo str_repeat(" ", $cnt) . "}" . PHP_EOL;
break;
case is_integer($var):
echo str_repeat(" ", $cnt) . "int(" . $var . ")" . PHP_EOL;
break;
case is_float($var):
echo str_repeat(" ", $cnt) . "float(" . $var . ")" . PHP_EOL;
break;
case is_bool($var):
echo str_repeat(" ", $cnt) . "bool(" . ($var === true ? "true" : "false") . ")" . PHP_EOL;
break;
case is_string($var):
echo str_repeat(" ", $cnt) . "string(" . strlen($var) . ") \"$var\"" . PHP_EOL;
break;
case is_resource($var):
echo str_repeat(" ", $cnt) . "resource() of type (" . get_resource_type($var) . ")" . PHP_EOL;
break;
case is_object($var):
echo str_repeat(" ", $cnt) . "object(" . get_class($var) . ")" . PHP_EOL;
break;
case is_null($var):
echo str_repeat(" ", $cnt) . "NULL" . PHP_EOL;
break;
}
}
}
function dummy(){
}
}
namespace pocketmine {
use pocketmine\utils\Binary;
use pocketmine\utils\MainLogger;
use pocketmine\utils\Utils;
use pocketmine\wizard\Installer;
const VERSION = "Alpha_1.4dev";
const API_VERSION = "1.7.1";
const CODENAME = "絶好(Zekkou)ケーキ(Cake)";
const MINECRAFT_VERSION = "v0.10.0 alpha";
/*
* Startup code. Do not look at it, it may harm you.
* Most of them are hacks to fix date-related bugs, or basic functions used after this
* This is the only non-class based file on this project.
* Enjoy it as much as I did writing it. I don't want to do it again.
*/
if(\Phar::running(true) !== ""){
@define("pocketmine\\PATH", \Phar::running(true) . "/");
}else{
@define("pocketmine\\PATH", \getcwd() . DIRECTORY_SEPARATOR);
}
if(!extension_loaded("pthreads")){
echo "[CRITICAL] Unable to find the pthreads extension." . PHP_EOL;
echo "[CRITICAL] Please use the installer provided on the homepage." . PHP_EOL;
exit(1);
}
if(!class_exists("ClassLoader", false)){
require_once(\pocketmine\PATH . "src/spl/ClassLoader.php");
require_once(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
require_once(\pocketmine\PATH . "src/pocketmine/CompatibleClassLoader.php");
}
$autoloader = new CompatibleClassLoader();
$autoloader->addPath(\pocketmine\PATH . "src");
$autoloader->addPath(\pocketmine\PATH . "src" . DIRECTORY_SEPARATOR . "spl");
$autoloader->addPath(\pocketmine\PATH . "src" . DIRECTORY_SEPARATOR . "raklib");
$autoloader->register(true);
set_time_limit(0); //Who set it to 30 seconds?!?!
gc_enable();
error_reporting(-1);
ini_set("allow_url_fopen", 1);
ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
ini_set("default_charset", "utf-8");
ini_set("memory_limit", "256M"); //Default
define("pocketmine\\START_TIME", microtime(true));
$opts = getopt("", ["enable-ansi", "disable-ansi", "data:", "plugins:", "no-wizard", "enable-profiler"]);
define("pocketmine\\DATA", isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : \getcwd() . DIRECTORY_SEPARATOR);
define("pocketmine\\PLUGIN_PATH", isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : \getcwd() . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR);
define("pocketmine\\ANSI", (Utils::getOS() !== "win" or isset($opts["enable-ansi"])) and !isset($opts["disable-ansi"]));
@mkdir(\pocketmine\DATA, 0777, true);
//Logger has a dependency on timezone, so we'll set it to UTC until we can get the actual timezone.
date_default_timezone_set("UTC");
$logger = new MainLogger(\pocketmine\DATA . "server.log", \pocketmine\ANSI);
if(!ini_get("date.timezone")){
if(($timezone = detect_system_timezone()) and date_default_timezone_set($timezone)){
//Success! Timezone has already been set and validated in the if statement.
//This here is just for redundancy just in case some program wants to read timezone data from the ini.
ini_set("date.timezone", $timezone);
}else{
//If system timezone detection fails or timezone is an invalid value.
if($response = Utils::getURL("http://ip-api.com/json")
and $ip_geolocation_data = json_decode($response, true)
and $ip_geolocation_data['status'] != 'fail'
and date_default_timezone_set($ip_geolocation_data['timezone']))
{
//Again, for redundancy.
ini_set("date.timezone", $ip_geolocation_data['timezone']);
}else{
ini_set("date.timezone", "UTC");
date_default_timezone_set("UTC");
$logger->warning("Timezone could not be automatically determined. An incorrect timezone will result in incorrect timestamps on console logs. It has been set to \"UTC\" by default. You can change it on the php.ini file.");
}
}
}else{
/*
* This is here so that people don't come to us complaining and fill up the issue tracker when they put
* an incorrect timezone abbreviation in php.ini apparently.
*/
$default_timezone = date_default_timezone_get();
if(strpos($default_timezone, "/") === false){
$default_timezone = timezone_name_from_abbr($default_timezone);
ini_set("date.timezone", $default_timezone);
date_default_timezone_set($default_timezone);
}
}
function detect_system_timezone(){
switch(Utils::getOS()){
case 'win':
$regex = '/(UTC)(\+*\-*\d*\d*\:*\d*\d*)/';
/*
* wmic timezone get Caption
* Get the timezone offset
*
* Sample Output var_dump
* array(3) {
* [0] =>
* string(7) "Caption"
* [1] =>
* string(20) "(UTC+09:30) Adelaide"
* [2] =>
* string(0) ""
* }
*/
exec("wmic timezone get Caption", $output);
$string = trim(implode("\n", $output));
//Detect the Time Zone string
preg_match($regex, $string, $matches);
if(!isset($matches[2]))
{
return false;
}
$offset = $matches[2];
if($offset == ""){
return "UTC";
}
return parse_offset($offset);
break;
case 'linux':
// Ubuntu / Debian.
if(file_exists('/etc/timezone')){
$data = file_get_contents('/etc/timezone');
if($data){
return trim($data);
}
}
// RHEL / CentOS
if(file_exists('/etc/sysconfig/clock')){
$data = parse_ini_file('/etc/sysconfig/clock');
if(!empty($data['ZONE'])){
return trim($data['ZONE']);
}
}
//Portable method for incompatible linux distributions.
$offset = trim(exec('date +%:z'));
if($offset == "+00:00"){
return "UTC";
}
return parse_offset($offset);
break;
case 'mac':
if(is_link('/etc/localtime')){
$filename = readlink('/etc/localtime');
if(strpos($filename, '/usr/share/zoneinfo/') === 0){
$timezone = substr($filename, 20);
return trim($timezone);
}
}
return false;
break;
default:
return false;
break;
}
}
/**
* @param string $offset In the format of +09:00, +02:00, -04:00 etc.
* @return string
*/
function parse_offset($offset){
//Make signed offsets unsigned for date_parse
if(strpos($offset, '-') !== false){
$negative_offset = true;
$offset = str_replace('-', '', $offset);
}else{
if(strpos($offset, '+') !== false){
$negative_offset = false;
$offset = str_replace('+', '', $offset);
}else{
return false;
}
}
$parsed = date_parse($offset);
$offset = $parsed['hour'] * 3600 + $parsed['minute'] * 60 + $parsed['second'];
//After date_parse is done, put the sign back
if($negative_offset == true){
$offset = -abs($offset);
}
//And then, look the offset up.
//timezone_name_from_abbr is not used because it returns false on some(most) offsets because it's mapping function is weird.
//That's been a bug in PHP since 2008!
foreach(timezone_abbreviations_list() as $zones){
foreach($zones as $timezone){
if($timezone['offset'] == $offset){
return $timezone['timezone_id'];
}
}
}
return false;
}
if(isset($opts["enable-profiler"])){
if(function_exists("profiler_enable")){
\profiler_enable();
$logger->notice("Execution is being profiled");
}else{
$logger->notice("No profiler found. Please install https://github.com/krakjoe/profiler");
}
}
function kill($pid){
switch(Utils::getOS()){
case "win":
exec("taskkill.exe /F /PID " . ((int) $pid) . " > NUL");
break;
case "mac":
case "linux":
default:
exec("kill -9 " . ((int) $pid) . " > /dev/null 2>&1");
}
}
function getTrace($start = 1, $trace = null){
if($trace === null){
if(function_exists("xdebug_get_function_stack")){
$trace = array_reverse(xdebug_get_function_stack());
}else{
$e = new \Exception();
$trace = $e->getTrace();
}
}
$messages = [];
$j = 0;
for($i = (int) $start; isset($trace[$i]); ++$i, ++$j){
$params = "";
if(isset($trace[$i]["args"]) or isset($trace[$i]["params"])){
if(isset($trace[$i]["args"])){
$args = $trace[$i]["args"];
}else{
$args = $trace[$i]["params"];
}
foreach($args as $name => $value){
$params .= (is_object($value) ? get_class($value) . " " . (method_exists($value, "__toString") ? $value->__toString() : "object") : gettype($value) . " " . @strval($value)) . ", ";
}
}
$messages[] = "#$j " . (isset($trace[$i]["file"]) ? cleanPath($trace[$i]["file"]) : "") . "(" . (isset($trace[$i]["line"]) ? $trace[$i]["line"] : "") . "): " . (isset($trace[$i]["class"]) ? $trace[$i]["class"] . (($trace[$i]["type"] === "dynamic" or $trace[$i]["type"] === "->") ? "->" : "::") : "") . $trace[$i]["function"] . "(" . substr($params, 0, -2) . ")";
}
return $messages;
}
function cleanPath($path){
return rtrim(str_replace(["\\", ".php", "phar://", rtrim(str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PATH), "/"), rtrim(str_replace(["\\", "phar://"], ["/", ""], \pocketmine\PLUGIN_PATH), "/")], ["/", "", "", "", ""], $path), "/");
}
set_error_handler([\ExceptionHandler::class, "handler"], -1);
$errors = 0;
if(version_compare("5.6.0", PHP_VERSION) > 0){
$logger->critical("You must use PHP >= 5.6");
++$errors;
}
if(php_sapi_name() !== "cli"){
$logger->critical("You must run PocketMine-MP using the CLI.");
++$errors;
}
if(!extension_loaded("sockets")){
$logger->critical("Unable to find the Socket extension.");
++$errors;
}
$pthreads_version = phpversion("pthreads");
if(substr_count($pthreads_version, ".") < 2){
$pthreads_version = "0.$pthreads_version";
}
if(version_compare($pthreads_version, "2.0.8") < 0){
$logger->critical("pthreads >= 2.0.8 is required, while you have $pthreads_version.");
++$errors;
}
if(!extension_loaded("uopz")){
//$logger->notice("Couldn't find the uopz extension. Some functions may be limited");
}
if(extension_loaded("pocketmine")){
if(version_compare(phpversion("pocketmine"), "0.0.1") < 0){
$logger->critical("You have the native PocketMine extension, but your version is lower than 0.0.1.");
++$errors;
}elseif(version_compare(phpversion("pocketmine"), "0.0.4") > 0){
$logger->critical("You have the native PocketMine extension, but your version is higher than 0.0.4.");
++$errors;
}
}
if(!extension_loaded("Weakref") and !extension_loaded("weakref")){
$logger->critical("Unable to find the Weakref extension.");
++$errors;
}
if(!extension_loaded("curl")){
$logger->critical("Unable to find the cURL extension.");
++$errors;
}
if(!extension_loaded("sqlite3")){
$logger->critical("Unable to find the SQLite3 extension.");
++$errors;
}
if(!extension_loaded("yaml")){
$logger->critical("Unable to find the YAML extension.");
++$errors;
}
if(!extension_loaded("zlib")){
$logger->critical("Unable to find the Zlib extension.");
++$errors;
}
if($errors > 0){
$logger->critical("Please use the installer provided on the homepage, or recompile PHP again.");
$logger->shutdown();
$logger->join();
exit(1); //Exit with error
}
if(file_exists(\pocketmine\PATH . ".git/refs/heads/master")){ //Found Git information!
define("pocketmine\\GIT_COMMIT", strtolower(trim(file_get_contents(\pocketmine\PATH . ".git/refs/heads/master"))));
}else{ //Unknown :(
define("pocketmine\\GIT_COMMIT", str_repeat("00", 20));
}
@define("ENDIANNESS", (pack("d", 1) === "\77\360\0\0\0\0\0\0" ? Binary::BIG_ENDIAN : Binary::LITTLE_ENDIAN));
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
@ini_set("opcache.mmap_base", bin2hex(Utils::getRandomBytes(8, false))); //Fix OPCache address errors
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
new Installer();
}
if(substr(__FILE__, 0, 7) !== "phar://"){
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
}
ThreadManager::init();
$server = new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
$logger->info("Stopping other threads");
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
if($thread->isRunning()){
$logger->debug("Stopping " . (new \ReflectionClass($thread))->getShortName() . " thread");
if($thread instanceof Thread){
$thread->kill();
sleep(1);
if($thread->isRunning()){
$thread->detach();
}
}elseif($thread instanceof Worker){
$thread->kill();
sleep(1);
if($thread->isRunning()){
$thread->detach();
}
}
}elseif(!$thread->isJoined()){
$logger->debug("Joining " . (new \ReflectionClass($thread))->getShortName() . " thread");
$thread->join();
}
}
$logger->shutdown();
$logger->join();
exit(0);
}

2240
src/pocketmine/Server.php Normal file

File diff suppressed because it is too large Load Diff

34
src/pocketmine/Thread.php Normal file
View File

@ -0,0 +1,34 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
/**
* This class must be extended by all custom threading classes
*/
abstract class Thread extends \Thread{
public final function start($options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this);
return parent::start($options);
}
}

View File

@ -0,0 +1,69 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
class ThreadManager extends \Threaded{
/** @var ThreadManager */
private static $instance = null;
public static function init(){
self::$instance = new ThreadManager();
}
/**
* @return ThreadManager
*/
public static function getInstance(){
return self::$instance;
}
/**
* @param Worker|Thread $thread
*/
public function add($thread){
if($thread instanceof Thread or $thread instanceof Worker){
$this->{spl_object_hash($thread)} = $thread;
}
}
/**
* @param Worker|Thread $thread
*/
public function remove($thread){
if($thread instanceof Thread or $thread instanceof Worker){
unset($this->{spl_object_hash($thread)});
}
}
/**
* @return Worker[]|Thread[]
*/
public function getAll(){
$array = [];
foreach($this as $key => $thread){
$array[$key] = $thread;
}
return $array;
}
}

34
src/pocketmine/Worker.php Normal file
View File

@ -0,0 +1,34 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine;
/**
* This class must be extended by all custom threading classes
*/
abstract class Worker extends \Worker{
public final function start($options = PTHREADS_INHERIT_ALL){
ThreadManager::getInstance()->add($this);
return parent::start($options);
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class AcaciaWoodStairs extends Stair{
public function __construct($meta = 0){
parent::__construct(self::ACACIA_WOOD_STAIRS, $meta, "Acacia Wood Stairs");
}
public function getDrops(Item $item){
return [
[$this->id, 0, 1],
];
}
}

View File

@ -0,0 +1,51 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
/**
* Air block
*/
class Air extends Transparent{
public $isActivable = false;
public $breakable = false;
public $isFlowable = true;
public $isTransparent = true;
public $isReplaceable = true;
public $isPlaceable = false;
public $hasPhysics = false;
public $isSolid = false;
public $isFullBlock = true;
protected $id = self::AIR;
protected $meta = 0;
protected $name = "Air";
protected $hardness = 0;
public function __construct(){
}
public function getBoundingBox(){
return null;
}
}

View File

@ -0,0 +1,160 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\network\protocol\ChatPacket;
use pocketmine\Player;
class Bed extends Transparent{
public function __construct($type = 0){
parent::__construct(self::BED_BLOCK, $type, "Bed Block");
$this->isActivable = true;
$this->isFullBlock = false;
$this->hardness = 1;
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 0.5625,
$this->z + 1
);
}
public function onActivate(Item $item, Player $player = null){
$time = $this->getLevel()->getTime() % Level::TIME_FULL;
$isNight = ($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE);
if($player instanceof Player and !$isNight){
$pk = new ChatPacket();
$pk->message = "You can only sleep at night";
$player->dataPacket($pk);
return true;
}
$blockNorth = $this->getSide(2); //Gets the blocks around them
$blockSouth = $this->getSide(3);
$blockEast = $this->getSide(5);
$blockWest = $this->getSide(4);
if(($this->meta & 0x08) === 0x08){ //This is the Top part of bed
$b = $this;
}else{ //Bottom Part of Bed
if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
$b = $blockNorth;
}elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
$b = $blockSouth;
}elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){
$b = $blockEast;
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
$b = $blockWest;
}else{
if($player instanceof Player){
$pk = new ChatPacket();
$pk->message = "This bed is incomplete";
$player->dataPacket($pk);
}
return true;
}
}
if($player instanceof Player and $player->sleepOn($b) === false){
$pk = new ChatPacket();
$pk->message = "This bed is occupied";
$player->dataPacket($pk);
}
return true;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->isTransparent === false){
$faces = [
0 => 3,
1 => 4,
2 => 2,
3 => 5,
];
$d = $player instanceof Player ? $player->getDirection() : 0;
$next = $this->getSide($faces[(($d + 3) % 4)]);
$downNext = $this->getSide(0);
if($next->isReplaceable === true and $downNext->isTransparent === false){
$meta = (($d + 3) % 4) & 0x03;
$this->getLevel()->setBlock($block, Block::get($this->id, $meta), true, true);
$this->getLevel()->setBlock($next, Block::get($this->id, $meta | 0x08), true, true);
return true;
}
}
return false;
}
public function onBreak(Item $item){
$blockNorth = $this->getSide(2); //Gets the blocks around them
$blockSouth = $this->getSide(3);
$blockEast = $this->getSide(5);
$blockWest = $this->getSide(4);
if(($this->meta & 0x08) === 0x08){ //This is the Top part of bed
if($blockNorth->getID() === $this->id and $blockNorth->meta !== 0x08){ //Checks if the block ID and meta are right
$this->getLevel()->setBlock($blockNorth, new Air(), true, true);
}elseif($blockSouth->getID() === $this->id and $blockSouth->meta !== 0x08){
$this->getLevel()->setBlock($blockSouth, new Air(), true, true);
}elseif($blockEast->getID() === $this->id and $blockEast->meta !== 0x08){
$this->getLevel()->setBlock($blockEast, new Air(), true, true);
}elseif($blockWest->getID() === $this->id and $blockWest->meta !== 0x08){
$this->getLevel()->setBlock($blockWest, new Air(), true, true);
}
}else{ //Bottom Part of Bed
if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
$this->getLevel()->setBlock($blockNorth, new Air(), true, true);
}elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
$this->getLevel()->setBlock($blockSouth, new Air(), true, true);
}elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){
$this->getLevel()->setBlock($blockEast, new Air(), true, true);
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
$this->getLevel()->setBlock($blockWest, new Air(), true, true);
}
}
$this->getLevel()->setBlock($this, new Air(), true, true);
return true;
}
public function getDrops(Item $item){
return [
[Item::BED, 0, 1],
];
}
}

View File

@ -0,0 +1,37 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Bedrock extends Solid{
public function __construct(){
parent::__construct(self::BEDROCK, 0, "Bedrock");
$this->breakable = false;
$this->hardness = 18000000;
}
public function isBreakable(Item $item){
return false;
}
}

View File

@ -0,0 +1,42 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Beetroot extends Crops{
public function __construct($meta = 0){
parent::__construct(self::BEETROOT_BLOCK, $meta, "Beetroot Block");
}
public function getDrops(Item $item){
$drops = [];
if($this->meta >= 0x07){
$drops[] = [Item::BEETROOT, 0, 1];
$drops[] = [Item::BEETROOT_SEEDS, 0, mt_rand(0, 3)];
}else{
$drops[] = [Item::BEETROOT_SEEDS, 0, 1];
}
return $drops;
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class BirchWoodStairs extends Stair{
public function __construct($meta = 0){
parent::__construct(self::BIRCH_WOOD_STAIRS, $meta, "Birch Wood Stairs");
}
public function getDrops(Item $item){
return [
[$this->id, 0, 1],
];
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
class Bookshelf extends Solid{
public function __construct(){
parent::__construct(self::BOOKSHELF, 0, "Bookshelf");
$this->hardness = 7.5;
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
class BrickStairs extends Stair{
public function __construct($meta = 0){
parent::__construct(self::BRICK_STAIRS, $meta, "Brick Stairs");
}
}

View File

@ -0,0 +1,58 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Bricks extends Solid{
public function __construct(){
parent::__construct(self::BRICKS_BLOCK, 0, "Bricks");
$this->hardness = 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [
[Item::BRICKS_BLOCK, 0, 1],
];
}else{
return [];
}
}
}

View File

@ -0,0 +1,61 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class BrownMushroom extends Flowable{
public function __construct(){
parent::__construct(self::BROWN_MUSHROOM, 0, "Brown Mushroom");
$this->hardness = 0;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->isTransparent === false){
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
return false;
}
public function getBoundingBox(){
return null;
}
}

View File

@ -0,0 +1,122 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\String;
use pocketmine\Player;
use pocketmine\tile\Furnace;
use pocketmine\tile\Tile;
class BurningFurnace extends Solid{
public function __construct($meta = 0){
parent::__construct(self::BURNING_FURNACE, $meta, "Burning Furnace");
$this->isActivable = true;
$this->hardness = 17.5;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$faces = [
0 => 4,
1 => 2,
2 => 5,
3 => 3,
];
$this->meta = $faces[$player instanceof Player ? $player->getDirection() : 0];
$this->getLevel()->setBlock($block, $this, true, true);
$nbt = new Compound(false, [
new Enum("Items", []),
new String("id", Tile::FURNACE),
new Int("x", $this->x),
new Int("y", $this->y),
new Int("z", $this->z)
]);
$nbt->Items->setTagType(NBT::TAG_Compound);
Tile::createTile("Furnace", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
return true;
}
public function onBreak(Item $item){
$this->getLevel()->setBlock($this, new Air(), true, true);
return true;
}
public function onActivate(Item $item, Player $player = null){
if($player instanceof Player){
$t = $this->getLevel()->getTile($this);
$furnace = false;
if($t instanceof Furnace){
$furnace = $t;
}else{
$nbt = new Compound(false, [
new Enum("Items", []),
new String("id", Tile::FURNACE),
new Int("x", $this->x),
new Int("y", $this->y),
new Int("z", $this->z)
]);
$nbt->Items->setTagType(NBT::TAG_Compound);
$furnace = Tile::createTile("Furnace", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
}
if(($player->getGamemode() & 0x01) === 0x01){
return true;
}
$player->addWindow($furnace->getInventory());
}
return true;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.7;
case 4:
return 0.9;
case 3:
return 1.35;
case 2:
return 0.45;
case 1:
return 2.65;
default:
return 17.5;
}
}
public function getDrops(Item $item){
$drops = [];
if($item->isPickaxe() >= 1){
$drops[] = [Item::FURNACE, 0, 1];
}
return $drops;
}
}

View File

@ -0,0 +1,121 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\entity\Entity;
use pocketmine\event\block\BlockGrowEvent;
use pocketmine\event\entity\EntityDamageByBlockEvent;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Vector3;
use pocketmine\Player;
use pocketmine\Server;
class Cactus extends Transparent{
public $hasEntityCollision = true;
public function __construct($meta = 0){
parent::__construct(self::CACTUS, $meta, "Cactus");
$this->isFullBlock = false;
$this->hardness = 2;
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(
$this->x + 0.0625,
$this->y,
$this->z + 0.0625,
$this->x + 0.9375,
$this->y + 1,
$this->z + 0.9375
);
}
public function onEntityCollide(Entity $entity){
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_CONTACT, 1);
$entity->attack($ev->getFinalDamage(), $ev);
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
$down = $this->getSide(0);
if($down->getID() !== self::SAND and $down->getID() !== self::CACTUS){
$this->getLevel()->useBreakOn($this);
}else{
for($side = 2; $side <= 5; ++$side){
$b = $this->getSide($side);
if(!$b->isFlowable){
$this->getLevel()->useBreakOn($this);
}
}
}
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
if($this->getSide(0)->getID() !== self::CACTUS){
if($this->meta == 0x0F){
for($y = 1; $y < 3; ++$y){
$b = $this->getLevel()->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
if($b->getID() === self::AIR){
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($b, new Cactus()));
if(!$ev->isCancelled()){
$this->getLevel()->setBlock($b, $ev->getNewState(), true);
}
}
}
$this->meta = 0;
$this->getLevel()->setBlock($this, $this);
}else{
++$this->meta;
$this->getLevel()->setBlock($this, $this);
}
}
}
return false;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() === self::SAND or $down->getID() === self::CACTUS){
$block0 = $this->getSide(2);
$block1 = $this->getSide(3);
$block2 = $this->getSide(4);
$block3 = $this->getSide(5);
if($block0->isTransparent === true and $block1->isTransparent === true and $block2->isTransparent === true and $block3->isTransparent === true){
$this->getLevel()->setBlock($this, $this, true);
return true;
}
}
return false;
}
public function getDrops(Item $item){
return [
[$this->id, 0, 1],
];
}
}

View File

@ -0,0 +1,100 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\event\entity\EntityRegainHealthEvent;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\Player;
use pocketmine\Server;
class Cake extends Transparent{
public function __construct($meta = 0){
parent::__construct(self::CAKE_BLOCK, 0, "Cake Block");
$this->isFullBlock = false;
$this->isActivable = true;
$this->meta = $meta & 0x07;
$this->hardness = 2.5;
}
protected function recalculateBoundingBox(){
$f = (1 + $this->getDamage() * 2) / 16;
return new AxisAlignedBB(
$this->x + $f,
$this->y,
$this->z + 0.0625,
$this->x + 1 - 0.0625,
$this->y + 0.5,
$this->z + 1 - 0.0625
);
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() !== self::AIR){
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
return false;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
$this->getLevel()->setBlock($this, new Air(), true);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function getDrops(Item $item){
return [];
}
public function onActivate(Item $item, Player $player = null){
if($player instanceof Player and $player->getHealth() < 20){
++$this->meta;
Server::getInstance()->getPluginManager()->callEvent($ev = new EntityRegainHealthEvent($player, 3, EntityRegainHealthEvent::CAUSE_EATING));
if(!$ev->isCancelled()){
$player->heal($ev->getAmount(), $ev);
}
if($this->meta >= 0x06){
$this->getLevel()->setBlock($this, new Air(), true);
}else{
$this->getLevel()->setBlock($this, $this, true);
}
return true;
}
return false;
}
}

View File

@ -0,0 +1,91 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\Player;
class Carpet extends Flowable{
public function __construct($meta = 0){
parent::__construct(self::CARPET, $meta, "Carpet");
$names = [
0 => "White Carpet",
1 => "Orange Carpet",
2 => "Magenta Carpet",
3 => "Light Blue Carpet",
4 => "Yellow Carpet",
5 => "Lime Carpet",
6 => "Pink Carpet",
7 => "Gray Carpet",
8 => "Light Gray Carpet",
9 => "Cyan Carpet",
10 => "Purple Carpet",
11 => "Blue Carpet",
12 => "Brown Carpet",
13 => "Green Carpet",
14 => "Red Carpet",
15 => "Black Carpet",
];
$this->name = $names[$this->meta];
$this->hardness = 0;
$this->isFullBlock = false;
$this->isSolid = true;
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 0.0625,
$this->z + 1
);
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() !== self::AIR){
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
return false;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getID() === self::AIR){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -0,0 +1,41 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Carrot extends Crops{
public function __construct($meta = 0){
parent::__construct(self::CARROT_BLOCK, $meta, "Carrot Block");
}
public function getDrops(Item $item){
$drops = [];
if($this->meta >= 0x07){
$drops[] = [Item::CARROT, 0, mt_rand(1, 4)];
}else{
$drops[] = [Item::CARROT, 0, 1];
}
return $drops;
}
}

View File

@ -0,0 +1,151 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\math\AxisAlignedBB;
use pocketmine\nbt\NBT;
use pocketmine\nbt\tag\Compound;
use pocketmine\nbt\tag\Enum;
use pocketmine\nbt\tag\Int;
use pocketmine\nbt\tag\String;
use pocketmine\Player;
use pocketmine\tile\Chest as TileChest;
use pocketmine\tile\Tile;
class Chest extends Transparent{
const SLOTS = 27;
public function __construct($meta = 0){
parent::__construct(self::CHEST, $meta, "Chest");
$this->isActivable = true;
$this->hardness = 15;
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(
$this->x + 0.0625,
$this->y,
$this->z + 0.0625,
$this->x + 0.9375,
$this->y + 0.9475,
$this->z + 0.9375
);
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$faces = [
0 => 4,
1 => 2,
2 => 5,
3 => 3,
];
$chest = null;
$this->meta = $faces[$player instanceof Player ? $player->getDirection() : 0];
for($side = 2; $side <= 5; ++$side){
if(($this->meta === 4 or $this->meta === 5) and ($side === 4 or $side === 5)){
continue;
}elseif(($this->meta === 3 or $this->meta === 2) and ($side === 2 or $side === 3)){
continue;
}
$c = $this->getSide($side);
if($c instanceof Chest and $c->getDamage() === $this->meta){
$tile = $this->getLevel()->getTile($c);
if($tile instanceof TileChest and !$tile->isPaired()){
$chest = $tile;
break;
}
}
}
$this->getLevel()->setBlock($block, $this, true, true);
$nbt = new Compound(false, [
new Enum("Items", []),
new String("id", Tile::CHEST),
new Int("x", $this->x),
new Int("y", $this->y),
new Int("z", $this->z)
]);
$nbt->Items->setTagType(NBT::TAG_Compound);
$tile = Tile::createTile("Chest", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
if($chest instanceof TileChest and $tile instanceof TileChest){
$chest->pairWith($tile);
$tile->pairWith($chest);
}
return true;
}
public function onBreak(Item $item){
$t = $this->getLevel()->getTile($this);
if($t instanceof TileChest){
$t->unpair();
}
$this->getLevel()->setBlock($this, new Air(), true, true);
return true;
}
public function onActivate(Item $item, Player $player = null){
if($player instanceof Player){
$top = $this->getSide(1);
if($top->isTransparent !== true){
return true;
}
$t = $this->getLevel()->getTile($this);
$chest = null;
if($t instanceof TileChest){
$chest = $t;
}else{
$nbt = new Compound(false, [
new Enum("Items", []),
new String("id", Tile::CHEST),
new Int("x", $this->x),
new Int("y", $this->y),
new Int("z", $this->z)
]);
$nbt->Items->setTagType(NBT::TAG_Compound);
$chest = Tile::createTile("Chest", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
}
if($player->isCreative()){
return true;
}
$player->addWindow($chest->getInventory());
}
return true;
}
public function getDrops(Item $item){
return [
[$this->id, 0, 1],
];
}
}

View File

@ -0,0 +1,37 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Clay extends Solid{
public function __construct(){
parent::__construct(self::CLAY_BLOCK, 0, "Clay Block");
$this->hardness = 3;
}
public function getDrops(Item $item){
return [
[Item::CLAY, 0, 4],
];
}
}

View File

@ -0,0 +1,58 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Coal extends Solid{
public function __construct(){
parent::__construct(self::COAL_BLOCK, 0, "Coal Block");
$this->hardness = 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [
[Item::COAL_BLOCK, 0, 1],
];
}else{
return [];
}
}
}

View File

@ -0,0 +1,59 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class CoalOre extends Solid{
public function __construct(){
parent::__construct(self::COAL_ORE, 0, "Coal Ore");
$this->hardness = 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
case 2:
return 0.4;
case 1:
return 2.25;
default:
return 15;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [
[Item::COAL, 0, 1],
];
}else{
return [];
}
}
}

View File

@ -0,0 +1,58 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Cobblestone extends Solid{
public function __construct(){
parent::__construct(self::COBBLESTONE, 0, "Cobblestone");
$this->hardness = 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [
[Item::COBBLESTONE, 0, 1],
];
}else{
return [];
}
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
class CobblestoneStairs extends Stair{
public function __construct($meta = 0){
parent::__construct(self::COBBLESTONE_STAIRS, $meta, "Cobblestone Stairs");
}
}

View File

@ -0,0 +1,45 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\entity\Entity;
use pocketmine\item\Item;
class Cobweb extends Flowable{
public $hasEntityCollision = true;
public function __construct(){
parent::__construct(self::COBWEB, 0, "Cobweb");
$this->isSolid = true;
$this->isFullBlock = false;
$this->hardness = 25;
}
public function onEntityCollide(Entity $entity){
$entity->fallDistance = 0;
}
public function getDrops(Item $item){
return [];
}
}

View File

@ -0,0 +1,100 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\event\block\BlockGrowEvent;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
use pocketmine\Server;
abstract class Crops extends Flowable{
public $isActivable = true;
public $hardness = 0;
public function getBoundingBox(){
return null;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() === self::FARMLAND){
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
return false;
}
public function onActivate(Item $item, Player $player = null){
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
$block = clone $this;
$block->meta += mt_rand(2, 5);
if($block->meta > 7){
$block->meta = 7;
}
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($this, $block));
if(!$ev->isCancelled()){
$this->getLevel()->setBlock($this, $ev->getNewState(), true, true);
}
$item->count--;
return true;
}
return false;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
if(mt_rand(0, 2) == 1){
if($this->meta < 0x07){
$block = clone $this;
++$block->meta;
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($this, $block));
if(!$ev->isCancelled()){
$this->getLevel()->setBlock($this, $ev->getNewState(), true, true);
}else{
return Level::BLOCK_UPDATE_RANDOM;
}
}
}else{
return Level::BLOCK_UPDATE_RANDOM;
}
}
return false;
}
}

View File

@ -0,0 +1,61 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class CyanFlower extends Flowable{
public function __construct(){
parent::__construct(self::POPPY, 0, "Cyan Flower");
$this->hardness = 0;
}
public function getBoundingBox(){
return null;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
return false;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -0,0 +1,61 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\Player;
class Dandelion extends Flowable{
public function __construct(){
parent::__construct(self::DANDELION, 0, "Dandelion");
$this->hardness = 0;
}
public function getBoundingBox(){
return null;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
return false;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class DarkOakWoodStairs extends Stair{
public function __construct($meta = 0){
parent::__construct(self::DARK_OAK_WOOD_STAIRS, $meta, "Dark Oak Wood Stairs");
}
public function getDrops(Item $item){
return [
[$this->id, 0, 1],
];
}
}

View File

@ -0,0 +1,50 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\level\Level;
class DeadBush extends Flowable{
public function __construct(){
parent::__construct(self::DEAD_BUSH, 0, "Dead Bush");
//$this->isReplaceable = true;
$this->hardness = 0;
}
public function getBoundingBox(){
return null;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace with common break method
$this->getLevel()->setBlock($this, new Air(), false, false, true);
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -0,0 +1,52 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class Diamond extends Solid{
public function __construct(){
parent::__construct(self::DIAMOND_BLOCK, 0, "Diamond Block");
$this->hardness = 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
default:
return 25;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 4){
return [
[Item::DIAMOND_BLOCK, 0, 1],
];
}else{
return [];
}
}
}

View File

@ -0,0 +1,52 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class DiamondOre extends Solid{
public function __construct(){
parent::__construct(self::DIAMOND_ORE, 0, "Diamond Ore");
$this->hardness = 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 4){
return [
[Item::DIAMOND, 0, 1],
];
}else{
return [];
}
}
}

View File

@ -0,0 +1,49 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\Player;
class Dirt extends Solid{
public $isActivable = true;
protected $hardness = 2.5;
protected $id = self::DIRT;
protected $meta = 0;
protected $name = "Dirt";
public function __construct(){
}
public function onActivate(Item $item, Player $player = null){
if($item->isHoe()){
$item->useOn($this);
$this->getLevel()->setBlock($this, Block::get(Item::FARMLAND, 0), true);
return true;
}
return false;
}
}

View File

@ -0,0 +1,304 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\level\Level;
use pocketmine\math\AxisAlignedBB;
use pocketmine\network\protocol\LevelEventPacket;
use pocketmine\Player;
use pocketmine\Server;
abstract class Door extends Transparent{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->isSolid = false;
}
private function getFullDamage(){
$damage = $this->getDamage();
$flag = ($damage & 0x08) > 0;
if($flag){
$first = $this->getSide(0)->getDamage();
$second = $damage;
}else{
$first = $damage;
$second = $this->getSide(1)->getDamage();
}
$flag1 = ($second & 0x01) > 0;
return $first & 0x07 | ($flag ? 8 : 0) | ($flag1 ? 0x10 : 0);
}
protected function recalculateBoundingBox(){
$f = 0.1875;
$damage = $this->getFullDamage();
$bb = new AxisAlignedBB(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 2,
$this->z + 1
);
$j = $damage & 0x03;
$flag = (($damage & 0x04) > 0);
$flag1 = (($damage & 0x10) > 0);
if($j === 0){
if($flag){
if(!$flag1){
$bb->setBounds(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + $f
);
}else{
$bb->setBounds(
$this->x,
$this->y,
$this->z + 1 - $f,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}
}else{
$bb->setBounds(
$this->x,
$this->y,
$this->z,
$this->x + $f,
$this->y + 1,
$this->z + 1
);
}
}elseif($j === 1){
if($flag){
if(!$flag1){
$bb->setBounds(
$this->x + 1 - $f,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}else{
$bb->setBounds(
$this->x,
$this->y,
$this->z,
$this->x + $f,
$this->y + 1,
$this->z + 1
);
}
}else{
$bb->setBounds(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + $f
);
}
}elseif($j === 2){
if($flag){
if(!$flag1){
$bb->setBounds(
$this->x,
$this->y,
$this->z + 1 - $f,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}else{
$bb->setBounds(
$this->x,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + $f
);
}
}else{
$bb->setBounds(
$this->x + 1 - $f,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}
}elseif($j === 3){
if($flag){
if(!$flag1){
$bb->setBounds(
$this->x,
$this->y,
$this->z,
$this->x + $f,
$this->y + 1,
$this->z + 1
);
}else{
$bb->setBounds(
$this->x + 1 - $f,
$this->y,
$this->z,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}
}else{
$bb->setBounds(
$this->x,
$this->y,
$this->z + 1 - $f,
$this->x + 1,
$this->y + 1,
$this->z + 1
);
}
}
return $bb;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
$this->getLevel()->setBlock($this, new Air(), false);
if($this->getSide(1) instanceof Door){
$this->getLevel()->setBlock($this->getSide(1), new Air(), false);
}
return Level::BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($face === 1){
$blockUp = $this->getSide(1);
$blockDown = $this->getSide(0);
if($blockUp->isReplaceable === false or $blockDown->isTransparent === true){
return false;
}
$direction = $player instanceof Player ? $player->getDirection() : 0;
$face = [
0 => 3,
1 => 4,
2 => 2,
3 => 5,
];
$next = $this->getSide($face[(($direction + 2) % 4)]);
$next2 = $this->getSide($face[$direction]);
$metaUp = 0x08;
if($next->getID() === $this->id or ($next2->isTransparent === false and $next->isTransparent === true)){ //Door hinge
$metaUp |= 0x01;
}
$this->meta = $player->getDirection() & 0x03;
$this->getLevel()->setBlock($block, $this, true, true); //Bottom
$this->getLevel()->setBlock($blockUp, $b = Block::get($this->id, $metaUp), true); //Top
return true;
}
return false;
}
public function onBreak(Item $item){
if(($this->meta & 0x08) === 0x08){
$down = $this->getSide(0);
if($down->getID() === $this->id){
$this->getLevel()->setBlock($down, new Air(), true);
}
}else{
$up = $this->getSide(1);
if($up->getID() === $this->id){
$this->getLevel()->setBlock($up, new Air(), true);
}
}
$this->getLevel()->setBlock($this, new Air(), true);
return true;
}
public function onActivate(Item $item, Player $player = null){
if(($this->meta & 0x08) === 0x08){ //Top
$down = $this->getSide(0);
if($down->getID() === $this->id){
$meta = $down->getDamage() ^ 0x04;
$this->getLevel()->setBlock($down, Block::get($this->id, $meta), true);
$players = $this->getLevel()->getUsingChunk($this->x >> 4, $this->z >> 4);
if($player instanceof Player){
unset($players[$player->getID()]);
}
$pk = new LevelEventPacket();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->evid = 1003;
$pk->data = 0;
Server::broadcastPacket($players, $pk);
return true;
}
return false;
}else{
$this->meta ^= 0x04;
$this->getLevel()->setBlock($this, $this, true);
$players = $this->getLevel()->getUsingChunk($this->x >> 4, $this->z >> 4);
if($player instanceof Player){
unset($players[$player->getID()]);
}
$pk = new LevelEventPacket();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->evid = 1003;
$pk->data = 0;
Server::broadcastPacket($players, $pk);
}
return true;
}
}

View File

@ -0,0 +1,70 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class DoubleSlab extends Solid{
public function __construct($meta = 0){
parent::__construct(self::DOUBLE_SLAB, $meta, "Double Slab");
$names = [
0 => "Stone",
1 => "Sandstone",
2 => "Wooden",
3 => "Cobblestone",
4 => "Brick",
5 => "Stone Brick",
6 => "Quartz",
7 => "",
];
$this->name = "Double " . $names[$this->meta & 0x07] . " Slab";
$this->hardness = 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [
[Item::SLAB, $this->meta & 0x07, 2],
];
}else{
return [];
}
}
}

Some files were not shown because too many files have changed in this diff Show More