Compare commits

...

2377 Commits

Author SHA1 Message Date
f4181a6e36 Bump Minecraft: PE version 2014-11-27 14:37:44 +01:00
38089af098 Improved global entity motion encoding using per-player queues 2014-11-27 14:26:36 +01:00
cd135b39ad Improved player spawn item in hand sending 2014-11-27 13:59:32 +01:00
dd3207cbd8 Possible fix for #2267, #2314 2014-11-27 13:47:17 +01:00
a7abd5ff9d Catch exceptions when chunks are unloaded 2014-11-27 13:35:54 +01:00
a3e50f6337 Properly close inventory windows from Players 2014-11-27 13:32:07 +01:00
441a98e60a Removed old trigger_error() calls, closes #2335 2014-11-27 13:16:39 +01:00
4a90ac270f Improved exception handling and debugging 2014-11-22 13:52:36 +01:00
a906a2988b Bumped Minecraft: PE version string 2014-11-22 13:44:34 +01:00
545f68382c Increased Fence, Fence Gate and Stone Wall Y bounding box 2014-11-22 13:44:05 +01:00
8249cac592 Catch corrupted chunk data errors 2014-11-20 22:02:00 +01:00
7b7bbe9105 Regenerate corrupt player data if invalid data is found 2014-11-20 21:58:27 +01:00
05679c7872 Merge branch 'master' of github.com:PocketMine/PocketMine-MP 2014-11-20 21:46:14 +01:00
8eb80be691 Remove duplicated tiles from chunk table automatically 2014-11-20 21:45:52 +01:00
f55b0d0b45 Merge pull request #2295 from LukeDarling/patch-1
Fixed Server->getOps() capitalization
2014-11-19 13:10:03 +01:00
754e0dbb49 Protect permission removal against bad plugins 2014-11-18 18:43:30 +01:00
525c8db779 Improved chunk loading/unloading 2014-11-18 18:33:24 +01:00
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
00be3f0dd3 Fixed Server->getOps() capitalization
I'm not 100% sure, but I believe this is how it's supposed to be.
2014-11-15 00:01:57 -05: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
856 changed files with 61369 additions and 24185 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

16
.gitignore vendored
View File

@ -1,17 +1,16 @@
players/*
worlds/*
plugins/*
logs/*
bin/*
*.log
*.pmf
*.txt
*.phar
server.properties
pocketmine.yml
############
## Windows
############
# Common IDEs
.idea/*
nbproject/*
# Windows image file caches
Thumbs.db
@ -21,3 +20,8 @@ Desktop.ini
# 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>

View File

@ -1,15 +1,21 @@
language: php
php:
- 5.4
- 5.6
branches:
- master
before_script:
- pecl install channel://pecl.php.net/pthreads-0.0.44
- git clone --depth=100 --quiet --branch=tests git://github.com/PocketMine/PocketMine-MP.git $(pwd)/tests/
- 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:
- phpunit tests/
- php tests/TravisTest.php
notifications:
email: false
webhooks: http://n.tkte.ch/h/214/wsNvmG43-ncxUVRrFPwSM-r0
#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,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.
*/
/***REM_START***/
require_once(dirname(__FILE__)."/src/config.php");
require_once(FILE_PATH."/src/functions.php");
require_once(FILE_PATH."/src/dependencies.php");
/***REM_END***/
$server = new ServerAPI();
$server->start();
kill(getmypid()); //Fix for ConsoleAPI being blocked
exit(0);

View File

@ -1,49 +1,55 @@
![](http://www.pocketmine.net/favicon.png)
# ![PocketMine-MP](http://cdn.pocketmine.net/img/PocketMine-MP-h.png)
# PocketMine-MP [![Build Status](https://travis-ci.org/PocketMine/PocketMine-MP.png?branch=master)](https://travis-ci.org/PocketMine/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 sofware for creating Minecraft Pocket Edition servers__. 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.net/)
### [Forums](http://forums.pocketmine.net/)
### [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)
<!--## [FAQ: Frequently Asked Questions](https://github.com/PocketMine/PocketMine-MP/wiki/Frequently-Asked-Questions)-->
### [Help Page](http://www.pocketmine.net/help.php)
### [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)
## IRC #mcpedevs @ irc.freenode.net
* [WebIRC](http://webchat.freenode.net?channels=mcpedevs&uio=d4)
### 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/Protocols Used
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
* __[PHP SQLite3](http://php.net/manual/en/book.sqlite3.php)__
* __[PHP BCMath](http://php.net/manual/en/book.bc.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).
* __[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.
* __[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)__
* __[UT3 Query Protocol](http://wiki.unrealadmin.org/UT3_query_protocol)__

View File

@ -1,340 +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 $ops;
private $bannedIPs;
private $cmdWL = array();//Command WhiteList
function __construct(){
$this->server = ServerAPI::request();
}
public function init(){
$this->whitelist = new Config(DATA_PATH."white-list.txt", CONFIG_LIST);//Open whitelist list file
$this->bannedIPs = new Config(DATA_PATH."banned-ips.txt", CONFIG_LIST);//Open Banned IPs list file
$this->banned = new Config(DATA_PATH."banned.txt", CONFIG_LIST);//Open Banned Usernames list file
$this->ops = new Config(DATA_PATH."ops.txt", CONFIG_LIST);//Open list of OPs
$this->server->api->console->register("banip", "<add|remove|list|reload> [IP|player]", array($this, "commandHandler"));
$this->server->api->console->register("ban", "<add|remove|list|reload> [username]", array($this, "commandHandler"));
$this->server->api->console->register("kick", "<player> [reason ...]", array($this, "commandHandler"));
$this->server->api->console->register("whitelist", "<on|off|list|add|remove|reload> [username]", array($this, "commandHandler"));
$this->server->api->console->register("op", "<player>", array($this, "commandHandler"));
$this->server->api->console->register("deop", "<player>", array($this, "commandHandler"));
$this->server->api->console->register("sudo", "<player>", array($this, "commandHandler"));
$this->server->api->console->alias("ban-ip", "banip add");
$this->server->api->console->alias("banlist", "ban list");
$this->server->api->console->alias("pardon", "ban remove");
$this->server->api->console->alias("pardon-ip", "banip remove");
$this->server->addHandler("console.command", array($this, "permissionsCheck"), 1);//Event handler when commands are issued. Used to check permissions of commands that go through the server.
$this->server->addHandler("player.block.break", array($this, "permissionsCheck"), 1);//Event handler for blocks
$this->server->addHandler("player.block.place", array($this, "permissionsCheck"), 1);//Event handler for blocks
$this->server->addHandler("player.flying", array($this, "permissionsCheck"), 1);//Flying Event
}
public function cmdWhitelist($cmd){//Whitelists a CMD so everyone can issue it - Even non OPs.
$this->cmdWhitelist[strtolower(trim($cmd))] = true;
}
public function isOp($username){//Is a player op?
$username = strtolower($username);
if($this->server->api->dhandle("op.check", $username) === true){
return true;
}elseif($this->ops->exists($username)){
return true;
}
return false;
}
public function permissionsCheck($data, $event){
switch($event){
case "player.flying"://OPs can fly around the server.
if($this->isOp($data->iusername)){
return true;
}
break;
case "player.block.break":
case "player.block.place"://Spawn protection detection. Allows OPs to place/break blocks in the spawn area.
if(!$this->isOp($data["player"]->iusername)){
$t = new Vector2($data["target"]->x, $data["target"]->z);
$s = new Vector2($this->server->spawn->x, $this->server->spawn->z);
if($t->distance($s) <= $this->server->api->getProperty("spawn-protection") and $this->server->api->dhandle($event.".spawn", $data) !== true){
return false;
}
}
return;
break;
case "console.command"://Checks if a command is allowed with the current user permissions.
if(isset($this->cmdWhitelist[$data["cmd"]])){
return;
}
if($data["issuer"] instanceof Player){
if($this->server->api->handle("console.check", $data) === true or $this->isOp($data["issuer"]->iusername)){
return;
}
}elseif($data["issuer"] === "console" or $data["issuer"] === "rcon"){
return;
}
return false;
break;
}
}
public function commandHandler($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "sudo":
$target = strtolower(array_shift($params));
$player = $this->server->api->player->get($target);
if(!($player instanceof Player)){
$output .= "Player not connected.\n";
break;
}
$this->server->api->console->run(implode(" ", $params), $player);
$output .= "Command ran as ".$player->username.".\n";
break;
case "op":
$user = strtolower($params[0]);
$player = $this->server->api->player->get($user);
if(!($player instanceof Player)){
$this->ops->set($user);
$this->ops->save($user);
$output .= $user." is now op\n";
break;
}
$this->ops->set($player->iusername);
$this->ops->save();
$output .= $player->iusername." is now op\n";
$this->server->api->chat->sendTo(false, "You are now op.", $player->iusername);
break;
case "deop":
$user = strtolower($params[0]);
$player = $this->server->api->player->get($user);
if(!($player instanceof Player)){
$this->ops->set($user, false);
$this->ops->save($user);
$output .= $user." is no longer op\n";
break;
}
$this->ops->remove($player->iusername);
$this->ops->save();
$output .= $player->iusername." is not longer op\n";
$this->server->api->chat->sendTo(false, "You are no longer op.", $player->iusername);
break;
case "kick":
if(!isset($params[0])){
$output .= "Usage: /kick <player> [reason ...]\n";
}else{
$name = strtolower(array_shift($params));
$player = $this->server->api->player->get($name);
if($player === false){
$output .= "Player \"".$name."\" does not exist\n";
}else{
$reason = implode(" ", $params);
$reason = $reason == "" ? "No reason":$reason;
$player->close("You have been kicked: ".$reason);
if($issuer instanceof Player){
$this->server->api->chat->broadcast($player->username." has been kicked by ".$issuer->username.": $reason\n");
}else{
$this->server->api->chat->broadcast($player->username." has been kicked: $reason\n");
}
}
}
break;
case "whitelist":
$p = strtolower(array_shift($params));
switch($p){
case "remove":
$user = strtolower($params[0]);
$this->whitelist->remove($user);
$this->whitelist->save();
$output .= "Player \"$user\" removed from white-list\n";
break;
case "add":
$user = strtolower($params[0]);
$this->whitelist->set($user);
$this->whitelist->save();
$output .= "Player \"$user\" added to white-list\n";
break;
case "reload":
$this->whitelist = new Config(DATA_PATH."white-list.txt", CONFIG_LIST);
break;
case "list":
$output .= "White-list: ".implode(", ", $this->whitelist->getAll(true))."\n";
break;
case "on":
case "true":
case "1":
$output .= "White-list turned on\n";
$this->server->api->setProperty("white-list", true);
break;
case "off":
case "false":
case "0":
$output .= "White-list turned off\n";
$this->server->api->setProperty("white-list", false);
break;
default:
$output .= "Usage: /whitelist <on|off|list|add|remove|reload> [username]\n";
break;
}
break;
case "banip":
$p = strtolower(array_shift($params));
switch($p){
case "pardon":
case "remove":
$ip = strtolower($params[0]);
$this->bannedIPs->remove($ip);
$this->bannedIPs->save();
$output .= "IP \"$ip\" removed from ban list\n";
break;
case "add":
case "ban":
$ip = strtolower($params[0]);
$player = $this->server->api->player->get($ip);
if($player instanceof Player){
$ip = $player->ip;
$player->close("banned");
}
$this->bannedIPs->set($ip);
$this->bannedIPs->save();
$output .= "IP \"$ip\" added to ban list\n";
break;
case "reload":
$this->bannedIPs = new Config(DATA_PATH."banned-ips.txt", CONFIG_LIST);
break;
case "list":
$output .= "IP ban list: ".implode(", ", $this->bannedIPs->getAll(true))."\n";
break;
default:
$output .= "Usage: /banip <add|remove|list|reload> [IP|player]\n";
break;
}
break;
case "ban":
$p = strtolower(array_shift($params));
switch($p){
case "pardon":
case "remove":
$user = strtolower($params[0]);
$this->banned->remove($user);
$this->banned->save();
$output .= "Player \"$user\" removed from ban list\n";
break;
case "add":
case "ban":
$user = strtolower($params[0]);
$this->banned->set($user);
$this->banned->save();
$player = $this->server->api->player->get($user);
if($player !== false){
$player->close("You have been banned");
}
if($issuer instanceof Player){
$this->server->api->chat->broadcast($user." has been banned by ".$issuer->username."\n");
}else{
$this->server->api->chat->broadcast($user." has been banned\n");
}
$this->kick($user, "Banned");
$output .= "Player \"$user\" added to ban list\n";
break;
case "reload":
$this->banned = new Config(DATA_PATH."banned.txt", CONFIG_LIST);
break;
case "list":
$output .= "Ban list: ".implode(", ", $this->banned->getAll(true))."\n";
break;
default:
$output .= "Usage: /ban <add|remove|list|reload> [username]\n";
break;
}
break;
}
return $output;
}
public function ban($username){
$this->commandHandler("ban", array("add", $username), "console", "");
}
public function pardon($username){
$this->commandHandler("ban", array("pardon", $username), "console", "");
}
public function banIP($ip){
$this->commandHandler("banip", array("add", $ip), "console", "");
}
public function pardonIP($ip){
$this->commandHandler("banip", array("pardon", $ip), "console", "");
}
public function kick($username, $reason = "No Reason"){
$this->commandHandler("kick", array($username, $reason), "console", "");
}
public function reload(){
$this->commandHandler("ban", array("reload"), "console", "");
$this->commandHandler("banip", array("reload"), "console", "");
$this->commandHandler("whitelist", array("reload"), "console", "");
}
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){
$username = strtolower($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){
$username = strtolower($username);
if($this->isOp($username)){
return true;
}elseif($this->server->api->dhandle("api.ban.whitelist.check", $username) === false){
return true;
}elseif($this->whitelist->exists($username)){
return true;
}
return false;
}
}

View File

@ -1,795 +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 BlockAPI{
private $server;
private $scheduledUpdates = array();
public static $creative = array(
array(COBBLESTONE, 0),
array(STONE_BRICKS, 0),
array(STONE_BRICKS, 1),
array(STONE_BRICKS, 2),
array(MOSS_STONE, 0),
array(WOODEN_PLANKS, 0),
array(BRICKS, 0),
array(STONE, 0),
array(DIRT, 0),
array(GRASS, 0),
array(CLAY_BLOCK, 0),
array(SANDSTONE, 0),
array(SANDSTONE, 1),
array(SANDSTONE, 2),
array(SAND, 0),
array(GRAVEL, 0),
array(TRUNK, 0),
array(TRUNK, 1),
array(TRUNK, 2),
array(NETHER_BRICKS, 0),
array(NETHERRACK, 0),
array(COBBLESTONE_STAIRS, 0),
array(WOODEN_STAIRS, 0),
array(BRICK_STAIRS, 0),
array(SANDSTONE_STAIRS, 0),
array(STONE_BRICK_STAIRS, 0),
array(NETHER_BRICKS_STAIRS, 0),
array(QUARTZ_STAIRS, 0),
array(SLAB, 0),
array(SLAB, 1),
array(SLAB, 2),
array(SLAB, 3),
array(SLAB, 4),
array(SLAB, 5),
array(QUARTZ_BLOCK, 0),
array(QUARTZ_BLOCK, 1),
array(QUARTZ_BLOCK, 2),
array(COAL_ORE, 0),
array(IRON_ORE, 0),
array(GOLD_ORE, 0),
array(DIAMOND_ORE, 0),
array(LAPIS_ORE, 0),
array(REDSTONE_ORE, 0),
array(GOLD_BLOCK, 0),
array(IRON_BLOCK, 0),
array(DIAMOND_BLOCK, 0),
array(LAPIS_BLOCK, 0),
array(OBSIDIAN, 0),
array(SNOW_BLOCK, 0),
array(GLASS, 0),
array(GLOWSTONE_BLOCK, 0),
array(NETHER_REACTOR, 0),
array(WOOL, 0),
array(WOOL, 7),
array(WOOL, 6),
array(WOOL, 5),
array(WOOL, 4),
array(WOOL, 3),
array(WOOL, 2),
array(WOOL, 1),
array(WOOL, 15),
array(WOOL, 14),
array(WOOL, 13),
array(WOOL, 12),
array(WOOL, 11),
array(WOOL, 10),
array(WOOL, 9),
array(WOOL, 8),
array(LADDER, 0),
array(TORCH, 0),
array(GLASS_PANE, 0),
array(BUCKET, 0),
array(BUCKET, 8),
array(BUCKET, 10),
array(WOODEN_DOOR, 0),
array(TRAPDOOR, 0),
array(FENCE, 0),
array(FENCE_GATE, 0),
array(BED, 0),
array(BOOKSHELF, 0),
array(PAINTING, 0),
array(WORKBENCH, 0),
array(STONECUTTER, 0),
array(CHEST, 0),
array(FURNACE, 0),
array(TNT, 0),
array(DANDELION, 0),
array(CYAN_FLOWER, 0),
array(BROWN_MUSHROOM, 0),
array(RED_MUSHROOM, 0),
array(CACTUS, 0),
array(MELON_BLOCK, 0),
array(SUGARCANE, 0),
array(SAPLING, 0),
array(SAPLING, 1),
array(SAPLING, 2),
array(LEAVES, 0),
array(LEAVES, 1),
array(LEAVES, 2),
array(SEEDS, 0),
array(MELON_SEEDS, 0),
array(DYE, 15), //Bonemeal
array(IRON_HOE, 0),
array(CAKE, 0),
array(EGG, 0),
array(IRON_SWORD, 0),
array(BOW, 0),
array(SIGN, 0),
array(SPAWN_EGG, MOB_CHICKEN),
array(SPAWN_EGG, MOB_COW),
array(SPAWN_EGG, MOB_PIG),
array(SPAWN_EGG, MOB_SHEEP),
);
public static function fromString($str, $multiple = false){
if($multiple === true){
$blocks = array();
foreach(explode(",",$str) as $b){
$blocks[] = BlockAPI::fromString($b, false);
}
return $blocks;
}else{
$b = explode(":", str_replace(" ", "_", trim($str)));
if(!isset($b[1])){
$meta = 0;
}else{
$meta = ((int) $b[1]) & 0xFFFF;
}
if(defined(strtoupper($b[0]))){
$item = BlockAPI::getItem(constant(strtoupper($b[0])), $meta);
if($item->getID() === AIR and strtoupper($b[0]) !== "AIR"){
$item = BlockAPI::getItem(((int) $b[0]) & 0xFFFF, $meta);
}
}else{
$item = BlockAPI::getItem(((int) $b[0]) & 0xFFFF, $meta);
}
return $item;
}
}
public static function get($id, $meta = 0, $v = false){
$id = (int) $id;
if(isset(Block::$class[$id])){
$classname = Block::$class[$id];
$b = new $classname($meta);
}else{
$b = new GenericBlock($id, $meta);
}
if($v instanceof Position){
$b->position($v);
}
return $b;
}
public static function getItem($id, $meta = 0, $count = 1){
$id = (int) $id;
if(isset(Item::$class[$id])){
$classname = Item::$class[$id];
$i = new $classname($meta, $count);
}else{
$i = new Item($id, $meta, $count);
}
return $i;
}
function __construct(){
$this->server = ServerAPI::request();
}
public function init(){
$this->server->schedule(1, array($this, "blockUpdateTick"), array(), true);
$this->server->api->console->register("give", "<player> <item[:damage]> [amount]", array($this, "commandHandler"));
}
public function commandHandler($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "give":
if(!isset($params[0]) or !isset($params[1])){
$output .= "Usage: /give <player> <item[:damage]> [amount]\n";
break;
}
$player = $this->server->api->player->get($params[0]);
$item = BlockAPI::fromString($params[1]);
if(!isset($params[2])){
$item->count = $item->getMaxStackSize();
}else{
$item->count = (int) $params[2];
}
if($player instanceof Player){
if(($player->gamemode & 0x01) === 0x01){
$output .= "Player is in creative mode.\n";
break;
}
$player->addItem($item->getID(), $item->getMetadata(), $item->count);
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username."\n";
}else{
$output .= "Unknown player.\n";
}
break;
}
return $output;
}
private function cancelAction(Block $block, Player $player, $send = true){
$player->dataPacket(MC_UPDATE_BLOCK, array(
"x" => $block->x,
"y" => $block->y,
"z" => $block->z,
"block" => $block->getID(),
"meta" => $block->getMetadata()
));
if($send === true){
$player->sendInventorySlot($player->slot);
}
return false;
}
public function playerBlockBreak(Player $player, Vector3 $vector){
$target = $player->level->getBlock($vector);
$item = $player->getSlot($player->slot);
if($this->server->api->dhandle("player.block.touch", array("type" => "break", "player" => $player, "target" => $target, "item" => $item)) === false){
return $this->cancelAction($target, $player, false);
}
if((!$target->isBreakable($item, $player) and $this->server->api->dhandle("player.block.break.invalid", array("player" => $player, "target" => $target, "item" => $item)) !== true) or ($player->gamemode & 0x02) === 0x02 or (($player->lastBreak - $player->getLag() / 1000) + $target->getBreakTime($item, $player) - 0.1) >= microtime(true)){
return $this->cancelAction($target, $player, false);
}
$player->lastBreak = microtime(true);
if($this->server->api->dhandle("player.block.break", array("player" => $player, "target" => $target, "item" => $item)) !== false){
if($target->onBreak($item, $player) === false){
return $this->cancelAction($target, $player, false);
}
$item->useOn($target);
$drops = $target->getDrops($item, $player);
}else{
return $this->cancelAction($target, $player, false);
}
if(($player->gamemode & 0x01) === 0x00 and count($drops) > 0){
foreach($drops as $drop){
$this->server->api->entity->drop(new Position($target->x + 0.5, $target->y, $target->z + 0.5, $target->level), BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, $drop[2]));
}
}
return false;
}
public function playerBlockAction(Player $player, Vector3 $vector, $face, $fx, $fy, $fz){
if($face < 0 or $face > 5){
return false;
}
$target = $player->level->getBlock($vector);
$block = $target->getSide($face);
$item = $player->getSlot($player->slot);
if($target->getID() === AIR and $this->server->api->dhandle("player.block.place.invalid", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== true){ //If no block exists or not allowed in CREATIVE
$this->cancelAction($target, $player);
return $this->cancelAction($block, $player);
}
if($this->server->api->dhandle("player.block.touch", array("type" => "place", "player" => $player, "block" => $block, "target" => $target, "item" => $item)) === false){
return $this->cancelAction($block, $player);
}
$this->blockUpdate($target, BLOCK_UPDATE_TOUCH);
if($target->isActivable === true){
if($this->server->api->dhandle("player.block.activate", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) !== false and $target->onActivate($item, $player) === true){
return false;
}
}
if(($player->gamemode & 0x02) === 0x02){ //Adventure mode!!
return $this->cancelAction($block, $player);
}
if($block->y > 127 or $block->y < 0){
return false;
}
if($item->isActivable === true and $item->onActivate($player->level, $player, $block, $target, $face, $fx, $fy, $fz) === true){
if($item->count <= 0){
$player->setSlot($player->slot, BlockAPI::getItem(AIR, 0, 0), false);
}
return false;
}
if($item->isPlaceable()){
$hand = $item->getBlock();
$hand->position($block);
}elseif($block->getID() === FIRE){
$player->level->setBlock($block, new AirBlock());
return false;
}else{
return $this->cancelAction($block, $player, false);
}
if(!($block->isReplaceable === true or ($hand->getID() === SLAB and $block->getID() === SLAB))){
return $this->cancelAction($block, $player, false);
}
if($hand->isSolid === true and $player->entity->inBlock($block)){
return $this->cancelAction($block, $player, false); //Entity in block
}
if($this->server->api->dhandle("player.block.place", array("player" => $player, "block" => $block, "target" => $target, "item" => $item)) === false){
return $this->cancelAction($block, $player);
}elseif($hand->place($item, $player, $block, $target, $face, $fx, $fy, $fz) === false){
return $this->cancelAction($block, $player);
}
if($hand->getID() === SIGN_POST or $hand->getID() === WALL_SIGN){
$t = $this->server->api->tile->addSign($player->level, $block->x, $block->y, $block->z);
$t->data["creator"] = $player->username;
}
if(($player->gamemode & 0x01) === 0x00){
--$item->count;
if($item->count <= 0){
$player->setSlot($player->slot, BlockAPI::getItem(AIR, 0, 0), false);
}
}
return false;
}
/*
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($spread[0] === 9 or $spread[0] === 8){
if($source[0] === 11){
$this->server->api->level->setBlock($source[2][0], $source[2][1], $source[2][2], 49, 0);
}elseif($face === 0){
$this->server->api->level->setBlock($source[2][0], $source[2][1], $source[2][2], 1, 0);
}else{
$this->server->api->level->setBlock($source[2][0], $source[2][1], $source[2][2], 4, 0);
}
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, &$spread = null){
$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($spread[0] === 11){
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 49, 0, true);
return true;
}elseif($spread[0] === 10){
if($face === 0 or ($spread[1] & 0x08) === 0){
$this->server->api->level->setBlock($spread[2][0], $spread[2][1], $spread[2][2], 4, 0, true);
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:
$faces = array();
if(!$this->flowWaterOn($block, 0, $floor) or $block[0] === 9){
$this->flowWaterOn($block, 2, $faces[0]);
$this->flowWaterOn($block, 3, $faces[1]);
$this->flowWaterOn($block, 4, $faces[2]);
$this->flowWaterOn($block, 5, $faces[3]);
}
if($block[0] === 8){
//Source creation
if(!isset(Material::$flowable[$floor[0]])){
$sources = 0;
foreach($faces as $i => $b){
if($b[0] === 9){
++$sources;
}
}
if($sources >= 2){
$this->server->api->level->setBlock($block[2][0], $block[2][1], $block[2][2], 9, 0, false);
$this->server->schedule(10, array($this, "blockScheduler"), array(
"x" => $block[2][0],
"y" => $block[2][1],
"z" => $block[2][2],
"type" => BLOCK_UPDATE_NORMAL,
));
break;
}
}
$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;
}
if($type === BLOCK_TYPE_SCHEDULED){
$type = BLOCK_UPDATE_WEAK;
}
if($changed === true){
$this->updateBlocksAround($x, $y, $z, $type);
}
}*/
public function blockUpdateAround(Position $pos, $type = BLOCK_UPDATE_NORMAL, $delay = false){
if($delay !== false){
$this->scheduleBlockUpdate($pos->getSide(0), $delay, $type);
$this->scheduleBlockUpdate($pos->getSide(1), $delay, $type);
$this->scheduleBlockUpdate($pos->getSide(2), $delay, $type);
$this->scheduleBlockUpdate($pos->getSide(3), $delay, $type);
$this->scheduleBlockUpdate($pos->getSide(4), $delay, $type);
$this->scheduleBlockUpdate($pos->getSide(5), $delay, $type);
}else{
$this->blockUpdate($pos->getSide(0), $type);
$this->blockUpdate($pos->getSide(1), $type);
$this->blockUpdate($pos->getSide(2), $type);
$this->blockUpdate($pos->getSide(3), $type);
$this->blockUpdate($pos->getSide(4), $type);
$this->blockUpdate($pos->getSide(5), $type);
}
}
public function blockUpdate(Position $pos, $type = BLOCK_UPDATE_NORMAL){
if(!($pos instanceof Block)){
$block = $pos->level->getBlock($pos);
}else{
$pos = new Position($pos->x, $pos->y, $pos->z, $pos->level);
$block = $pos->level->getBlock($pos);
}
if($block === false){
return false;
}
$level = $block->onUpdate($type);
if($level === BLOCK_UPDATE_NORMAL){
$this->blockUpdateAround($block, $level);
$this->server->api->entity->updateRadius($pos, 3);
}elseif($level === BLOCK_UPDATE_RANDOM){
$this->scheduleBlockUpdate($pos, Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
}
return $level;
}
public function scheduleBlockUpdate(Position $pos, $delay, $type = BLOCK_UPDATE_SCHEDULED){
$type = (int) $type;
if($delay < 0){
return false;
}
$index = $pos->x.".".$pos->y.".".$pos->z.".".$pos->level->getName().".".$type;
$delay = microtime(true) + $delay * 0.05;
if(!isset($this->scheduledUpdates[$index])){
$this->scheduledUpdates[$index] = $pos;
$this->server->query("INSERT INTO blockUpdates (x, y, z, level, type, delay) VALUES (".$pos->x.", ".$pos->y.", ".$pos->z.", '".$pos->level->getName()."', ".$type.", ".$delay.");");
return true;
}
return false;
}
public function blockUpdateTick(){
$time = microtime(true);
if(count($this->scheduledUpdates) > 0){
$update = $this->server->query("SELECT x,y,z,level,type FROM blockUpdates WHERE delay <= ".$time.";");
if($update !== false and $update !== true){
while(($up = $update->fetchArray(SQLITE3_ASSOC)) !== false){
$index = $up["x"].".".$up["y"].".".$up["z"].".".$up["level"].".".$up["type"];
if(isset($this->scheduledUpdates[$index])){
$upp = $this->scheduledUpdates[$index];
unset($this->scheduledUpdates[$index]);
$this->blockUpdate($upp, (int) $up["type"]);
}
}
}
$this->server->query("DELETE FROM blockUpdates WHERE delay <= ".$time.";");
}
}
}

View File

@ -1,120 +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(){
$this->server = ServerAPI::request();
}
public function init(){
$this->server->api->console->register("tell", "<player> <private message ...>", array($this, "commandHandler"));
$this->server->api->console->register("me", "<action ...>", array($this, "commandHandler"));
$this->server->api->console->register("say", "<message ...>", array($this, "commandHandler"));
$this->server->api->ban->cmdWhitelist("tell");
$this->server->api->ban->cmdWhitelist("me");
}
public function commandHandler($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "say":
$s = implode(" ", $params);
if(trim($s) == ""){
$output .= "Usage: /say <message>\n";
break;
}
$sender = ($issuer instanceof Player) ? "Server":ucfirst($issuer);
$this->server->api->chat->broadcast("[$sender] ".$s);
break;
case "me":
if(!($issuer instanceof Player)){
if($issuer === "rcon"){
$sender = "Rcon";
}else{
$sender = ucfirst($issuer);
}
}else{
$sender = $issuer->username;
}
$this->broadcast("* $sender ".implode(" ", $params));
break;
case "tell":
if(!isset($params[0]) or !isset($params[1])){
$output .= "Usage: /$cmd <player> <message>\n";
break;
}
if(!($issuer instanceof Player)){
$sender = ucfirst($issuer);
}else{
$sender = $issuer->username;
}
$n = array_shift($params);
$target = $this->server->api->player->get($n);
if($target instanceof Player){
$target = $target->username;
}else{
$target = strtolower($n);
if($t === "server" or $t === "console" or $t === "rcon"){
$target = "Console";
}
}
$mes = implode(" ", $params);
$output .= "[me -> ".$target."] ".$mes."\n";
if($target !== "Console" and $target !== "Rcon"){
$this->sendTo(false, "[".$sender." -> me] ".$mes, $target);
}
console("[INFO] [".$sender." -> ".$target."] ".$mes);
break;
}
return $output;
}
public function broadcast($message){
$this->send(false, $message);
}
public function sendTo($owner, $text, $player){
$this->send($owner, $text, array($player));
}
public function send($owner, $text, $whitelist = false, $blacklist = false){
$message = "";
if($owner !== false){
if($owner instanceof Player){
$message = "<".$owner->username."> ";
}else{
$message = "<".$owner."> ";
}
}
$message .= $text;
if($whitelist === false){
console("[INFO] ".$message);
}
$this->server->handle("server.chat", new Container($message, $whitelist, $blacklist));
}
}

View File

@ -1,321 +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, $alias;
function __construct(){
$this->help = array();
$this->cmds = array();
$this->alias = array();
$this->server = ServerAPI::request();
$this->last = microtime(true);
}
public function init(){
$this->server->schedule(2, array($this, "handle"), array(), true);
$this->loop = new ConsoleLoop();
$this->register("help", "[page|command name]", array($this, "defaultCommands"));
$this->register("status", "", array($this, "defaultCommands"));
$this->register("difficulty", "<0|1|2|3>", array($this, "defaultCommands"));
$this->register("stop", "", array($this, "defaultCommands"));
$this->register("defaultgamemode", "<mode>", array($this, "defaultCommands"));
$this->server->api->ban->cmdWhitelist("help");
}
function __destruct(){
$this->server->deleteEvent($this->event);
$this->loop->stop();
$this->loop->notify();
//$this->loop->join();
}
public function defaultCommands($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "defaultgamemode":
$gms = array(
"0" => SURVIVAL,
"survival" => SURVIVAL,
"s" => SURVIVAL,
"1" => CREATIVE,
"creative" => CREATIVE,
"c" => CREATIVE,
"2" => ADVENTURE,
"adventure" => ADVENTURE,
"a" => ADVENTURE,
"3" => VIEW,
"view" => VIEW,
"viewer" => VIEW,
"spectator" => VIEW,
"v" => VIEW,
);
if(!isset($gms[strtolower($params[0])])){
$output .= "Usage: /$cmd <mode>\n";
break;
}
$this->server->api->setProperty("gamemode", $gms[strtolower($params[0])]);
$output .= "Default Gamemode is now ".strtoupper($this->server->getGamemode()).".\n";
break;
case "status":
if(!($issuer instanceof Player) and $issuer === "console"){
$this->server->debugInfo(true);
}
$info = $this->server->debugInfo();
$output .= "TPS: ".$info["tps"].", Memory usage: ".$info["memory_usage"]." (Peak ".$info["memory_peak_usage"].")\n";
break;
case "update-done":
$this->server->api->setProperty("last-update", time());
break;
case "stop":
$this->loop->stop = true;
$output .= "Stopping the server\n";
$this->server->close();
break;
case "difficulty":
$s = trim(array_shift($params));
if($s == "" or (((int) $s) !== 0 and ((int) $s) !== 1)){
$output .= "Usage: /difficulty <0|1|2|3>\n";
break;
}
$this->server->api->setProperty("difficulty", (int) $s);
$output .= "Difficulty changed to ".$this->server->difficulty."\n";
break;
case "?":
if($issuer !== "console" and $issuer !== "rcon"){
break;
}
case "help":
if(isset($params[0]) and !is_numeric($params[0])){
$c = trim(strtolower($params[0]));
if(isset($this->help[$c]) or isset($this->alias[$c])){
$c = isset($this->help[$c]) ? $c : $this->alias[$c];
if($this->server->api->dhandle("console.command.".$c, array("cmd" => $c, "parameters" => array(), "issuer" => $issuer, "alias" => false)) === false
or $this->server->api->dhandle("console.command", array("cmd" => $c, "parameters" => array(), "issuer" => $issuer, "alias" => false)) === false){
break;
}
$output .= "Usage: /$c ".$this->help[$c]."\n";
break;
}
}
$cmds = array();
foreach($this->help as $c => $h){
if($this->server->api->dhandle("console.command.".$c, array("cmd" => $c, "parameters" => array(), "issuer" => $issuer, "alias" => false)) === false
or $this->server->api->dhandle("console.command", array("cmd" => $c, "parameters" => array(), "issuer" => $issuer, "alias" => false)) === false){
continue;
}
$cmds[$c] = $h;
}
$max = ceil(count($cmds) / 5);
$page = (int) (isset($params[0]) ? min($max, max(1, intval($params[0]))):1);
$output .= "- Showing help page $page of $max (/help <page>) -\n";
$current = 1;
foreach($cmds as $c => $h){
$curpage = (int) ceil($current / 5);
if($curpage === $page){
$output .= "/$c ".$h."\n";
}elseif($curpage > $page){
break;
}
++$current;
}
break;
default:
$output .= "Command doesn't exist! Use /help\n";
break;
}
return $output;
}
public function alias($alias, $cmd){
$this->alias[strtolower(trim($alias))] = trim($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;
ksort($this->help, SORT_NATURAL | SORT_FLAG_CASE);
}
public function run($line = "", $issuer = "console", $alias = false){
if($line != ""){
$end = strpos($line, " ");
if($end === false){
$end = strlen($line);
}
$cmd = strtolower(substr($line, 0, $end));
$params = (string) substr($line, $end + 1);
if(isset($this->alias[$cmd])){
return $this->run($this->alias[$cmd] . ($params !== "" ? " " .$params:""), $issuer, $cmd);
}
if($issuer instanceof Player){
console("[DEBUG] \x1b[33m".$issuer->username."\x1b[0m issued server command: ".ltrim("$alias ")."/$cmd ".$params, true, true, 2);
}else{
console("[DEBUG] \x1b[33m*".$issuer."\x1b[0m issued server command: ".ltrim("$alias ")."/$cmd ".$params, true, true, 2);
}
if(preg_match_all('#@([@a-z]{1,})#', $params, $matches, PREG_OFFSET_CAPTURE) > 0){
$offsetshift = 0;
foreach($matches[1] as $selector){
if($selector[0]{0} === "@"){ //Escape!
$params = substr_replace($params, $selector[0], $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1);
--$offsetshift;
continue;
}
switch(strtolower($selector[0])){
case "u":
case "player":
case "username":
$p = ($issuer instanceof Player) ? $issuer->username:$issuer;
$params = substr_replace($params, $p, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1);
$offsetshift -= strlen($selector[0]) - strlen($p) + 1;
break;
case "w":
case "world":
$p = ($issuer instanceof Player) ? $issuer->level->getName():$this->server->api->level->getDefault()->getName();
$params = substr_replace($params, $p, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1);
$offsetshift -= strlen($selector[0]) - strlen($p) + 1;
break;
case "a":
case "all":
$output = "";
foreach($this->server->api->player->getAll() as $p){
$output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias);
}
return $output;
case "r":
case "random":
$l = array();
foreach($this->server->api->player->getAll() as $p){
if($p !== $issuer){
$l[] = $p;
}
}
if(count($l) === 0){
return;
}
$p = $l[mt_rand(0, count($l) - 1)]->username;
$params = substr_replace($params, $p, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1);
$offsetshift -= strlen($selector[0]) - strlen($p) + 1;
break;
}
}
}
$params = explode(" ", $params);
if(count($params) === 1 and $params[0] === ""){
$params = array();
}
if(($d1 = $this->server->api->dhandle("console.command.".$cmd, array("cmd" => $cmd, "parameters" => $params, "issuer" => $issuer, "alias" => $alias))) === false
or ($d2 = $this->server->api->dhandle("console.command", array("cmd" => $cmd, "parameters" => $params, "issuer" => $issuer, "alias" => $alias))) === false){
$output = "You don't have permissions to use this command.\n";
}elseif($d1 !== true and $d2 !== true){
if(isset($this->cmds[$cmd]) and is_callable($this->cmds[$cmd])){
$output = @call_user_func($this->cmds[$cmd], $cmd, $params, $issuer, $alias);
}elseif($this->server->api->dhandle("console.command.unknown", array("cmd" => $cmd, "params" => $params, "issuer" => $issuer, "alias" => $alias)) !== false){
$output = $this->defaultCommands($cmd, $params, $issuer, $alias);
}
}else{
$output = "";
}
if($output != "" and ($issuer instanceof Player)){
$issuer->sendChat(trim($output));
}
return $output;
}
}
public function handle($time){
if($this->loop->line !== false){
$line = trim($this->loop->line);
$this->loop->line = false;
$output = $this->run($line, "console");
if($output != ""){
$mes = explode("\n", trim($output));
foreach($mes as $m){
console("[CMD] ".$m);
}
}
}else{
$this->loop->notify();
}
}
}
class ConsoleLoop extends Thread{
public $line;
public $stop;
public $base;
public $ev;
public $fp;
public function __construct(){
$this->line = false;
$this->stop = false;
$this->start();
}
public function stop(){
$this->stop = true;
}
private function readLine(){
if( $this->fp ){
$line = trim( fgets( $this->fp ) );
} else {
$line = trim( readline( "" ) );
if( $line != "" ){
readline_add_history( $line );
}
}
return $line;
}
public function run(){
if( ! extension_loaded( 'readline' ) ){
$this->fp = fopen( "php://stdin", "r" );
}
while( $this->stop === false ) {
$this->line = $this->readLine();
$this->wait();
$this->line = false;
}
if( ! $this->haveReadline ) {
@fclose($fp);
}
exit(0);
}
}

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 EntityAPI{
private $server;
private $entities;
private $eCnt = 1;
function __construct(){
$this->entities = array();
$this->server = ServerAPI::request();
}
public function get($eid){
if(isset($this->entities[$eid])){
return $this->entities[$eid];
}
return false;
}
public function init(){
$this->server->schedule(25, array($this, "updateEntities"), array(), true);
}
public function updateEntities(){
$l = $this->server->query("SELECT EID FROM entities WHERE hasUpdate = 1;");
if($l !== false and $l !== true){
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
$e = $this->get($e["EID"]);
if($e instanceof Entity){
$e->update();
$this->server->query("UPDATE entities SET hasUpdate = 0 WHERE EID = ".$e->eid.";");
}
}
}
}
public function updateRadius(Position $center, $radius = 15, $class = false){
$this->server->query("UPDATE entities SET hasUpdate = 1 WHERE level = '".$center->level->getName()."' ".($class !== false ? "AND class = $class ":"")."AND abs(x - {$center->x}) <= $radius AND abs(y - {$center->y}) <= $radius AND abs(z - {$center->z}) <= $radius;");
}
public function getRadius(Position $center, $radius = 15, $class = false){
$entities = array();
$l = $this->server->query("SELECT EID FROM entities WHERE level = '".$center->level->getName()."' ".($class !== false ? "AND class = $class ":"")."AND abs(x - {$center->x}) <= $radius AND abs(y - {$center->y}) <= $radius AND abs(z - {$center->z}) <= $radius;");
if($l !== false and $l !== true){
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
$e = $this->get($e["EID"]);
if($e instanceof Entity){
$entities[$e->eid] = $e;
}
}
}
return $entities;
}
public function getAll($level = null){
if($level instanceof Level){
$entities = array();
$l = $this->server->query("SELECT EID FROM entities WHERE level = '".$level->getName()."';");
if($l !== false and $l !== true){
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
$e = $this->get($e["EID"]);
if($e instanceof Entity){
$entities[$e->eid] = $e;
}
}
}
return $entities;
}
return $this->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(Level $level, $class, $type = 0, $data = array()){
$eid = $this->eCnt++;
$this->entities[$eid] = new Entity($level, $eid, $class, $type, $data);
$this->server->handle("entity.add", $this->entities[$eid]);
return $this->entities[$eid];
}
public function spawnToAll(Entity $e){
foreach($this->server->api->player->getAll($e->level) as $player){
if($player->eid !== false and $player->eid !== $e->eid){
$e->spawn($player);
}
}
}
public function drop(Position $pos, Item $item){
if($item->getID() === AIR or $item->count <= 0){
return;
}
$data = array(
"x" => $pos->x,
"y" => $pos->y + 0.19,
"z" => $pos->z,
//"speedX" => mt_rand(-3, 3) / 8,
"speedY" => mt_rand(5, 8) / 2,
//"speedZ" => mt_rand(-3, 3) / 8,
"item" => $item,
);
if($this->server->api->handle("item.drop", $data) !== false){
for($count = $item->count; $count > 0; ){
$item->count = min($item->getMaxStackSize(), $count);
$count -= $item->count;
$e = $this->add($pos->level, ENTITY_ITEM, $item->getID(), $data);
$this->spawnToAll($e);
$this->server->api->handle("entity.motion", $e);
}
}
}
public function spawnAll(Player $player){
foreach($this->getAll($player->level) as $e){
$e->spawn($player);
}
}
public function remove($eid){
if(isset($this->entities[$eid])){
$entity = $this->entities[$eid];
$this->entities[$eid] = null;
unset($this->entities[$eid]);
$entity->closed = true;
$this->server->query("DELETE FROM entities WHERE EID = ".$eid.";");
$this->server->api->dhandle("entity.remove", $entity);
$entity = null;
unset($entity);
}
}
}

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 LevelAPI{
private $server, $levels, $default;
public function __construct(){
$this->server = ServerAPI::request();
$this->levels = array();
}
public function get($name){
if(isset($this->levels[$name])){
return $this->levels[$name];
}
return false;
}
public function getDefault(){
return $this->levels[$this->default];
}
public function init(){
$this->server->api->console->register("seed", "[world]", array($this, "commandHandler"));
$this->server->api->console->register("save-all", "", array($this, "commandHandler"));
$this->server->api->console->register("save-on", "", array($this, "commandHandler"));
$this->server->api->console->register("save-off", "", array($this, "commandHandler"));
$this->default = $this->server->api->getProperty("level-name");
if($this->loadLevel($this->default) === false){
$this->generateLevel($this->default, $this->server->seed);
$this->loadLevel($this->default);
}
$this->server->spawn = $this->getDefault()->getSpawn();
}
public function commandHandler($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "save-all":
$save = $this->server->saveEnabled;
$this->server->saveEnabled = true;
$this->saveAll();
$this->server->saveEnabled = $save;
break;
case "save-on":
$this->server->saveEnabled = true;
break;
case "save-off":
$this->server->saveEnabled = false;
break;
case "seed":
if(!isset($params[0]) and ($issuer instanceof Player)){
$output .= "Seed: ".$issuer->level->getSeed()."\n";
}elseif(isset($params[0])){
if(($lv = $this->server->api->level->get(trim(implode(" ", $params)))) !== false){
$output .= "Seed: ".$lv->getSeed()."\n";
}
}else{
$output .= "Seed: ".$this->server->api->level->getDefault()->getSeed()."\n";
}
}
return $output;
}
public function generateLevel($name, $seed = false, $generator = false){
if($this->levelExists($name)){
return false;
}
$options = array();
if($this->server->api->getProperty("generator-settings") !== false and trim($this->server->api->getProperty("generator-settings")) != ""){
$options["preset"] = $this->server->api->getProperty("generator-settings");
}
if($generator !== false and class_exists($generator)){
$generator = new $generator($options);
}else{
if(strtoupper($this->server->api->getProperty("level-type")) == "FLAT"){
$generator = new SuperflatGenerator($options);
}else{
$generator = new TemporalGenerator($options);
}
}
$gen = new WorldGenerator($generator, $name, $seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)):(int) $seed);
$gen->generate();
$gen->close();
return true;
}
public function levelExists($name){
if($name === ""){
return false;
}
$path = DATA_PATH."worlds/".$name."/";
if($this->get($name) === false and !file_exists($path."level.pmf")){
$level = new LevelImport($path);
if($level->import() === false){
return false;
}
}
return true;
}
public function unloadLevel(Level $level, $force = false){
$name = $level->getName();
if($name === $this->default and $force !== true){
return false;
}
console("[INFO] Unloading level \"".$name."\"");
$level->nextSave = PHP_INT_MAX;
$level->save();
foreach($this->server->api->player->getAll($level) as $player){
$player->teleport($this->server->spawn);
}
foreach($this->server->api->entity->getAll($level) as $entity){
if($entity->class !== ENTITY_PLAYER){
$entity->close();
}
}
foreach($this->server->api->tile->getAll($level) as $tile){
$tile->close();
}
$level->close();
unset($this->levels[$name]);
return true;
}
public function loadLevel($name){
if($this->get($name) !== false){
return true;
}elseif($this->levelExists($name) === false){
console("[NOTICE] Level \"".$name."\" not found");
return false;
}
$path = DATA_PATH."worlds/".$name."/";
console("[INFO] Preparing level \"".$name."\"");
$level = new PMFLevel($path."level.pmf");
$entities = new Config($path."entities.yml", CONFIG_YAML);
if(file_exists($path."tileEntities.yml")){
@rename($path."tileEntities.yml", $path."tiles.yml");
}
$tiles = new Config($path."tiles.yml", CONFIG_YAML);
$blockUpdates = new Config($path."bupdates.yml", CONFIG_YAML);
$this->levels[$name] = new Level($level, $entities, $tiles, $blockUpdates, $name);
foreach($entities->getAll() as $entity){
if(!isset($entity["id"])){
break;
}
if($entity["id"] === 64){ //Item Drop
$e = $this->server->api->entity->add($this->levels[$name], 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],
));
}elseif($entity["id"] === FALLING_SAND){
$e = $this->server->api->entity->add($this->levels[$name], ENTITY_FALLING, $entity["id"], $entity);
$e->setPosition(new Vector3($entity["Pos"][0], $entity["Pos"][1], $entity["Pos"][2]), $entity["Rotation"][0], $entity["Rotation"][1]);
$e->setHealth($entity["Health"]);
}elseif($entity["id"] === OBJECT_PAINTING or $entity["id"] === OBJECT_ARROW){ //Painting
$e = $this->server->api->entity->add($this->levels[$name], ENTITY_OBJECT, $entity["id"], $entity);
$e->setPosition(new Vector3($entity["Pos"][0], $entity["Pos"][1], $entity["Pos"][2]), $entity["Rotation"][0], $entity["Rotation"][1]);
$e->setHealth($entity["Health"]);
}else{
$e = $this->server->api->entity->add($this->levels[$name], ENTITY_MOB, $entity["id"], $entity);
$e->setPosition(new Vector3($entity["Pos"][0], $entity["Pos"][1], $entity["Pos"][2]), $entity["Rotation"][0], $entity["Rotation"][1]);
$e->setHealth($entity["Health"]);
}
}
foreach($tiles->getAll() as $tile){
if(!isset($tile["id"])){
break;
}
$t = $this->server->api->tile->add($this->levels[$name], $tile["id"], $tile["x"], $tile["y"], $tile["z"], $tile);
}
$timeu = microtime(true);
foreach($blockUpdates->getAll() as $bupdate){
$this->server->api->block->scheduleBlockUpdate(new Position((int) $bupdate["x"],(int) $bupdate["y"],(int) $bupdate["z"], $this->levels[$name]), (float) $bupdate["delay"], (int) $bupdate["type"]);
}
return true;
}
public function handle($data, $event){
switch($event){
}
}
public function saveAll(){
foreach($this->levels as $level){
$level->save();
}
}
public function __destruct(){
$this->saveAll();
foreach($this->levels as $level){
$this->unloadLevel($level, true);
}
}
public function getSpawn(){
return $this->server->spawn;
}
public function loadMap(){
if($this->mapName !== false and trim($this->mapName) !== ""){
if(!file_exists($this->mapDir."level.pmf")){
$level = new LevelImport($this->mapDir);
$level->import();
}
$this->level = new PMFLevel($this->mapDir."level.pmf");
console("[INFO] Preparing level \"".$this->level->getData("name")."\"");
$this->time = (int) $this->level->getData("time");
$this->seed = (int) $this->level->getData("seed");
$this->spawn = $this->level->getSpawn();
}
}
}

View File

@ -1,37 +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 MobAPI{
private $server;
function __construct(){
$this->server = ServerAPI::request();
}
public function init(){
}
}

View File

@ -1,442 +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(){
$this->server = ServerAPI::request();
}
public function init(){
$this->server->schedule(20 * 15, array($this, "handle"), 1, true, "server.regeneration");
$this->server->addHandler("player.death", array($this, "handle"), 1);
$this->server->api->console->register("list", "", array($this, "commandHandler"));
$this->server->api->console->register("kill", "<player>", array($this, "commandHandler"));
$this->server->api->console->register("gamemode", "<mode> [player]", array($this, "commandHandler"));
$this->server->api->console->register("tp", "[target player] <destination player|w:world> OR /tp [target player] <x> <y> <z>", array($this, "commandHandler"));
$this->server->api->console->register("spawnpoint", "[player] [x] [y] [z]", array($this, "commandHandler"));
$this->server->api->console->register("spawn", "", array($this, "commandHandler"));
$this->server->api->console->register("ping", "", array($this, "commandHandler"));
$this->server->api->console->alias("lag", "ping");
$this->server->api->console->alias("suicide", "kill");
$this->server->api->console->alias("tppos", "tp");
$this->server->api->ban->cmdWhitelist("list");
$this->server->api->ban->cmdWhitelist("ping");
$this->server->api->ban->cmdWhitelist("spawn");
$this->server->preparedSQL->selectPlayersToHeal = $this->server->database->prepare("SELECT EID FROM entities WHERE class = ".ENTITY_PLAYER." AND health < 20;");
}
public function handle($data, $event){
switch($event){
case "server.regeneration":
if($this->server->difficulty === 0){
$result = $this->server->preparedSQL->selectPlayersToHeal->execute();
if($result !== false){
while(($player = $result->fetchArray()) !== false){
if(($player = $this->server->api->entity->get($player["EID"])) !== false){
if($player->getHealth() <= 0){
continue;
}
$player->setHealth(min(20, $player->getHealth() + $data), "regeneration");
}
}
return true;
}
}
break;
case "player.death":
if(is_numeric($data["cause"])){
$e = $this->server->api->entity->get($data["cause"]);
if($e instanceof Entity){
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 = " went up in flames";
break;
case "burning":
$message = " burned to death";
break;
case "suffocation":
$message = " suffocated in a wall";
break;
case "water":
$message = " drowned";
break;
case "void":
$message = " fell out of the world";
break;
case "fall":
$message = " hit the ground too hard";
break;
default:
$message = " died";
break;
}
}
$this->server->api->chat->broadcast($data["player"]->username . $message);
return true;
break;
}
}
public function commandHandler($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "spawnpoint":
if(!($issuer instanceof Player)){
$output .= "Please run this command in-game.\n";
break;
}
if(count($params) === 1 or count($params) === 4){
$target = $this->server->api->player->get(array_shift($params));
}else{
$target = $issuer;
}
if(!($target instanceof Player)){
$output .= "That player cannot be found.\n";
break;
}
if(count($params) === 3){
$spawn = new Position(floatval(array_shift($params)), floatval(array_shift($params)), floatval(array_shift($params)), $issuer->level);
}else{
$spawn = new Position($issuer->entity->x, $issuer->entity->y, $issuer->entity->z, $issuer->entity->level);
}
$target->setSpawn($spawn);
$output .= "Spawnpoint set correctly!\n";
break;
case "spawn":
if(!($issuer instanceof Player)){
$output .= "Please run this command in-game.\n";
break;
}
$spawn = $issuer->getSpawn();
$issuer->teleport($spawn);
break;
case "ping":
if(!($issuer instanceof Player)){
$output .= "Please run this command in-game.\n";
break;
}
$output .= "ping ".round($issuer->getLag(), 2)."ms, packet loss ".round($issuer->getPacketLoss() * 100, 2)."%, ".round($issuer->getBandwidth() / 1024, 2)." KB/s\n";
break;
case "gamemode":
$player = false;
$gms = array(
"0" => SURVIVAL,
"survival" => SURVIVAL,
"s" => SURVIVAL,
"1" => CREATIVE,
"creative" => CREATIVE,
"c" => CREATIVE,
"2" => ADVENTURE,
"adventure" => ADVENTURE,
"a" => ADVENTURE,
"3" => VIEW,
"view" => VIEW,
"viewer" => VIEW,
"spectator" => VIEW,
"v" => VIEW,
);
if($issuer instanceof Player){
$player = $issuer;
}
if(isset($params[1])){
$player = $this->server->api->player->get($params[1]);
}
if(!($player instanceof Player) or !isset($gms[strtolower($params[0])])){
$output .= "Usage: /$cmd <mode> [player]\n";
break;
}
if($player->setGamemode($gms[strtolower($params[0])])){
$output .= "Gamemode of ".$player->username." changed to ".$player->getGamemode()."\n";
}
break;
case "tp":
if(count($params) <= 2 or substr($params[0], 0, 2) === "w:" or substr($params[1], 0, 2) === "w:"){
if((!isset($params[1]) or substr($params[0], 0, 2) === "w:") and isset($params[0]) and ($issuer instanceof Player)){
$name = $issuer->username;
$target = implode(" ", $params);
}elseif(isset($params[1]) and isset($params[0])){
$name = array_shift($params);
$target = implode(" ", $params);
}else{
$output .= "Usage: /$cmd [target player] <destination player>\n";
break;
}
if($this->teleport($name, $target) !== false){
$output .= "\"$name\" teleported to \"$target\"\n";
}else{
$output .= "Couldn't teleport.\n";
}
}else{
if(!isset($params[3]) and isset($params[2]) and isset($params[1]) and isset($params[0]) and ($issuer instanceof Player)){
$name = $issuer->username;
$x = $params[0];
$y = $params[1];
$z = $params[2];
}elseif(isset($params[3]) and isset($params[2]) and isset($params[1]) and isset($params[0])){
$name = $params[0];
$x = $params[1];
$y = $params[2];
$z = $params[3];
}else{
$output .= "Usage: /$cmd [player] <x> <y> <z>\n";
break;
}
if($this->tppos($name, $x, $y, $z)){
$output .= "\"$name\" teleported to ($x, $y, $z)\n";
}else{
$output .= "Couldn't teleport.\n";
}
}
break;
case "kill":
case "suicide":
if(!isset($params[0]) and ($issuer instanceof Player)){
$player = $issuer;
}else{
$player = $this->get($params[0]);
}
if($player instanceof Player){
$player->entity->harm(1000, "console", true);
$player->sendChat("Ouch. That looks like it hurt.\n");
}else{
$output .= "Usage: /$cmd [player]\n";
}
break;
case "list":
$output .= "There are ".count($this->server->clients)."/".$this->server->maxClients." players online:\n";
if(count($this->server->clients) == 0){
break;
}
foreach($this->server->clients as $c){
$output .= $c->username.", ";
}
$output = substr($output, 0, -2)."\n";
break;
}
return $output;
}
public function teleport(&$name, &$target){
if(substr($target, 0, 2) === "w:"){
$lv = $this->server->api->level->get(substr($target, 2));
if($lv instanceof Level){
$origin = $this->get($name);
if($origin instanceof Player){
$name = $origin->username;
return $origin->teleport($lv->getSpawn());
}
}else{
return false;
}
}
$player = $this->get($target);
if(($player instanceof Player) and ($player->entity instanceof Entity)){
$target = $player->username;
$origin = $this->get($name);
if($origin instanceof Player){
$name = $origin->username;
return $origin->teleport($player->entity);
}
}
return false;
}
public function tppos(&$name, &$x, &$y, &$z){
$player = $this->get($name);
if(($player instanceof Player) and ($player->entity instanceof Entity)){
$name = $player->username;
$x = $x{0} === "~" ? $player->entity->x + floatval(substr($x, 1)):floatval($x);
$y = $y{0} === "~" ? $player->entity->y + floatval(substr($y, 1)):floatval($y);
$z = $z{0} === "~" ? $player->entity->z + floatval(substr($z, 1)):floatval($z);
$player->teleport(new Vector3($x, $y, $z));
return true;
}
return false;
}
public function get($name, $alike = true){
$name = trim(strtolower($name));
if($name === ""){
return false;
}
$CID = $this->server->query("SELECT ip,port FROM players WHERE name ".($alike === true ? "LIKE '%".$name."%'":"= '".$name."'").";", true);
$CID = PocketMinecraftServer::clientID($CID["ip"], $CID["port"]);
if(isset($this->server->clients[$CID])){
return $this->server->clients[$CID];
}
return false;
}
public function getAll($level = null){
if($level instanceof Level){
$clients = array();
$l = $this->server->query("SELECT EID FROM entities WHERE level = '".$level->getName()."' AND class = '".ENTITY_PLAYER."';");
if($l !== false and $l !== true){
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
$e = $this->getByEID($e["EID"]);
if($e instanceof Player){
$clients[$e->CID] = $e;
}
}
}
return $clients;
}
return $this->server->clients;
}
public function broadcastPacket(array $players, $id, $data = array()){
$data = new CustomPacketHandler($id, "", $data, true);
$packet = array("raw" => chr($id).$data->raw);
foreach($players as $p){
$p->dataPacket(false, $packet);
}
}
public function getByEID($eid){
$eid = (int) $eid;
$CID = $this->server->query("SELECT ip,port FROM players WHERE EID = '".$eid."';", true);
$CID = PocketMinecraftServer::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];
$player->data = $this->getOffline($player->username);
$player->gamemode = $player->data->get("gamemode");
if(($player->level = $this->server->api->level->get($player->data->get("position")["level"])) === false){
$player->level = $this->server->api->level->getDefault();
$player->data->set("position", array(
"level" => $player->level->getName(),
"x" => $player->level->getSpawn()->x,
"y" => $player->level->getSpawn()->y,
"z" => $player->level->getSpawn()->z,
));
}
$this->server->query("INSERT OR REPLACE INTO players (CID, ip, port, name) VALUES (".$player->CID.", '".$player->ip."', ".$player->port.", '".strtolower($player->username)."');");
}
}
public function remove($CID){
if(isset($this->server->clients[$CID])){
$player = $this->server->clients[$CID];
$this->server->clients[$CID] = null;
unset($this->server->clients[$CID]);
$player->close();
if($player->username != "" and ($player->data instanceof Config)){
$this->saveOffline($player->data);
}
$this->server->query("DELETE FROM players WHERE name = '".$player->username."';");
if($player->entity instanceof Entity){
$player->entity->player = null;
$player->entity = null;
}
$this->server->api->entity->remove($player->eid);
$player = null;
unset($player);
}
}
public function getOffline($name){
$iname = strtolower($name);
$default = array(
"caseusername" => $name,
"position" => array(
"level" => $this->server->spawn->level->getName(),
"x" => $this->server->spawn->x,
"y" => $this->server->spawn->y,
"z" => $this->server->spawn->z,
),
"spawn" => array(
"level" => $this->server->spawn->level->getName(),
"x" => $this->server->spawn->x,
"y" => $this->server->spawn->y,
"z" => $this->server->spawn->z,
),
"inventory" => array_fill(0, PLAYER_SURVIVAL_SLOTS, array(AIR, 0, 0)),
"armor" => array_fill(0, 4, array(AIR, 0, 0)),
"gamemode" => $this->server->gamemode,
"health" => 20,
"lastIP" => "",
"lastID" => 0,
);
if(!file_exists(DATA_PATH."players/".$iname.".yml")){
console("[NOTICE] Player data not found for \"".$iname."\", creating new profile");
$data = new Config(DATA_PATH."players/".$iname.".yml", CONFIG_YAML, $default);
$data->save();
}else{
$data = new Config(DATA_PATH."players/".$iname.".yml", CONFIG_YAML, $default);
}
if(($this->server->gamemode & 0x01) === 0x01){
$data->set("health", 20);
}
$this->server->handle("player.offline.get", $data);
return $data;
}
public function saveOffline(Config $data){
$this->server->handle("player.offline.save", $data);
$data->save();
}
}

View File

@ -1,214 +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(){
$this->server = ServerAPI::request();
}
public function getList(){
$list = array();
foreach($this->plugins as $p){
$list[] = $p[1];
}
return $list;
}
public function getInfo($className){
$className = strtolower($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){
if(strtolower(substr($file, -3)) === "pmf"){
$pmf = new PMFPlugin($file);
$info = $pmf->getPluginInfo();
}else{
$content = file_get_contents($file);
$info = strstr($content, "*/", true);
$content = str_repeat(PHP_EOL, substr_count($info, "\n")).substr(strstr($content, "*/"),2);
if(preg_match_all('#([a-zA-Z0-9\-_]*)=([^\r\n]*)#u', $info, $matches) == 0){ //false or 0 matches
console("[ERROR] 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;
}
$info["code"] = $content;
$info["class"] = trim(strtolower($info["class"]));
}
if(!isset($info["name"]) or !isset($info["version"]) or !isset($info["class"]) or !isset($info["author"])){
console("[ERROR] Failed parsing of ".basename($file));
return false;
}
console("[INFO] Loading plugin \"\x1b[32m".$info["name"]."\x1b[0m\" \x1b[35m".$info["version"]." \x1b[0mby \x1b[36m".$info["author"]."\x1b[0m");
if($info["class"] !== "none" and class_exists($info["class"])){
console("[ERROR] Failed loading plugin: class already exists");
return false;
}
if(eval($info["code"]) === false or ($info["class"] !== "none" and !class_exists($info["class"]))){
console("[ERROR] Failed loading plugin: evaluation error");
return false;
}
$className = $info["class"];
$apiversion = array_map("intval", explode(",", (string) $info["apiversion"]));
if(!in_array((string) CURRENT_API_VERSION, $apiversion)){
console("[WARNING] Plugin \"".$info["name"]."\" may not be compatible with the API (".$info["apiversion"]." != ".CURRENT_API_VERSION.")! It can crash or corrupt the server!");
}
if($info["class"] !== "none"){
$object = new $className($this->server->api, false);
if(!($object instanceof Plugin)){
console("[ERROR] 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);
}
}else{
$this->plugins[md5($info["name"])] = array(new DummyPlugin($this->server->api, false), $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 = DATA_PATH."plugins/".$p[1]["name"]."/";
$this->plugins[$p[1]["class"]][1]["path"] = $path;
@mkdir($path);
return $path;
}
public function createConfig(Plugin $plugin, $default = array()){
$p = $this->get($plugin);
if($p === false){
return false;
}
$path = $this->configPath($plugin);
$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(){
$dir = dir(DATA_PATH."plugins/");
while(false !== ($file = $dir->read())){
if($file{0} !== "."){
$ext = strtolower(substr($file, -3));
if($ext === "php" or $ext === "pmf"){
$this->load(DATA_PATH."plugins/" . $file);
}
}
}
}
public function initAll(){
console("[INFO] Starting plugins...");
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();
}
class DummyPlugin implements Plugin{
public function __construct(ServerAPI $api, $server = false){
}
public function init(){
}
public function __destruct(){
}
}

View File

@ -1,418 +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{
public $restart = false;
private static $serverRequest = false;
private $asyncCalls = array();
private $server;
private $config;
private $apiList = array();
private $asyncCnt = 0;
private $rcon;
private $query;
public static function request(){
return self::$serverRequest;
}
public function start(){
return $this->run();
}
public function run(){
$this->load();
return $this->init();
}
public function load(){
@mkdir(DATA_PATH."players/", 0755);
@mkdir(DATA_PATH."worlds/", 0755);
@mkdir(DATA_PATH."plugins/", 0755);
console("[INFO] \x1b[33;1mPocketMine-MP ".MAJOR_VERSION." API #".CURRENT_API_VERSION.", LGPL License", true, true, 0);
console("[INFO] Loading properties...");
$this->config = new Config(DATA_PATH . "server.properties", CONFIG_PROPERTIES, array(
"server-name" => "Minecraft: PE Server",
"description" => "Server made using PocketMine-MP",
"motd" => "Welcome @player to this server!",
"server-ip" => "",
"server-port" => 19132,
"server-type" => "normal",
"memory-limit" => "128M",
"last-update" => false,
"white-list" => false,
"spawn-protection" => 16,
"view-distance" => 10,
"max-players" => 20,
"allow-flight" => false,
"spawn-animals" => true,
"spawn-mobs" => true,
"gamemode" => SURVIVAL,
"hardcore" => false,
"pvp" => true,
"difficulty" => 1,
"generator-settings" => "",
"level-name" => "world",
"level-seed" => "",
"level-type" => "DEFAULT",
"enable-query" => true,
"enable-rcon" => false,
"rcon.password" => substr(base64_encode(Utils::getRandomBytes(20, false)), 3, 10),
"send-usage" => true,
));
$this->parseProperties();
define("DEBUG", $this->getProperty("debug", 1));
if($this->getProperty("port") !== false){
$this->setProperty("server-port", $this->getProperty("port"));
$this->config->remove("port");
$this->config->remove("invisible");
}
$this->server = new PocketMinecraftServer($this->getProperty("server-name"), $this->getProperty("gamemode"), ($seed = $this->getProperty("level-seed")) != "" ? (int) $seed:false, $this->getProperty("server-port"), ($ip = $this->getProperty("server-ip")) != "" ? $ip:"0.0.0.0");
$this->server->api = $this;
self::$serverRequest = $this->server;
if($this->getProperty("upnp-forwarding") === true){
console("[INFO] [UPnP] Trying to port forward...");
UPnP_PortForward($this->getProperty("server-port"));
}
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");
$info = json_decode(Utils::curl_get("http://www.pocketmine.net/latest"), true);
if($this->server->version->isDev()){
if($info === false or !isset($info["development"])){
console("[ERROR] PocketMine API error");
}else{
$last = $info["development"]["date"];
if($last >= $this->getProperty("last-update") and $this->getProperty("last-update") !== false and GIT_COMMIT != $info["development"]["commit"]){
console("[NOTICE] \x1b[33mA new DEVELOPMENT version of PocketMine-MP has been released");
console("[NOTICE] \x1b[33mVersion \"".$info["development"]["version"]."\" [".substr($info["development"]["commit"], 0, 10)."]");
console("[NOTICE] \x1b[36mGet it at PocketMine.net or ".$info["development"]["download"]);
console("[NOTICE] This message will dissapear after issuing the command \"/update-done\"");
}else{
$this->setProperty("last-update", time());
console("[INFO] \x1b[36mThis is the latest DEVELOPMENT version");
}
}
}else{
if($info === false or !isset($info["stable"])){
console("[ERROR] PocketMine API error");
}else{
$newest = new VersionString(MAJOR_VERSION);
$newestN = $newest->getNumber();
$update = new VersionString($info["stable"]["version"]);
$updateN = $update->getNumber();
if($updateN > $newestN){
console("[NOTICE] \x1b[33mA new STABLE version of PocketMine-MP has been released");
console("[NOTICE] \x1b[36mVersion \"".$info["stable"]["version"]."\" #".$updateN);
console("[NOTICE] Get it at PocketMine.net or ".$info["stable"]["download"]);
console("[NOTICE] This message will dissapear as soon as you update");
}else{
$this->setProperty("last-update", time());
console("[INFO] \x1b[36mThis is the latest STABLE version");
}
}
}
}
$this->loadProperties();
$this->loadAPI("console", "ConsoleAPI");
$this->loadAPI("level", "LevelAPI");
$this->loadAPI("block", "BlockAPI");
$this->loadAPI("chat", "ChatAPI");
$this->loadAPI("ban", "BanAPI");
$this->loadAPI("entity", "EntityAPI");
$this->loadAPI("tile", "TileAPI");
$this->loadAPI("player", "PlayerAPI");
$this->loadAPI("time", "TimeAPI");
$this->loadAPI("mob", "MobAPI");
foreach($this->apiList as $ob){
if(is_callable(array($ob, "init"))){
$ob->init(); //Fails sometimes!!!
}
}
$this->loadAPI("plugin", "PluginAPI"); //fix :(
$this->plugin->init();
}
public function async(callable $callable, $params = array(), $remove = false){
$cnt = $this->asyncCnt++;
$this->asyncCalls[$cnt] = new Async($callable, $params);
return $remove === true ? $this->getAsync($cnt):$cnt;
}
public function getAsync($id){
if(!isset($this->asyncCalls[$id])){
return false;
}
$ob = $this->asyncCalls[$id];
unset($this->asyncCalls[$id]);
return $ob;
}
public function sendUsage(){
console("[DEBUG] Sending usage data...", true, true, 2);
$plist = "";
foreach($this->plugin->getList() as $p){
$plist .= str_replace(array(";", ":"), "", $p["name"]).":".str_replace(array(";", ":"), "", $p["version"]).";";
}
$this->asyncOperation(ASYNC_CURL_POST, array(
"url" => "http://stats.pocketmine.net/usage.php",
"data" => array(
"serverid" => $this->server->serverID,
"port" => $this->server->port,
"os" => Utils::getOS(),
"memory_total" => $this->getProperty("memory-limit"),
"memory_usage" => memory_get_usage(true),
"php_version" => PHP_VERSION,
"version" => MAJOR_VERSION,
"mc_version" => CURRENT_MINECRAFT_VERSION,
"protocol" => CURRENT_PROTOCOL,
"online" => count($this->server->clients),
"max" => $this->server->maxClients,
"plugins" => $plist,
),
), NULL);
}
public function __destruct(){
foreach($this->apiList as $i => $ob){
if(method_exists($ob, "__destruct")){
$ob->__destruct();
unset($this->apiList[$i]);
}
}
}
private function loadProperties(){
if(($memory = str_replace("B", "", strtoupper($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("[WARNING] PocketMine-MP may not work right with less than 128MB of RAM", true, true, 0);
}
@ini_set("memory_limit", $memory);
}else{
$this->setProperty("memory-limit", "128M");
}
if($this->server instanceof PocketMinecraftServer){
$this->server->setType($this->getProperty("server-type"));
$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 "server-port":
case "debug":
case "difficulty":
$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);
}
if($this->getProperty("hardcore") == 1 and $this->getProperty("difficulty") < 3){
$this->setProperty("difficulty", 3);
}
}
public function init(){
if($this->getProperty("send-usage") !== false){
$this->server->schedule(36000, array($this, "sendUsage"), array(), true); //Send usage data every 30 minutes
$this->server->schedule(6000, array($this, "sendUsage")); //Send the info after 5 minutes have passed
$this->sendUsage();
}
if($this->getProperty("enable-rcon") === true){
$this->rcon = new RCON($this->getProperty("rcon.password", ""), $this->getProperty("rcon.port", $this->getProperty("server-port")), ($ip = $this->getProperty("server-ip")) != "" ? $ip:"0.0.0.0", $this->getProperty("rcon.threads", 1), $this->getProperty("rcon.clients-per-thread", 50));
}
if($this->getProperty("enable-query") === true){
$this->query = new Query();
}
CraftingRecipes::init();
$this->server->init();
unregister_tick_function(array($this->server, "tick"));
$this->console->__destruct();
if($this->rcon instanceof RCON){
$this->rcon->stop();
}
$this->__destruct();
if($this->getProperty("upnp-forwarding") === true ){
console("[INFO] [UPnP] Removing port forward...");
UPnP_RemovePortForward($this->getProperty("server-port"));
}
return $this->restart;
}
/*-------------------------------------------------------------*/
public function asyncOperation($t, $d, $c = null){
return $this->server->asyncOperation($t, $d, $c);
}
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 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 getProperties(){
return $this->config->getAll();
}
public function getProperty($name, $default = false){
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 "server-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->exists($name) ? $this->config->get($name):$default);
}
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(isset($this->$name)){
return false;
}elseif(!class_exists($class)){
$internal = false;
if($dir === false){
$internal = true;
$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);
}else{
$internal = true;
}
$this->$name = new $class();
$this->apiList[] = $this->$name;
console("[".($internal === true ? "INTERNAL":"DEBUG")."] API \x1b[36m".$name."\x1b[0m [\x1b[30;1m".$class."\x1b[0m] loaded", true, true, ($internal === true ? 3:2));
}
}

View File

@ -1,122 +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 TileAPI{
private $server;
private $tiles;
private $tCnt = 1;
function __construct(){
$this->tiles = array();
$this->server = ServerAPI::request();
}
public function get(Position $pos){
$tile = $this->server->query("SELECT * FROM tiles WHERE level = '".$pos->level->getName()."' AND x = {$pos->x} AND y = {$pos->y} AND z = {$pos->z};", true);
if($tile !== false and $tile !== true and ($tile = $this->getByID($tile["ID"])) !== false){
return $tile;
}
return false;
}
public function getByID($id){
if($id instanceof Tile){
return $id;
}elseif(isset($this->tiles[$id])){
return $this->tiles[$id];
}
return false;
}
public function init(){
}
public function getAll($level = null){
if($level instanceof Level){
$tiles = array();
$l = $this->server->query("SELECT ID FROM tiles WHERE level = '".$level->getName()."';");
if($l !== false and $l !== true){
while(($t = $l->fetchArray(SQLITE3_ASSOC)) !== false){
$t = $this->getByID($t["ID"]);
if($t instanceof Tile){
$tiles[$t->id] = $t;
}
}
}
return $tiles;
}
return $this->tiles;
}
public function add(Level $level, $class, $x, $y, $z, $data = array()){
$id = $this->tCnt++;
$this->tiles[$id] = new Tile($level, $id, $class, $x, $y, $z, $data);
$this->spawnToAll($this->tiles[$id]);
return $this->tiles[$id];
}
public function addSign(Level $level, $x, $y, $z, $lines = array("", "", "", "")){
return $this->add($level, TILE_SIGN, $x, $y, $z, $data = array(
"id" => "Sign",
"x" => $x,
"y" => $y,
"z" => $z,
"Text1" => $lines[0],
"Text2" => $lines[1],
"Text3" => $lines[2],
"Text4" => $lines[3],
));
}
public function spawnToAll(Tile $t){
foreach($this->server->api->player->getAll($t->level) as $player){
if($player->eid !== false){
$t->spawn($player);
}
}
}
public function spawnAll(Player $player){
foreach($this->getAll($player->level) as $t){
$t->spawn($player);
}
}
public function remove($id){
if(isset($this->tiles[$id])){
$t = $this->tiles[$id];
$this->tiles[$id] = null;
unset($this->tiles[$id]);
$t->closed = true;
$t->close();
$this->server->query("DELETE FROM tiles WHERE ID = ".$id.";");
$this->server->api->dhandle("tile.remove", $t);
$t = null;
unset($t);
}
}
}

View File

@ -1,137 +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(){
$this->server = ServerAPI::request();
}
public function init(){
$this->server->api->console->register("time", "<check|set|add> [time]", array($this, "commandHandler"));
}
public function commandHandler($cmd, $params, $issuer, $alias){
$output = "";
switch($cmd){
case "time":
$level = false;
if($issuer instanceof Player){
$level = $issuer->level;
}
$p = strtolower(array_shift($params));
switch($p){
case "check":
$output .= "Time: ".$this->getDate($level).", ".$this->getPhase($level)." (".$this->get(true, $level).")\n";
break;
case "add":
$output .= "Set the time to ".$this->add(array_shift($params), $level)."\n";
break;
case "set":
$output .= "Set the time to ".$this->set(array_shift($params), $level)."\n";
break;
case "sunrise":
case "day":
case "sunset":
case "night":
$output .= "Set the time to ".$this->set($p, $level)."\n";
break;
default:
$output .= "Usage: /time <check|set|add> [time]\n";
break;
}
break;
}
return $output;
}
public function night(){
return $this->set("night");
}
public function day(){
return $this->set("day");
}
public function sunrise(){
return $this->set("sunrise");
}
public function sunset(){
return $this->set("sunset");
}
public function get($raw = false, $level = false){
if(!($level instanceof Level)){
$level = $this->server->api->level->getDefault();
}
return $raw === true ? $level->getTime():abs($level->getTime()) % 19200;
}
public function add($time, $level = false){
if(!($level instanceof Level)){
$level = $this->server->api->level->getDefault();
}
$level->setTime($level->getTime() + (int) $time);
}
public function getDate($time = false){
$time = !is_integer($time) ? $this->get(false, $time):$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 = !is_integer($time) ? $this->get(false, $time):$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, $level = false){
if(!($level instanceof Level)){
$level = $this->server->api->level->getDefault();
}
if(is_string($time) and isset($this->phases[$time])){
$level->setTime($this->phases[$time]);
}else{
$level->setTime((int) $time);
}
return $level->getTime();
}
}

View File

@ -1,262 +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,
63 => true,
64 => true,
65 => true,
67 => true,
68 => true,
71 => true,
78 => true,
79 => true,
83 => true,
85 => true,
89 => true,
96 => true,
102 => true,
105 => true,
107 => true,
108 => true,
109 => true,
114 => true,
128 => true,
156 => 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,
245 => 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,
109 => true,
112 => true,
114 => true,
128 => true,
155 => true,
156 => true,
245 => true,
246 => true,
247 => true,
323 => true, //Special case of signs
338 => 83,
);
static $blocks = array(
0 => "Air",
1 => "Stone",
2 => "Grass",
3 => "Dirt",
4 => "Cobblestone",
5 => "Wooden Planks",
6 => "Sapling",
7 => "Bedrock",
);
}

View File

@ -1,41 +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(
"server.tick" => "ServerAPI::schedule()",
"server.time" => "time.change",
"world.block.change" => "block.change",
"block.drop" => "item.drop",
"api.op.check" => "op.check",
"api.player.offline.get" => "player.offline.get",
"api.player.offline.save" => "player.offline.save",
);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,659 +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{
public $tCnt;
public $serverID, $interface, $database, $version, $invisible, $api, $tickMeasure, $preparedSQL, $seed, $gamemode, $name, $maxClients, $clients, $eidCnt, $custom, $description, $motd, $port, $saveEnabled;
private $serverip, $evCnt, $handCnt, $events, $eventsID, $handlers, $serverType, $lastTick, $ticks, $memoryStats, $async = array(), $asyncID = 0;
private function load(){
$this->version = new VersionString();
@cli_set_process_title("PocketMine-MP ".MAJOR_VERSION);
if($this->version->isDev()){
console("[INFO] \x1b[31;1mThis is a Development version");
}
console("[INFO] Starting \x1b[36;1m".CURRENT_MINECRAFT_VERSION."\x1b[0m #".CURRENT_PROTOCOL." Minecraft PE Server at ".$this->serverip.":".$this->port);
if($this->port < 19132 or $this->port > 19135){ //Mojang =(
console("[WARNING] You've selected a not-standard port. Normal port range is from 19132 to 19135 included");
}
define("BOOTUP_RANDOM", Utils::getRandomBytes(16));
$this->serverID = $this->serverID === false ? Utils::readLong(Utils::getRandomBytes(8, false)):$this->serverID;
$this->seed = $this->seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)):$this->seed;
$this->startDatabase();
$this->api = false;
$this->tCnt = 1;
$this->events = array();
$this->eventsID = array();
$this->handlers = array();
$this->invisible = false;
$this->levelData = false;
$this->difficulty = 1;
$this->tiles = array();
$this->entities = array();
$this->custom = array();
$this->evCnt = 1;
$this->handCnt = 1;
$this->eidCnt = 1;
$this->maxClients = 20;
$this->schedule = array();
$this->scheduleCnt = 1;
$this->description = "";
$this->whitelist = false;
$this->memoryStats = array();
$this->clients = array();
$this->spawn = false;
$this->saveEnabled = true;
$this->tickMeasure = array_fill(0, 40, 0);
$this->setType("normal");
$this->interface = new MinecraftInterface($this, "255.255.255.255", $this->port, true, false, $this->serverip);
$this->reloadConfig();
$this->stop = false;
$this->ticks = 0;
$this->asyncThread = new AsyncMultipleQueue();
}
function __construct($name, $gamemode = SURVIVAL, $seed = false, $port = 19132, $serverip = "0.0.0.0"){
$this->port = (int) $port; //19132 - 19135
$this->doTick = true;
$this->gamemode = (int) $gamemode;
$this->name = $name;
$this->motd = "Welcome to ".$name;
$this->serverID = false;
$this->seed = $seed;
$this->serverip = $serverip;
$this->load();
}
public function getTPS(){
$v = array_values($this->tickMeasure);
$tps = 40 / ($v[39] - $v[0]);
return round($tps, 4);
}
public function titleTick(){
$time = microtime(true);
if(ENABLE_ANSI === true){
echo "\x1b]0;PocketMine-MP ".MAJOR_VERSION." | Online ". count($this->clients)."/".$this->maxClients." | RAM ".round((memory_get_usage() / 1024) / 1024, 2)."MB | U ".round(($this->interface->bandwidth[1] / max(1, $time - $this->interface->bandwidth[2])) / 1024, 2)." D ".round(($this->interface->bandwidth[0] / max(1, $time - $this->interface->bandwidth[2])) / 1024, 2)." kB/s | TPS ".$this->getTPS()."\x07";
}
$this->interface->bandwidth = array(0, 0, $time);
}
public function loadEvents(){
if(ENABLE_ANSI === true){
$this->schedule(30, array($this, "titleTick"), array(), true);
}
$this->schedule(20 * 15, array($this, "checkTicks"), array(), true);
$this->schedule(20 * 60 * 10, array($this, "checkMemory"), array(), true);
$this->schedule(20, array($this, "asyncOperationChecker"), array(), true);
}
public function checkTicks(){
if($this->getTPS() < 12){
console("[WARNING] Can't keep up! Is the server overloaded?");
}
}
public function checkMemory(){
$info = $this->debugInfo();
$data = $info["memory_usage"].",".$info["players"].",".$info["entities"];
$i = count($this->memoryStats) - 1;
if($i === -1 or $this->memoryStats[$i] !== $data){
$this->memoryStats[] = $data;
}
}
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 (CID INTEGER PRIMARY KEY, EID NUMERIC, ip TEXT, port NUMERIC, name TEXT UNIQUE COLLATE NOCASE);");
$this->query("CREATE TABLE entities (EID INTEGER PRIMARY KEY, level TEXT, type NUMERIC, class NUMERIC, hasUpdate NUMERIC, name TEXT, x NUMERIC, y NUMERIC, z NUMERIC, yaw NUMERIC, pitch NUMERIC, health NUMERIC);");
$this->query("CREATE TABLE tiles (ID INTEGER PRIMARY KEY, level TEXT, class TEXT, x NUMERIC, y NUMERIC, z NUMERIC, spawnable NUMERIC);");
$this->query("CREATE TABLE actions (ID INTEGER PRIMARY KEY, interval NUMERIC, last NUMERIC, code TEXT, repeat NUMERIC);");
$this->query("CREATE TABLE handlers (ID INTEGER PRIMARY KEY, name TEXT, priority NUMERIC);");
$this->query("CREATE TABLE blockUpdates (level TEXT, x INTEGER, y INTEGER, z INTEGER, type INTEGER, delay NUMERIC);");
$this->query("CREATE TABLE recipes (id INTEGER PRIMARY KEY, type NUMERIC, recipe TEXT);");
$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->selectActions = $this->database->prepare("SELECT ID,code,repeat FROM actions WHERE last <= (:time - interval);");
$this->preparedSQL->updateAction = $this->database->prepare("UPDATE actions SET last = :time WHERE ID = :id;");
}
public function query($sql, $fetch = false){
$result = $this->database->query($sql) or console("[ERROR] [SQL Error] ".$this->database->lastErrorMsg().". Query: ".$sql, true, true, 0);
if($fetch === true and ($result instanceof SQLite3Result)){
$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() / 1024) / 1024, 2)."MB";
$info["memory_peak_usage"] = round((memory_get_peak_usage() / 1024) / 1024, 2)."MB";
$info["entities"] = $this->query("SELECT count(EID) as count FROM entities;", true);
$info["entities"] = $info["entities"]["count"];
$info["players"] = $this->query("SELECT count(CID) as count FROM players;", true);
$info["players"] = $info["players"]["count"];
$info["events"] = count($this->eventsID);
$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 = "server 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->broadcast("Stopping server...");
}
}
$this->stop = true;
$this->trigger("server.close", $reason);
$this->interface->close();
@$this->asyncThread->stop = true;
}
}
public function setType($type = "normal"){
switch(trim(strtolower($type))){
case "normal":
case "demo":
$this->serverType = "MCCPP;Demo;";
break;
case "minecon":
$this->serverType = "MCCPP;MINECON;";
break;
}
}
public function asyncOperation($type, array $data, callable $callable = null){
$d = "";
$type = (int) $type;
switch($type){
case ASYNC_CURL_GET:
$d .= Utils::writeShort(strlen($data["url"])).$data["url"].(isset($data["timeout"]) ? Utils::writeShort($data["timeout"]) : Utils::writeShort(10));
break;
case ASYNC_CURL_POST:
$d .= Utils::writeShort(strlen($data["url"])).$data["url"].(isset($data["timeout"]) ? Utils::writeShort($data["timeout"]) : Utils::writeShort(10));
$d .= Utils::writeShort(count($data["data"]));
foreach($data["data"] as $key => $value){
$d .= Utils::writeShort(strlen($key)).$key . Utils::writeInt(strlen($value)).$value;
}
break;
default:
return false;
}
$ID = $this->asyncID++;
$this->async[$ID] = $callable;
$this->asyncThread->input .= Utils::writeInt($ID).Utils::writeShort($type).$d;
return $ID;
}
public function asyncOperationChecker(){
if(isset($this->asyncThread->output{5})){
$offset = 0;
$ID = Utils::readInt(substr($this->asyncThread->output, $offset, 4));
$offset += 4;
$type = Utils::readShort(substr($this->asyncThread->output, $offset, 2));
$offset += 2;
$data = array();
switch($type){
case ASYNC_CURL_GET:
case ASYNC_CURL_POST:
$len = Utils::readInt(substr($this->asyncThread->output, $offset, 4));
$offset += 2;
$data["result"] = substr($this->asyncThread->output, $offset, $len);
$offset += $len;
break;
}
$this->asyncThread->output = substr($this->asyncThread->output, $offset);
if(isset($this->async[$ID]) and $this->async[$ID] !== null and is_callable($this->async[$ID])){
if(is_array($this->async[$ID])){
$method = $this->async[$ID][1];
$result = $this->async[$ID][0]->$method($data, $type, $ID);
}else{
$result = $this->async[$ID]($data, $type, $ID);
}
}
unset($this->async[$ID]);
}
}
public function addHandler($event,callable $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 dhandle($e, $d){
return $this->handle($e, $d);
}
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 = null;
if($handlers instanceof SQLite3Result){
$call = array();
while(($hn = $handlers->fetchArray(SQLITE3_ASSOC)) !== false){
$call[(int) $hn["ID"]] = true;
}
$handlers->finalize();
foreach($call as $hnid => $boolean){
if($result !== false and $result !== true){
$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 getGamemode(){
switch($this->gamemode){
case SURVIVAL:
return "survival";
case CREATIVE:
return "creative";
case ADVENTURE:
return "adventure";
case VIEW:
return "view";
}
}
public function init(){
register_tick_function(array($this, "tick"));
console("[INFO] Starting internal ticker calculation");
$t = 0;
while(true){
switch($t){
case 0:
declare(ticks=100);
break;
case 1:
declare(ticks=60);
break;
case 2:
declare(ticks=40);
break;
case 3:
declare(ticks=30);
break;
case 4:
declare(ticks=20);
break;
case 5:
declare(ticks=15);
break;
default:
declare(ticks=10);
break;
}
if($t > 5){
break;
}
$this->ticks = 0;
while($this->ticks < 20){
usleep(1);
}
if($this->getTPS() < 19.5){
++$t;
}else{
break;
}
}
$this->loadEvents();
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"));
}
console("[INFO] Default game type: ".strtoupper($this->getGamemode()));
$this->trigger("server.start", microtime(true));
console('[INFO] Done ('.round(microtime(true) - START_TIME, 3).'s)! For help, type "help" or "?"');
$this->process();
}
public function dumpError(){
if($this->stop === true){
return;
}
console("[ERROR] An Unrecovereable has ocurred and the server has Crashed. Creating an Error Dump");
$dump = "```\r\n# PocketMine-MP Error Dump ".date("D M j H:i:s T Y")."\r\n";
$er = error_get_last();
$dump .= "Error: ".var_export($er, true)."\r\n\r\n";
$dump .= "Code: \r\n";
$file = @file($er["file"], FILE_IGNORE_NEW_LINES);
for($l = max(0, $er["line"] - 10); $l < $er["line"] + 10; ++$l){
$dump .= "[".($l + 1)."] ".$file[$l]."\r\n";
}
$dump .= "\r\n\r\n";
$version = new VersionString();
$dump .= "PM Version: ".$version." #".$version->getNumber()." [Protocol ".CURRENT_PROTOCOL."]\r\n";
$dump .= "Commit: ".GIT_COMMIT."\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";
$p = $this->api->getProperties();
if($p["rcon.password"] != ""){
$p["rcon.password"] = "******";
}
$dump .= "server.properties: ".var_export($p, true)."\r\n\r\n\r\n";
if($this->api->plugin instanceof PluginAPI){
$plist = $this->api->plugin->getList();
$dump .= "Loaded plugins:\r\n";
foreach($plist as $p){
$dump .= $p["name"]." ".$p["version"]." by ".$p["author"]."\r\n";
}
$dump .= "\r\n\r\n";
}
$dump .= "Loaded Modules: ".var_export(get_loaded_extensions(), true)."\r\n";
$dump .= "Memory Usage Tracking: \r\n".chunk_split(base64_encode(gzdeflate(implode(";", $this->memoryStats), 9)))."\r\n";
ob_start();
phpinfo();
$dump .= "\r\nphpinfo(): \r\n".chunk_split(base64_encode(gzdeflate(ob_get_contents(), 9)))."\r\n";
ob_end_clean();
$dump .= "\r\n```";
$name = "Error_Dump_".date("D_M_j-H.i.s-T_Y");
logg($dump, $name, true, 0, true);
console("[ERROR] Please submit the \"{$name}.log\" file to the Bug Reporting page. Give as much info as you can.", true, true, 0);
}
public function tick(){
$time = microtime(true);
if($this->lastTick <= ($time - 0.05)){
$this->tickMeasure[] = $this->lastTick = $time;
unset($this->tickMeasure[key($this->tickMeasure)]);
++$this->ticks;
$this->tickerFunction($time);
}
}
public static function clientID($ip, $port){
//faster than string indexes in PHP
return crc32($ip . $port) ^ crc32($port . $ip . BOOTUP_RANDOM);
}
public function packetHandler($packet){
$data =& $packet["data"];
$CID = PocketMinecraftServer::clientID($packet["ip"], $packet["port"]);
if(isset($this->clients[$CID])){
$this->clients[$CID]->handlePacket($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,
RAKNET_MAGIC,
$this->serverType,
), false, $packet["ip"], $packet["port"]);
break;
}
if(!isset($this->custom["times_".$CID])){
$this->custom["times_".$CID] = 0;
}
$ln = 15;
if($this->description == "" or substr($this->description, -1) != " "){
$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,
RAKNET_MAGIC,
$this->serverType. $this->name . " [".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:
$version = $data[1];
$size = strlen($data[2]);
if($version !== CURRENT_STRUCTURE){
console("[DEBUG] Incorrect structure #$version from ".$packet["ip"].":".$packet["port"], true, true, 2);
$this->send(0x1a, array(
CURRENT_STRUCTURE,
RAKNET_MAGIC,
$this->serverID,
), false, $packet["ip"], $packet["port"]);
}else{
$this->send(0x06, array(
RAKNET_MAGIC,
$this->serverID,
0,
strlen($packet["raw"]),
), false, $packet["ip"], $packet["port"]);
}
break;
case 0x07:
if($this->invisible === true){
break;
}
$port = $data[2];
$MTU = $data[3];
$clientID = $data[4];
if(count($this->clients) < $this->maxClients){
$this->clients[$CID] = new Player($clientID, $packet["ip"], $packet["port"], $MTU); //New Session!
$this->send(0x08, array(
RAKNET_MAGIC,
$this->serverID,
$this->port,
$data[3],
0,
), false, $packet["ip"], $packet["port"]);
}
break;
}
}
}
public function send($pid, $data = array(), $raw = false, $dest = false, $port = false){
return $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 = ""){
if(isset($this->events[$event])){
foreach($this->events[$event] as $evid => $ev){
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]");
}
}
public function schedule($ticks, callable $callback, $data = array(), $repeat = false, $eventName = "server.schedule"){
if(!is_callable($callback)){
return false;
}
$chcnt = $this->scheduleCnt++;
$this->schedule[$chcnt] = array($callback, $data, $eventName);
$this->query("INSERT INTO actions (ID, interval, last, repeat) VALUES(".$chcnt.", ".($ticks / 20).", ".microtime(true).", ".(((bool) $repeat) === true ? 1:0).");");
return $chcnt;
}
public function tickerFunction($time){
//actions that repeat every x time will go here
$this->preparedSQL->selectActions->reset();
$this->preparedSQL->selectActions->bindValue(":time", $time, SQLITE3_FLOAT);
$actions = $this->preparedSQL->selectActions->execute();
if($actions instanceof SQLite3Result){
while(($action = $actions->fetchArray(SQLITE3_ASSOC)) !== false){
$cid = $action["ID"];
$this->preparedSQL->updateAction->reset();
$this->preparedSQL->updateAction->bindValue(":time", $time, SQLITE3_FLOAT);
$this->preparedSQL->updateAction->bindValue(":id", $cid, SQLITE3_INTEGER);
$this->preparedSQL->updateAction->execute();
$schedule = $this->schedule[$cid];
if(!is_callable($schedule[0])){
$return = false;
}else{
$return = call_user_func($schedule[0],$schedule[1],$schedule[2]);
}
if($action["repeat"] === 0 or $return === false){
$this->query("DELETE FROM actions WHERE ID = ".$action["ID"].";");
$this->schedule[$cid] = null;
unset($this->schedule[$cid]);
}
}
$actions->finalize();
}
}
public function event($event,callable $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++;
if(!isset($this->events[$event])){
$this->events[$event] = array();
}
$this->events[$event][$evid] = $func;
$this->eventsID[$evid] = $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;
if(isset($this->eventsID[$id])){
$ev = $this->eventsID[$id];
$this->eventsID[$id] = null;
unset($this->eventsID[$id]);
$this->events[$ev][$id] = null;
unset($this->events[$ev][$id]);
if(count($this->events[$ev]) === 0){
unset($this->events[$ev]);
}
}
}
}

View File

@ -1,267 +0,0 @@
#!/bin/bash
COMPILER_VERSION="0.12"
PHP_VERSION="5.4.15"
ZEND_VM="GOTO"
LIBEDIT_VERSION="0.3"
ZLIB_VERSION="1.2.8"
PTHREADS_VERSION="0.0.44"
CURL_VERSION="curl-7_30_0"
echo "[PocketMine] PHP installer and compiler for Linux & Mac"
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\""; read -p "Press [Enter] to continue..."; exit 1; }
type autoconf >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"autoconf\""; read -p "Press [Enter] to continue..."; exit 1; }
type automake >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; read -p "Press [Enter] to continue..."; exit 1; }
type libtool >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"libtool\""; read -p "Press [Enter] to continue..."; exit 1; }
type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; read -p "Press [Enter] to continue..."; exit 1; }
type wget >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"wget\""; read -p "Press [Enter] to continue..."; exit 1; }
export CC="gcc"
COMPILE_FOR_ANDROID=no
if [ "$1" == "rpi" ]; then
[ -z "$march" ] && march=armv6zk;
[ -z "$mtune" ] && mtune=arm1176jzf-s;
[ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp";
echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float"
elif [ "$1" == "mac" ]; then
[ -z "$march" ] && march=prescott;
[ -z "$mtune" ] && mtune=generic;
[ -z "$CFLAGS" ] && CFLAGS="-fomit-frame-pointer";
echo "[INFO] Compiling for Intel MacOS"
elif [ "$1" == "crosscompile" ]; then
if [ "$2" == "android" ] || [ "$2" == "android-armv6" ]; then
COMPILE_FOR_ANDROID=yes
[ -z "$march" ] && march=armv6;
[ -z "$mtune" ] && mtune=generic;
TOOLCHAIN_PREFIX="arm-none-linux-gnueabi"
export CC="$TOOLCHAIN_PREFIX-gcc"
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX"
[ -z "$CFLAGS" ] && CFLAGS="-uclibc";
echo "[INFO] Cross-compiling for Android ARMv6"
elif [ "$2" == "android-armv7" ]; then
COMPILE_FOR_ANDROID=yes
[ -z "$march" ] && march=armv7;
[ -z "$mtune" ] && mtune=generic;
TOOLCHAIN_PREFIX="arm-none-linux-gnueabi"
export CC="$TOOLCHAIN_PREFIX-gcc"
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX"
[ -z "$CFLAGS" ] && CFLAGS="-uclibc";
echo "[INFO] Cross-compiling for Android ARMv7"
elif [ "$2" == "rpi" ]; then
TOOLCHAIN_PREFIX="arm-linux-gnueabihf"
[ -z "$march" ] && march=armv6zk;
[ -z "$mtune" ] && mtune=arm1176jzf-s;
[ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp";
export CC="$TOOLCHAIN_PREFIX-gcc"
CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX"
[ -z "$CFLAGS" ] && CFLAGS="-uclibc";
echo "[INFO] Cross-compiling for Raspberry Pi ARMv6zk hard float"
else
echo "Please supply a proper platform [android android-armv6 android-armv7 rpi] to cross-compile"
exit 1
fi
else
echo "[INFO] Compiling for current machine"
fi
type $CC >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"$CC\""; read -p "Press [Enter] to continue..."; exit 1; }
[ -z "$THREADS" ] && THREADS=1;
[ -z "$march" ] && march=native;
[ -z "$mtune" ] && mtune=native;
[ -z "$CFLAGS" ] && CFLAGS="";
[ -z "$CONFIGURE_FLAGS" ] && CONFIGURE_FLAGS="";
$CC -O3 -march=$march -mtune=$mtune -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1
if [ $? -ne 0 ]; then
$CC -O3 -fno-gcse $CFLAGS -Q --help=target >> "$DIR/install.log" 2>&1
if [ $? -ne 0 ]; then
export CFLAGS="-O3 -fno-gcse "
else
export CFLAGS="-O3 -fno-gcse $CFLAGS"
fi
else
export CFLAGS="-O3 -march=$march -mtune=$mtune -fno-gcse $CFLAGS"
fi
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
rm -r -f php5/ >> "$DIR/install.log" 2>&1
rm -r -f bin/ >> "$DIR/install.log" 2>&1
mkdir -m 0777 install_data >> "$DIR/install.log" 2>&1
mkdir -m 0777 php5 >> "$DIR/install.log" 2>&1
mkdir -m 0777 bin >> "$DIR/install.log" 2>&1
cd install_data
set -e
#PHP 5
echo -n "[PHP] 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!"
if [ 1 ] || [ "$1" == "crosscompile" ] || [ "$1" == "rpi" ]; then
HAVE_LIBEDIT="--without-libedit"
else
#libedit
echo -n "[libedit] downloading $LIBEDIT_VERSION..."
wget http://download.sourceforge.net/project/libedit/libedit/libedit-$LIBEDIT_VERSION/libedit-$LIBEDIT_VERSION.tar.gz -q -O - | tar -zx >> "$DIR/install.log" 2>&1
echo -n " checking..."
cd libedit
./configure --prefix="$DIR/install_data/php/ext/libedit" --enable-static >> "$DIR/install.log" 2>&1
echo -n " compiling..."
if make -j $THREADS >> "$DIR/install.log" 2>&1; then
echo -n " installing..."
make install >> "$DIR/install.log" 2>&1
HAVE_LIBEDIT="--with-libedit=\"$DIR/install_data/php/ext/libedit\""
else
echo -n " disabling..."
HAVE_LIBEDIT="--without-libedit"
fi
echo -n " cleaning..."
cd ..
rm -r -f ./libedit
echo " done!"
fi
#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 -j $THREADS >> "$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!"
if [ "$(uname -s)" == "Darwin" ] && [ "$1" != "crosscompile" ]; then
HAVE_CURL="shared,/usr/local"
else
#curl
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 --enable-ipv6 \
--enable-optimize \
--enable-http \
--enable-ftp \
--disable-dict \
--enable-file \
--disable-gopher \
--disable-imap \
--disable-pop3 \
--disable-rtsp \
--disable-smtp \
--disable-telnet \
--disable-tftp \
--prefix="$DIR/install_data/php/ext/curl" \
--disable-shared \
$CONFIGURE_FLAGS >> "$DIR/install.log" 2>&1
echo -n " compiling..."
make -j $THREADS >> "$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!"
HAVE_CURL="$DIR/install_data/php/ext/curl"
fi
#pthreads
echo -n "[PHP pthreads] downloading $PTHREADS_VERSION..."
wget http://pecl.php.net/get/pthreads-$PTHREADS_VERSION.tgz --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 "[PHP]"
set +e
if which free >/dev/null; then
MAX_MEMORY=$(free -m | awk '/^Mem:/{print $2}')
else
MAX_MEMORY=$(top -l 1 | grep PhysMem: | awk '{print $10}' | tr -d 'a-zA-Z')
fi
if [ $MAX_MEMORY -gt 512 ] && [ "$1" != "crosscompile" ]; then
echo -n " enabling optimizations..."
OPTIMIZATION="--enable-inline-optimization "
else
OPTIMIZATION="--disable-inline-optimization "
fi
set -e
echo -n " checking..."
cd php
rm -rf ./aclocal.m4 >> "$DIR/install.log" 2>&1
rm -rf ./autom4te.cache/ >> "$DIR/install.log" 2>&1
rm -f ./configure >> "$DIR/install.log" 2>&1
./buildconf --force >> "$DIR/install.log" 2>&1
if [ "$1" == "crosscompile" ]; then
sed -i 's/pthreads_working=no/pthreads_working=yes/' ./configure
export LIBS="-lpthread -ldl"
fi
./configure $OPTIMIZATION--prefix="$DIR/php5" \
--exec-prefix="$DIR/php5" \
--with-curl="$HAVE_CURL" \
--with-zlib="$DIR/install_data/php/ext/zlib" \
$HAVE_LIBEDIT \
--disable-libxml \
--disable-xml \
--disable-dom \
--disable-simplexml \
--disable-xmlreader \
--disable-xmlwriter \
--disable-cgi \
--disable-session \
--disable-zip \
--disable-debug \
--disable-phar \
--enable-ctype \
--enable-sockets \
--enable-shared=no \
--enable-static=yes \
--enable-shmop \
--enable-pcntl \
--enable-pthreads \
--enable-maintainer-zts \
--enable-zend-signals \
--enable-embedded-mysqli \
--enable-bcmath \
--enable-cli \
--without-pear \
--without-iconv \
--without-pdo \
--without-pdo-sqlite \
--with-zend-vm=$ZEND_VM \
$CONFIGURE_FLAGS >> "$DIR/install.log" 2>&1
echo -n " compiling..."
if [ COMPILE_FOR_ANDROID == "yes" ]; then
sed -i 's/-export-dynamic/-all-static/g' Makefile
fi
make -j $THREADS >> "$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
mv php5/bin/php bin/php
rm -r -f php5/ >> "$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,77 +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("GMT");
if(strpos(" ".strtoupper(php_uname("s")), " WIN") !== false){
$time = time();
$time -= $time % 60;
exec("time.exe /T", $hour);
$i = array_map("intval", explode(":", trim($hour[0])));
exec("date.exe /T", $date);
$j = array_map("intval", explode("/", trim($date[0])));
$offset = round((mktime($i[0], $i[1], 0, $j[1], $j[0], $j[2]) - $time) / 60) * 60;
}else{
exec("date +%s", $t);
$offset = round((intval(trim($t[0])) - time()) / 60) * 60;
}
$daylight = (int) date("I");
if($daylight === 0){
$offset -= 3600;
}
date_default_timezone_set(timezone_name_from_abbr("", $offset, $daylight));
gc_enable();
error_reporting(E_ALL ^ E_NOTICE);
ini_set("allow_url_fopen", 1);
ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
ini_set("default_charset", "utf-8");
if(defined("POCKETMINE_COMPILE") and POCKETMINE_COMPILE === true){
define("FILE_PATH", realpath(dirname(__FILE__))."/");
}else{
define("FILE_PATH", realpath(dirname(__FILE__)."/../")."/");
}
set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH);
ini_set("memory_limit", "128M"); //Default
define("LOG", true);
define("START_TIME", microtime(true));
define("MAJOR_VERSION", "Alpha_1.3.1");
define("CURRENT_MINECRAFT_VERSION", "0.7.1 alpha");
define("CURRENT_API_VERSION", 9);
define("CURRENT_PHP_VERSION", "5.5");
$gitsha1 = false;
if(file_exists(FILE_PATH.".git/refs/heads/master")){ //Found Git information!
define(GIT_COMMIT, strtolower(trim(file_get_contents(FILE_PATH.".git/refs/heads/master"))));
}else{ //Unknown :(
define(GIT_COMMIT, str_repeat("00", 20));
}

View File

@ -1,164 +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("AIR", 0);
define("STONE", 1);
define("GRASS", 2);
define("DIRT", 3);
define("COBBLESTONE", 4);
define("COBBLE", 4);
define("PLANK", 5);
define("PLANKS", 5);
define("WOODEN_PLANK", 5);
define("WOODEN_PLANKS", 5);
define("SAPLING", 6);
define("SAPLINGS", 6);
define("BEDROCK", 7);
define("WATER", 8);
define("STILL_WATER", 9);
define("LAVA", 10);
define("STILL_LAVA", 11);
define("SAND", 12);
define("GRAVEL", 13);
define("GOLD_ORE", 14);
define("IRON_ORE", 15);
define("COAL_ORE", 16);
define("WOOD", 17);
define("TRUNK", 17);
define("LEAVES", 18);
define("LEAVE", 18);
define("GLASS", 20);
define("LAPIS_ORE", 21);
define("LAPIS_BLOCK", 22);
define("SANDSTONE", 24);
define("BED_BLOCK", 26);
define("COBWEB", 30);
define("TALL_GRASS", 31);
define("BUSH", 32);
define("DEAD_BUSH", 32);
define("WOOL", 35);
define("DANDELION", 37);
define("ROSE", 38);
define("CYAN_FLOWER", 38);
define("BROWN_MUSHROOM", 39);
define("RED_MUSHROOM", 40);
define("GOLD_BLOCK", 41);
define("IRON_BLOCK", 42);
define("DOUBLE_SLAB", 43);
define("DOUBLE_SLABS", 43);
define("SLAB", 44);
define("SLABS", 44);
define("BRICKS", 45);
define("BRICKS_BLOCK", 45);
define("TNT", 46);
define("BOOKSHELF", 47);
define("MOSS_STONE", 48);
define("MOSSY_STONE", 48);
define("OBSIDIAN", 49);
define("TORCH", 50);
define("FIRE", 51);
define("WOOD_STAIRS", 53);
define("WOODEN_STAIRS", 53);
define("CHEST", 54);
define("DIAMOND_ORE", 56);
define("DIAMOND_BLOCK", 57);
define("CRAFTING_TABLE", 58);
define("WORKBENCH", 58);
define("WHEAT_BLOCK", 59);
define("FARMLAND", 60);
define("FURNACE", 61);
define("BURNING_FURNACE", 62);
define("LIT_FURNACE", 62);
define("SIGN_POST", 63);
define("DOOR_BLOCK", 64);
define("WOODEN_DOOR_BLOCK", 64);
define("WOOD_DOOR_BLOCK", 64);
define("LADDER", 65);
define("COBBLE_STAIRS", 67);
define("COBBLESTONE_STAIRS", 67);
define("WALL_SIGN", 68);
define("IRON_DOOR_BLOCK", 71);
define("REDSTONE_ORE", 73);
define("GLOWING_REDSTONE_ORE", 74);
define("LIT_REDSTONE_ORE", 74);
define("SNOW", 78);
define("SNOW_LAYER", 78);
define("ICE", 79);
define("SNOW_BLOCK", 80);
define("CACTUS", 81);
define("CLAY_BLOCK", 82);
define("REEDS", 83);
define("SUGARCANE_BLOCK", 83);
define("FENCE", 85);
define("NETHERRACK", 87);
define("SOUL_SAND", 88);
define("GLOWSTONE", 89);
define("GLOWSTONE_BLOCK", 89);
define("CAKE_BLOCK", 92);
define("TRAPDOOR", 96);
define("STONE_BRICKS", 98);
define("STONE_BRICK", 98);
define("GLASS_PANE", 102);
define("GLASS_PANEL", 102);
define("MELON_BLOCK", 103);
define("MELON_STEM", 105);
define("FENCE_GATE", 107);
define("BRICK_STAIRS", 108);
define("STONE_BRICK_STAIRS", 109);
define("NETHER_BRICKS", 112);
define("NETHER_BRICK_BLOCK", 112);
define("NETHER_BRICKS_STAIRS", 114);
define("SANDSTONE_STAIRS", 128);
define("QUARTZ_BLOCK", 155);
define("QUARTZ_STAIRS", 156);
define("STONECUTTER", 245);
define("GLOWING_OBSIDIAN", 246);
define("NETHER_REACTOR", 247);

View File

@ -1,85 +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("PMF_LEVEL_DEFLATE_LEVEL", 6);
//Gamemodes
define("SURVIVAL", 0);
define("CREATIVE", 1);
define("ADVENTURE", 2);
define("VIEW", 3);
define("VIEWER", 3);
//Players
define("MAX_CHUNK_RATE", 20 / arg("max-chunks-per-second", 3.5)); //Default rate ~172 kB/s
define("PLAYER_MAX_RECOVERY_BUFFER", 1024);
define("PLAYER_SURVIVAL_SLOTS", 36);
define("PLAYER_CREATIVE_SLOTS", 111);
//Block Updates
define("BLOCK_UPDATE_NORMAL", 1);
define("BLOCK_UPDATE_RANDOM", 2);
define("BLOCK_UPDATE_SCHEDULED", 3);
define("BLOCK_UPDATE_WEAK", 4);
define("BLOCK_UPDATE_TOUCH", 5);
//Entities
define("ENTITY_PLAYER", 1);
define("ENTITY_MOB", 2);
define("MOB_CHICKEN", 10);
define("MOB_COW", 11);
define("MOB_PIG", 12);
define("MOB_SHEEP", 13);
define("MOB_ZOMBIE", 32);
define("MOB_CREEPER", 33);
define("MOB_SKELETON", 34);
define("MOB_SPIDER", 35);
define("MOB_PIGMAN", 36);
define("ENTITY_OBJECT", 3);
define("OBJECT_ARROW", 80);
define("OBJECT_PAINTING", 83);
define("ENTITY_ITEM", 4);
define("ENTITY_FALLING", 5);
define("FALLING_SAND", 66);
//TileEntities
define("TILE_SIGN", "Sign");
define("TILE_CHEST", "Chest");
define("CHEST_SLOTS", 27);
define("TILE_FURNACE", "Furnace");
define("FURNACE_SLOTS", 3);

View File

@ -1,156 +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("IRON_SHOVEL", 256);//Implemented
define("IRON_PICKAXE", 257);//Implemented
define("IRON_AXE", 258);//Implemented
define("FLINT_STEEL", 259);
define("FLINT_AND_STEEL", 259);
define("APPLE", 260);//Implemented
define("BOW", 261);
define("ARROW", 262);
define("COAL", 263);//Implemented
define("DIAMOND", 264);//Implemented
define("IRON_INGOT", 265);//Implemented
define("GOLD_INGOT", 266);//Implemented
define("IRON_SWORD", 267);
define("WOODEN_SWORD", 268);//Implemented
define("WOODEN_SHOVEL", 269);//Implemented
define("WOODEN_PICKAXE", 270);//Implemented
define("WOODEN_AXE", 271);//Implemented
define("STONE_SWORD", 272);
define("STONE_SHOVEL", 273);
define("STONE_PICKAXE", 274);
define("STONE_AXE", 275);
define("DIAMOND_SWORD", 276);
define("DIAMOND_SHOVEL", 277);
define("DIAMOND_PICKAXE", 278);
define("DIAMOND_AXE", 279);
define("STICK", 280);//Implemented
define("STICKS", 280);
define("BOWL", 281);//Implemented
define("MUSHROOM_STEW", 282);
define("GOLD_SWORD", 283);
define("GOLD_SHOVEL", 284);
define("GOLD_PICKAXE", 285);
define("GOLD_AXE", 286);
define("GOLDEN_SWORD", 283);
define("GOLDEN_SHOVEL", 284);
define("GOLDEN_PICKAXE", 285);
define("GOLDEN_AXE", 286);
define("STRING", 287);
define("FEATHER", 288);//Implemented
define("GUNPOWDER", 289);
define("WOODEN_HOE", 290);
define("STONE_HOE", 291);
define("IRON_HOE", 292);//Implemented
define("DIAMOND_HOE", 293);
define("GOLD_HOE", 294);
define("GOLDEN_HOE", 294);
define("SEEDS", 295);
define("WHEAT_SEEDS", 295);
define("WHEAT", 296);
define("BREAD", 297);
define("LEATHER_CAP", 298);
define("LEATHER_TUNIC", 299);
define("LEATHER_PANTS", 300);
define("LEATHER_BOOTS", 301);
define("CHAIN_HELMET", 302);
define("CHAIN_CHESTPLATE", 303);
define("CHAIN_LEGGINGS", 304);
define("CHAIN_BOOTS", 305);
define("IRON_HELMET", 306);
define("IRON_CHESTPLATE", 307);
define("IRON_LEGGINGS", 308);
define("IRON_BOOTS", 309);
define("DIAMOND_HELMET", 310);
define("DIAMOND_CHESTPLATE", 311);
define("DIAMOND_LEGGINGS", 312);
define("DIAMOND_BOOTS", 313);
define("GOLD_HELMET", 314);
define("GOLD_CHESTPLATE", 315);
define("GOLD_LEGGINGS", 316);
define("GOLD_BOOTS", 317);
define("FLINT", 318);
define("RAW_PORKCHOP", 319);
define("COOKED_PORKCHOP", 320);
define("PAINTING", 321);
define("GOLDEN_APPLE", 322);
define("SIGN", 323);
define("WOODEN_DOOR", 324);
define("BUCKET", 325);
define("IRON_DOOR", 330);
define("SNOWBALL", 332);
define("LEATHER", 334);
define("BRICK", 336);
define("CLAY", 337);
define("SUGARCANE", 338);
define("SUGAR_CANE", 338);
define("SUGAR_CANES", 338);
define("PAPER", 339);
define("SLIMEBALL", 341);
define("EGG", 344);
define("COMPASS", 345);
define("GLOWSTONE_DUST", 348);
define("RAW_FISH", 349);
define("COOKED_FISH", 350);
define("DYE", 351);
define("BONE", 352);
define("SUGAR", 353);
define("CAKE", 354);
define("BED", 355);
define("COOKIE", 357);
define("SHEARS", 359);
define("MELON", 360);
define("MELON_SLICE", 360);
define("MELON_SEEDS", 362);
define("RAW_BEEF", 363);
define("STEAK", 364);
define("COOKED_BEEF", 364);
define("RAW_CHICKEN", 365);
define("COOKED_CHICKEN", 366);
define("SPAWN_EGG", 383);
define("NETHER_BRICK", 405);
define("QUARTZ", 406);
define("NETHER_QUARTZ", 406);
define("CAMERA", 456);

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.
*/
/***REM_START***/
require_once(dirname(__FILE__)."/config.php");
require_once(FILE_PATH."/src/functions.php");
/***REM_END***/
define(DATA_PATH, realpath(arg("data-path", FILE_PATH))."/");
if(arg("enable-ansi", strpos(strtoupper(php_uname("s")), "WIN") === false ? true:false) === true){
define("ENABLE_ANSI", true);
}else{
define("ENABLE_ANSI", false);
}
set_error_handler("error_handler", E_ALL);
$errors = 0;
if(version_compare("5.4.0", PHP_VERSION) > 0){
console("[ERROR] Use PHP >= 5.4.0", true, true, 0);
++$errors;
}
if(php_sapi_name() !== "cli"){
console("[ERROR] You must run PocketMine-MP using the CLI.", 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 the 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 the pthreads extension.", 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 the 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 the 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 the Zlib extension.", true, true, 0);
++$errors;
}
if($errors > 0){
console("[ERROR] Please use the installer provided on the homepage.", true, true, 0);
exit(1); //Exit with error
}
/***REM_START***/
require_once(FILE_PATH."/src/math/Vector3.php");
require_once(FILE_PATH."/src/world/Position.php");
require_once(FILE_PATH."/src/pmf/PMF.php");
require_all(FILE_PATH . "src/");
/***REM_END***/

View File

@ -1,277 +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(!function_exists("cli_set_process_title")){
function cli_set_process_title($title){
if(ENABLE_ANSI === true){
echo "\x1b]0;".$title."\x07";
return true;
}else{
return false;
}
}
}
function dummy(){
}
function safe_var_dump($var, $cnt = 0){
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;
safe_var_dump($value, $cnt + 1);
}
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 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 require_all($path, &$count = 0){
$dir = dir($path."/");
$dirs = array();
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)){
$dirs[] = $path.$file."/";
}
}
}
foreach($dirs as $dir){
require_all($dir, $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){
$add = "";
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 error_handler($errno, $errstr, $errfile, $errline){
if(error_reporting() === 0){ //@ error-control
return false;
}
console("[ERROR] A level ".$errno." error happened: \"$errstr\" in \"$errfile\" at line $errline", true, true, 0);
return true;
}
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(DATA_PATH."/".$name.".log", "ab");
}
@fwrite($fpointers[$name], $message);
if($close === true){
fclose($fpointers[$name]);
unset($fpointers[$name]);
}
}
}

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(){
$this->server = ServerAPI::request();
}
}
?>

View File

@ -1,229 +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.
*/
abstract class Block extends Position{
public static $class = array(
AIR => "AirBlock",
STONE => "StoneBlock",
GRASS => "GrassBlock",
DIRT => "DirtBlock",
COBBLESTONE => "CobblestoneBlock",
PLANKS => "PlanksBlock",
SAPLING => "SaplingBlock",
BEDROCK => "BedrockBlock",
WATER => "WaterBlock",
STILL_WATER => "StillWaterBlock",
LAVA => "LavaBlock",
STILL_LAVA => "StillLavaBlock",
SAND => "SandBlock",
GRAVEL => "GravelBlock",
GOLD_ORE => "GoldOreBlock",
IRON_ORE => "IronOreBlock",
COAL_ORE => "CoalOreBlock",
WOOD => "WoodBlock",
LEAVES => "LeavesBlock",
GLASS => "GlassBlock",
LAPIS_ORE => "LapisOreBlock",
LAPIS_BLOCK => "LapisBlock",
SANDSTONE => "SandstoneBlock",
BED_BLOCK => "BedBlock",
COBWEB => "CobwebBlock",
TALL_GRASS => "TallGrassBlock",
DEAD_BUSH => "DeadBushBlock",
WOOL => "WoolBlock",
DANDELION => "DandelionBlock",
CYAN_FLOWER => "CyanFlowerBlock",
BROWN_MUSHROOM => "BrownMushroomBlock",
RED_MUSHROOM => "RedMushRoomBlock",
GOLD_BLOCK => "GoldBlock",
IRON_BLOCK => "IronBlock",
DOUBLE_SLAB => "DoubleSlabBlock",
SLAB => "SlabBlock",
BRICKS_BLOCK => "BricksBlock",
TNT => "TNTBlock",
BOOKSHELF => "BookshelfBlock",
MOSS_STONE => "MossStoneBlock",
OBSIDIAN => "ObsidianBlock",
TORCH => "TorchBlock",
FIRE => "FireBlock",
WOOD_STAIRS => "WoodStairsBlock",
CHEST => "ChestBlock",
DIAMOND_ORE => "DiamondOreBlock",
DIAMOND_BLOCK => "DiamondBlock",
WORKBENCH => "WorkbenchBlock",
WHEAT_BLOCK => "WheatBlock",
FARMLAND => "FarmlandBlock",
FURNACE => "FurnaceBlock",
BURNING_FURNACE => "BurningFurnaceBlock",
SIGN_POST => "SignPostBlock",
WOOD_DOOR_BLOCK => "WoodDoorBlock",
LADDER => "LadderBlock",
COBBLESTONE_STAIRS => "CobblestoneStairsBlock",
WALL_SIGN => "WallSignBlock",
IRON_DOOR_BLOCK => "IronDoorBlock",
REDSTONE_ORE => "RedstoneOreBlock",
GLOWING_REDSTONE_ORE => "GlowingRedstoneOreBlock",
SNOW_LAYER => "SnowLayerBlock",
ICE => "IceBlock",
SNOW_BLOCK => "SnowBlock",
CACTUS => "CactusBlock",
CLAY_BLOCK => "ClayBlock",
SUGARCANE_BLOCK => "SugarcaneBlock",
FENCE => "FenceBlock",
NETHERRACK => "NetherrackBlock",
SOUL_SAND => "SoulSandBlock",
GLOWSTONE_BLOCK => "GlowstoneBlock",
CAKE_BLOCK => "CakeBlock",
TRAPDOOR => "TrapdoorBlock",
STONE_BRICKS => "StoneBricksBlock",
GLASS_PANE => "GlassPaneBlock",
MELON_BLOCK => "MelonBlock",
MELON_STEM => "MelonStemBlock",
FENCE_GATE => "FenceGateBlock",
BRICK_STAIRS => "BrickStairsBlock",
STONE_BRICK_STAIRS => "StoneBrickStairsBlock",
NETHER_BRICKS => "NetherBricksBlock",
NETHER_BRICKS_STAIRS => "NetherBricksStairsBlock",
SANDSTONE_STAIRS => "SandstoneStairsBlock",
QUARTZ_BLOCK => "QuartzBlock",
QUARTZ_STAIRS => "QuartzStairsBlock",
STONECUTTER => "StonecutterBlock",
GLOWING_OBSIDIAN => "GlowingObsidianBlock",
NETHER_REACTOR => "NetherReactorBlock",
);
protected $id;
protected $meta;
protected $name;
protected $breakTime;
public $isActivable = false;
public $breakable = true;
public $isFlowable = false;
public $isSolid = true;
public $isTransparent = false;
public $isReplaceable = false;
public $isPlaceable = true;
public $level = false;
public $hasPhysics = false;
public $isLiquid = false;
public $isFullBlock = true;
public $x = 0;
public $y = 0;
public $z = 0;
public function __construct($id, $meta = 0, $name = "Unknown"){
$this->id = (int) $id;
$this->meta = (int) $meta;
$this->name = $name;
$this->breakTime = 0.25;
}
final public function getName(){
return $this->name;
}
final public function getID(){
return $this->id;
}
final public function getMetadata(){
return $this->meta & 0x0F;
}
final public function position(Position $v){
$this->level = $v->level;
$this->x = (int) $v->x;
$this->y = (int) $v->y;
$this->z = (int) $v->z;
}
public function getDrops(Item $item, Player $player){
if(!isset(Block::$class[$this->id])){ //Unknown blocks
return array();
}else{
return array(
array($this->id, $this->meta, 1),
);
}
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
return $this->breakTime;
}
public function getSide($side){
$v = parent::getSide($side);
if($this->level instanceof Level){
return $this->level->getBlock($v);
}
return $v;
}
final public function __toString(){
return "Block ". $this->name ." (".$this->id.":".$this->meta.")";
}
abstract function isBreakable(Item $item, Player $player);
abstract function onBreak(Item $item, Player $player);
abstract function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz);
abstract function onActivate(Item $item, Player $player);
abstract function onUpdate($type);
}
/***REM_START***/
require_once("block/GenericBlock.php");
require_once("block/SolidBlock.php");
require_once("block/TransparentBlock.php");
require_once("block/FallableBlock.php");
require_once("block/LiquidBlock.php");
require_once("block/StairBlock.php");
require_once("block/DoorBlock.php");
/***REM_END***/

View File

@ -1,241 +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 static $class = array(
SUGARCANE => "SugarcaneItem",
WHEAT_SEEDS => "WheatSeedsItem",
MELON_SEEDS => "MelonSeedsItem",
SIGN => "SignItem",
WOODEN_DOOR => "WoodenDoorItem",
BUCKET => "BucketItem",
IRON_DOOR => "IronDoorItem",
CAKE => "CakeItem",
BED => "BedItem",
PAINTING => "PaintingItem",
COAL => "CoalItem",
APPLE => "AppleItem",
SPAWN_EGG => "SpawnEggItem",
DIAMOND => "DiamondItem",
STICK => "StickItem",
BOWL => "BowlItem",
FEATHER => "FeatherItem",
BRICK => "BrickItem",
IRON_INGOT => "IronIngotItem",
GOLD_INGOT => "GoldIngotItem",
IRON_SHOVEL => "IronShovelItem",
IRON_PICKAXE => "IronPickaxeItem",
IRON_AXE => "IronAxeItem",
IRON_HOE => "IronHoeItem",
WOODEN_SWORD => "WoodenSwordItem",
WOODEN_SHOVEL => "WoodenShovelItem",
WOODEN_PICKAXE => "WoodenPickaxeItem",
WOODEN_AXE => "WoodenAxeItem",
FLINT_STEEL => "FlintSteelItem",
);
protected $block;
protected $id;
protected $meta;
public $count;
protected $maxStackSize = 64;
protected $durability = 0;
protected $name;
public $isActivable = false;
public function __construct($id, $meta = 0, $count = 1, $name = "Unknown"){
$this->id = (int) $id;
$this->meta = (int) $meta;
$this->count = (int) $count;
$this->name = $name;
if(!isset($this->block) and $this->id <= 0xff and isset(Block::$class[$this->id])){
$this->block = BlockAPI::get($this->id, $this->meta);
$this->name = $this->block->getName();
}
if($this->isTool() !== false){
$this->maxStackSize = 1;
}
}
final public function getName(){
return $this->name;
}
final public function isPlaceable(){
return (($this->block instanceof Block) and $this->block->isPlaceable === true);
}
final public function getBlock(){
if($this->block instanceof Block){
return $this->block;
}else{
return BlockAPI::get(AIR);
}
}
final public function getID(){
return $this->id;
}
final public function getMetadata(){
return $this->meta;
}
final public function getMaxStackSize(){
return $this->maxStackSize;
}
final public function getFuelTime(){
if(!isset(FuelData::$duration[$this->id])){
return false;
}
if($this->id !== BUCKET or $this->meta === 10){
return FuelData::$duration[$this->id];
}
return false;
}
final public function getSmeltItem(){
if(!isset(SmeltingData::$product[$this->id])){
return false;
}
if(isset(SmeltingData::$product[$this->id][0]) and !is_array(SmeltingData::$product[$this->id][0])){
return BlockAPI::getItem(SmeltingData::$product[$this->id][0], SmeltingData::$product[$this->id][1]);
}
if(!isset(SmeltingData::$product[$this->id][$this->meta])){
return false;
}
return BlockAPI::getItem(SmeltingData::$product[$this->id][$this->meta][0], SmeltingData::$product[$this->id][$this->meta][1]);
}
public function useOn($object){
if($this->isTool()){
$this->meta++;
}
}
final public function isTool(){
return ($this->id === FLINT_STEEL or $this->id === SHEARS or $this->isPickaxe() !== false or $this->isAxe() !== false or $this->isShovel() !== false or $this->isSword() !== false or $this->isHoe() !== false);
}
final public function isPickaxe(){ //Returns false or level of the pickaxe
switch($this->id){
case IRON_PICKAXE:
return 4;
case WOODEN_PICKAXE:
return 1;
case STONE_PICKAXE:
return 3;
case DIAMOND_PICKAXE:
return 5;
case GOLD_PICKAXE:
return 2;
default:
return false;
}
}
final public function isAxe(){
switch($this->id){
case IRON_AXE:
return 4;
case WOODEN_AXE:
return 1;
case STONE_AXE:
return 3;
case DIAMOND_AXE:
return 5;
case GOLD_AXE:
return 2;
default:
return false;
}
}
final public function isSword(){
switch($this->id){
case IRON_SWORD:
return 4;
case WOODEN_SWORD:
return 1;
case STONE_SWORD:
return 3;
case DIAMOND_SWORD:
return 5;
case GOLD_SWORD:
return 2;
default:
return false;
}
}
final public function isShovel(){
switch($this->id){
case IRON_SHOVEL:
return 4;
case WOODEN_SHOVEL:
return 1;
case STONE_SHOVEL:
return 3;
case DIAMOND_SHOVEL:
return 5;
case GOLD_SHOVEL:
return 2;
default:
return false;
}
}
public function isHoe(){
switch($this->id){
case IRON_HOE:
case WOODEN_HOE:
case STONE_HOE:
case DIAMOND_HOE:
case GOLD_HOE:
return true;
default:
return false;
}
}
final public function __toString(){
return "Item ". $this->name ." (".$this->id.":".$this->meta.")";
}
public function getDestroySpeed(Block $block, Player $player){
return 1;
}
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
return false;
}
}

View File

@ -1,94 +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 DoorBlock extends TransparentBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->isSolid = false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($face === 1){
$blockUp = $this->getSide(1);
$blockDown = $this->getSide(0);
if($blockUp->isReplaceable === false or $blockDown->isTransparent === true){
return false;
}
$direction = $player->entity->getDirection();
$face = array(
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->level->setBlock($blockUp, BlockAPI::get($this->id, $metaUp)); //Top
$this->meta = $direction & 0x03;
$this->level->setBlock($block, $this); //Bottom
return true;
}
return false;
}
public function onBreak(Item $item, Player $player){
if(($this->meta & 0x08) === 0x08){
$down = $this->getSide(0);
if($down->getID() === $this->id){
$this->level->setBlock($down, new AirBlock());
}
}else{
$up = $this->getSide(1);
if($up->getID() === $this->id){
$this->level->setBlock($up, new AirBlock());
}
}
$this->level->setBlock($this, new AirBlock());
return true;
}
public function onActivate(Item $item, Player $player){
if(($this->meta & 0x08) === 0x08){ //Top
$down = $this->getSide(0);
if($down->getID() === $this->id){
$meta = $down->getMetadata() ^ 0x04;
$this->level->setBlock($down, BlockAPI::get($this->id, $meta));
return true;
}
return false;
}else{
$this->meta ^= 0x04;
$this->level->setBlock($this, $this);
}
return true;
}
}

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.
*/
class FallableBlock extends SolidBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->hasPhysics = true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$ret = $this->level->setBlock($this, $this, true, false, true);
ServerAPI::request()->api->block->blockUpdate(clone $this, BLOCK_UPDATE_NORMAL);
return $ret;
}
}

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 FlowableBlock extends TransparentBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->isFlowable = true;
$this->isFullBlock = false;
$this->isSolid = false;
}
}

View File

@ -1,69 +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 GenericBlock extends Block{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
return $this->level->setBlock($this, $this, true, false, true);
}
public function isBreakable(Item $item, Player $player){
return ($this->breakable);
}
public function onBreak(Item $item, Player $player){
return $this->level->setBlock($this, new AirBlock(), true, false, true);
}
public function onUpdate($type){
if($this->hasPhysics === true and $type === BLOCK_UPDATE_NORMAL){
$down = $this->getSide(0);
if($down->getID() === AIR or ($down instanceof LiquidBlock)){
$data = array(
"x" => $this->x + 0.5,
"y" => $this->y + 0.5,
"z" => $this->z + 0.5,
"Tile" => $this->id,
);
$server = ServerAPI::request();
$this->level->setBlock($this, new AirBlock(), false, false, true);
$e = $server->api->entity->add($this->level, ENTITY_FALLING, FALLING_SAND, $data);
$server->api->entity->spawnToAll($e);
$server->api->block->blockUpdateAround(clone $this, BLOCK_UPDATE_NORMAL, 1);
}
return false;
}
return false;
}
public function onActivate(Item $item, Player $player){
return $this->isActivable;
}
}

View File

@ -1,37 +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 LiquidBlock extends TransparentBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->isLiquid = true;
$this->breakable = false;
$this->isReplaceable = true;
$this->isSolid = false;
$this->isFullBlock = true;
}
}

View File

@ -1,34 +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 SolidBlock extends GenericBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->isSolid = true;
$this->isFullBlock = true;
}
}

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 StairBlock extends TransparentBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
if(($this->meta & 0x04) === 0x04){
$this->isFullBlock = true;
}else{
$this->isFullBlock = false;
}
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$faces = array(
0 => 0,
1 => 2,
2 => 1,
3 => 3,
);
$this->meta = $faces[$player->entity->getDirection()] & 0x03;
if(($fy > 0.5 and $face !== 1) or $face === 0){
$this->meta |= 0x04; //Upside-down stairs
}
$this->level->setBlock($block, $this);
return true;
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 1){
return array(
array($this->id, 0, 1),
);
}else{
return array();
}
}
}

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.
*/
class TransparentBlock extends GenericBlock{
public function __construct($id, $meta = 0, $name = "Unknown"){
parent::__construct($id, $meta, $name);
$this->isActivable = false;
$this->breakable = true;
$this->isFlowable = false;
$this->isTransparent = true;
$this->isReplaceable = false;
$this->isPlaceable = true;
$this->isSolid = true;
}
}

View File

@ -1,55 +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 LadderBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(LADDER, $meta, "Ladder");
$this->isSolid = false;
$this->isFullBlock = false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($target->isTransparent === false){
$faces = array(
2 => 2,
3 => 3,
4 => 4,
5 => 5,
);
if(isset($faces[$face])){
$this->meta = $faces[$face];
$this->level->setBlock($block, $this);
return true;
}
}
return false;
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, 0, 1),
);
}
}

View File

@ -1,77 +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 SignPostBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(SIGN_POST, $meta, "Sign Post");
$this->isSolid = false;
$this->isFullBlock = false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($face !== 0){
$faces = array(
2 => 2,
3 => 3,
4 => 4,
5 => 5,
);
if(!isset($faces[$face])){
$this->meta = floor((($player->entity->yaw + 180) * 16 / 360) + 0.5) & 0x0F;
$this->level->setBlock($block, BlockAPI::get(SIGN_POST, $this->meta));
return true;
}else{
$this->meta = $faces[$face];
$this->level->setBlock($block, BlockAPI::get(WALL_SIGN, $this->meta));
return true;
}
}
return false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getID() === AIR){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SIGN, 0, 1));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function onBreak(Item $item, Player $player){
$this->level->setBlock($this, new AirBlock(), true, true);
return true;
}
public function getDrops(Item $item, Player $player){
return array(
array(SIGN, 0, 1),
);
}
}

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.
*/
class TorchBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(TORCH, $meta, "Torch");
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
$side = $this->getMetadata();
$faces = array(
1 => 4,
2 => 5,
3 => 2,
4 => 3,
5 => 0,
6 => 0,
0 => 0,
);
if($this->getSide($faces[$side])->isTransparent === true and !($side === 0 and $this->getSide(0)->getID() === FENCE)){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id, 0, 1));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($target->isTransparent === false and $face !== 0){
$faces = array(
1 => 5,
2 => 4,
3 => 3,
4 => 2,
5 => 1,
);
$this->meta = $faces[$face];
$this->level->setBlock($block, $this);
return true;
}elseif($this->getSide(0)->isTransparent === false or $this->getSide(0)->getID() === FENCE){
$this->meta = 0;
$this->level->setBlock($block, $this);
return true;
}
return false;
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, 0, 1),
);
}
}

View File

@ -1,64 +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 TrapdoorBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(TRAPDOOR, $meta, "Trapdoor");
$this->isActivable = true;
if(($this->meta & 0x04) === 0x04){
$this->isFullBlock = false;
}else{
$this->isFullBlock = true;
}
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if(($target->isTransparent === false or $target->getID() === SLAB) and $face !== 0 and $face !== 1){
$faces = array(
2 => 0,
3 => 1,
4 => 2,
5 => 3,
);
$this->meta = $faces[$face] & 0x03;
if($fy > 0.5){
$this->meta |= 0x08;
}
$this->level->setBlock($block, $this);
return true;
}
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, 0, 1),
);
}
public function onActivate(Item $item, Player $player){
$this->meta ^= 0x04;
$this->level->setBlock($this, $this);
return true;
}
}

View File

@ -1,40 +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.
*/
/***REM_START***/
require_once("SignPost.php");
/***REM_END***/
class WallSignBlock extends SignPostBlock{
public function __construct($meta = 0){
TransparentBlock::__construct(WALL_SIGN, $meta, "Wall Sign");
}
public function onUpdate($type){
return false;
}
}

View File

@ -1,33 +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 LavaBlock extends LiquidBlock{
public function __construct($meta = 0){
parent::__construct(LAVA, $meta, "Lava");
}
}

View File

@ -1,33 +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 StillLavaBlock extends LiquidBlock{
public function __construct($meta = 0){
parent::__construct(STILL_LAVA, $meta, "Still Lava");
}
}

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.
*/
/***REM_START***/
require_once("Water.php");
/***REM_END***/
class StillWaterBlock extends WaterBlock{
public function __construct($meta = 0){
LiquidBlock::__construct(STILL_WATER, $meta, "Still Water");
}
}

View File

@ -1,55 +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 WaterBlock extends LiquidBlock{
public function __construct($meta = 0){
parent::__construct(WATER, $meta, "Water");
}
public function onUpdate($type){
return false;
$level = $this->meta & 0x03;
if($type !== BLOCK_UPDATE_NORMAL or $level === 0){
return false;
}
$falling = $this->meta >> 3;
$down = $this->getSide(0);
if($down->isFlowable){
$this->level->setBlock($down, new WaterBlock(9), true); //1001
return;
}elseif($down instanceof WaterBlock and $down->getMetadata() === 9){
$level = 1;
}
$up = $this->getSide(1);
if($up instanceof WaterBlock){
}
}
}

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.
*/
class AirBlock extends TransparentBlock{
public function __construct(){
parent::__construct(AIR, 0, "Air");
$this->isActivable = false;
$this->breakable = false;
$this->isFlowable = true;
$this->isTransparent = true;
$this->isReplaceable = true;
$this->isPlaceable = false;
$this->hasPhysics = false;
$this->isSolid = false;
$this->isFullBlock = true;
}
}

View File

@ -1,101 +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 BedBlock extends TransparentBlock{
public function __construct($type = 0){
parent::__construct(BED_BLOCK, $type, "Bed Block");
$this->isActivable = true;
$this->isFullBlock = false;
}
public function onActivate(Item $item, Player $player){
$player->dataPacket(MC_CLIENT_MESSAGE, array(
"message" => "This bed has been corrupted by your hands!"
));
return true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->isTransparent === false){
$faces = array(
0 => 3,
1 => 4,
2 => 2,
3 => 5,
);
$d = $player->entity->getDirection();
$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->level->setBlock($block, BlockAPI::get($this->id, $meta));
$this->level->setBlock($next, BlockAPI::get($this->id, $meta | 0x08));
return true;
}
}
return false;
}
public function onBreak(Item $item, Player $player){
$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->level->setBlock($blockNorth, new AirBlock());
}elseif($blockSouth->getID() === $this->id and $blockSouth->meta !== 0x08){
$this->level->setBlock($blockSouth, new AirBlock());
}elseif($blockEast->getID() === $this->id and $blockEast->meta !== 0x08){
$this->level->setBlock($blockEast, new AirBlock());
}elseif($blockWest->getID() === $this->id and $blockWest->meta !== 0x08){
$this->level->setBlock($blockWest, new AirBlock());
}
}else{ //Bottom Part of Bed
if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
$this->level->setBlock($blockNorth, new AirBlock());
}elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
$this->level->setBlock($blockSouth, new AirBlock());
}elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){
$this->level->setBlock($blockEast, new AirBlock());
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
$this->level->setBlock($blockWest, new AirBlock());
}
}
$this->level->setBlock($this, new AirBlock());
return true;
}
public function getDrops(Item $item, Player $player){
return array(
array(BED, 0, 1),
);
}
}

View File

@ -1,59 +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 FireBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(FIRE, $meta, "Fire");
$this->isReplaceable = true;
$this->breakable = false;
$this->isFullBlock = true;
}
public function getDrops(Item $item, Player $player){
return array();
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
for($s = 0; $s <= 5; ++$s){
$side = $this->getSide($s);
if($side->getID() !== AIR and !($side instanceof LiquidBlock)){
return false;
}
}
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}elseif($type === BLOCK_UPDATE_RANDOM){
if($this->getSide(0)->getID() !== NETHERRACK){
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -1,34 +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 NetherReactorBlock extends SolidBlock{
public function __construct($meta = 0){
parent::__construct(NETHER_REACTOR, $meta, "Nether Reactor");
$this->isActivable = true;
}
}

View File

@ -1,32 +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 TNTBlock extends SolidBlock{
public function __construct(){
parent::__construct(TNT, 0, "TNT");
}
}

View File

@ -1,54 +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 CakeBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(CAKE_BLOCK, 0, "Cake Block");
$this->isFullBlock = false;
$this->isActivable = true;
$this->meta = $meta & 0x07;
}
public function getDrops(Item $item, Player $player){
return array();
}
public function onActivate(Item $item, Player $player){
if($player->entity->getHealth() < 20){
++$this->meta;
$player->entity->heal(3, "cake");
if($this->meta >= 0x06){
$this->level->setBlock($this, new AirBlock());
}else{
$this->level->setBlock($this, $this);
}
return true;
}
return false;
}
}

View File

@ -1,37 +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 CobwebBlock extends FlowableBlock{
public function __construct(){
parent::__construct(COBWEB, 0, "Cobweb");
$this->isSolid = true;
$this->isFullBlock = false;
}
public function getDrops(Item $item, Player $player){
return array();
}
}

View File

@ -1,34 +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 FenceBlock extends TransparentBlock{
public function __construct(){
parent::__construct(FENCE, 0, "Fence");
$this->isFullBlock = false;
}
}

View File

@ -1,65 +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 FenceGateBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(FENCE_GATE, $meta, "Fence Gate");
$this->isActivable = true;
if(($this->meta & 0x04) === 0x04){
$this->isFullBlock = true;
}else{
$this->isFullBlock = false;
}
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$faces = array(
0 => 3,
1 => 0,
2 => 1,
3 => 2,
);
$this->meta = $faces[$player->entity->getDirection()] & 0x03;
$this->level->setBlock($block, $this);
return true;
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, 0, 1),
);
}
public function onActivate(Item $item, Player $player){
$faces = array(
0 => 3,
1 => 0,
2 => 1,
3 => 2,
);
$this->meta = ($faces[$player->entity->getDirection()] & 0x03) | ((~$this->meta) & 0x04);
$this->level->setBlock($this, $this);
return true;
}
}

View File

@ -1,33 +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 GlassPaneBlock extends TransparentBlock{
public function __construct(){
parent::__construct(GLASS_PANE, 0, "Glass Pane");
}
}

View File

@ -1,63 +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 IronDoorBlock extends DoorBlock{
public function __construct($meta = 0){
parent::__construct(IRON_DOOR_BLOCK, $meta, "Iron Door Block");
//$this->isActivable = true;
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
if($item->isPickaxe() >= 1){
return array(
array(IRON_DOOR, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,114 +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 SlabBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(SLAB, $meta, "Slab");
$names = array(
0 => "Stone",
1 => "Sandstone",
2 => "Wooden",
3 => "Cobblestone",
4 => "Brick",
5 => "Stone Brick",
6 => "Nether Brick",
7 => "Quartz",
);
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab";
if(($this->meta & 0x08) === 0x08){
$this->isFullBlock = true;
}else{
$this->isFullBlock = false;
}
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$this->meta &= 0x07;
if($face === 0){
if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0x08 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta));
return true;
}else{
$this->meta |= 0x08;
}
}elseif($face === 1){
if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta));
return true;
}
}elseif(!$player->entity->inBlock($block)){
if($block->getID() === SLAB){
if(($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
$this->level->setBlock($block, BlockAPI::get(DOUBLE_SLAB, $this->meta));
return true;
}
return false;
}else{
if($fy > 0.5){
$this->meta |= 0x08;
}
}
}else{
return false;
}
if($block->getID() === SLAB and ($target->getMetadata() & 0x07) !== ($this->meta & 0x07)){
return false;
}
$this->level->setBlock($block, $this);
return true;
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
if($item->isPickaxe() >= 1){
return array(
array($this->id, $this->meta & 0x07, 1),
);
}else{
return array();
}
}
}

View File

@ -1,53 +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 SnowLayerBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(SNOW_LAYER, $meta, "Snow Layer");
$this->isReplaceable = true;
$this->isSolid = false;
$this->isFullBlock = false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->getID() === AIR){ //Replace wit common break method
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function getDrops(Item $item, Player $player){
if($item->isShovel() !== false){
return array(
array(SNOWBALL, 0, 1),
);
}
}
}

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.
*/
class WoodDoorBlock extends DoorBlock{
public function __construct($meta = 0){
parent::__construct(WOOD_DOOR_BLOCK, $meta, "Wood Door Block");
$this->isActivable = true;
}
public function getDrops(Item $item, Player $player){
return array(
array(WOODEN_DOOR, 0, 1),
);
}
}

View File

@ -1,33 +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 BrickStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(BRICK_STAIRS, $meta, "Brick Stairs");
}
}

View File

@ -1,33 +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 CobblestoneStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(COBBLESTONE_STAIRS, $meta, "Cobblestone Stairs");
}
}

View File

@ -1,33 +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 NetherBricksStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(NETHER_BRICKS_STAIRS, $meta, "Nether Bricks Stairs");
}
}

View File

@ -1,33 +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 QuartzStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(QUARTZ_STAIRS, $meta, "Quartz Stairs");
}
}

View File

@ -1,33 +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 SandstoneStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(SANDSTONE_STAIRS, $meta, "Sandstone Stairs");
}
}

View File

@ -1,33 +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 StoneBrickStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(STONE_BRICK_STAIRS, $meta, "Stone Brick Stairs");
}
}

View File

@ -1,33 +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 WoodStairsBlock extends StairBlock{
public function __construct($meta = 0){
parent::__construct(WOOD_STAIRS, $meta, "Wood Stairs");
}
}

View File

@ -1,63 +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 CoalOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(COAL_ORE, 0, "Coal Ore");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
if($item->isPickaxe() >= 1){
return array(
array(COAL, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,56 +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 DiamondOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(DIAMOND_ORE, 0, "Diamond Ore");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 4){
return array(
array(DIAMOND, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,68 +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 GlowingRedstoneOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(GLOWING_REDSTONE_ORE, 0, "Glowing Redstone Ore");
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_SCHEDULED or $type === BLOCK_UPDATE_RANDOM){
$this->level->setBlock($this, BlockAPI::get(REDSTONE_ORE, $this->meta), false);
return BLOCK_UPDATE_WEAK;
}else{
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
}
return false;
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 4){
return array(
//array(331, 4, mt_rand(4, 5)),
);
}else{
return array();
}
}
}

View File

@ -1,56 +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 GoldOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(GOLD_ORE, 0, "Gold Ore");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 4){
return array(
array(GOLD_ORE, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,58 +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 IronOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(IRON_ORE, 0, "Iron Ore");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
default:
return 15;
}
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 3){
return array(
array(IRON_ORE, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,59 +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 LapisOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(LAPIS_ORE, 0, "Lapis Ore");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
default:
return 15;
}
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 3){
return array(
array(DYE, 4, mt_rand(4, 8)),
);
}else{
return array();
}
}
}

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 RedstoneOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(REDSTONE_ORE, 0, "Redstone Ore");
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL or $type === BLOCK_UPDATE_TOUCH){
$this->level->setBlock($this, BlockAPI::get(GLOWING_REDSTONE_ORE, $this->meta), false);
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return BLOCK_UPDATE_WEAK;
}
return false;
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 2){
return array(
//array(331, 4, mt_rand(4, 5)),
);
}else{
return array();
}
}
}

View File

@ -1,52 +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 BrownMushroomBlock extends FlowableBlock{
public function __construct(){
parent::__construct(BROWN_MUSHROOM, 0, "Brown Mushroom");
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->isTransparent === false){
$this->level->setBlock($block, $this);
return true;
}
return false;
}
}

View File

@ -1,85 +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 CactusBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(CACTUS, $meta, "Cactus");
$this->isFullBlock = false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
$down = $this->getSide(0);
if($down->getID() !== SAND and $down->getID() !== CACTUS){ //Replace wit common break method
$this->level->setBlock($this, new AirBlock(), false);
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id));
return BLOCK_UPDATE_NORMAL;
}
}elseif($type === BLOCK_UPDATE_RANDOM){
if($this->getSide(0)->getID() !== CACTUS){
if($this->meta == 0x0F){
for($y = 1; $y < 3; ++$y){
$b = $this->level->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
if($b->getID() === AIR){
$this->level->setBlock($b, new CactusBlock());
break;
}
}
$this->meta = 0;
$this->level->setBlock($this, $this);
}else{
++$this->meta;
$this->level->setBlock($this, $this);
}
return BLOCK_UPDATE_RANDOM;
}
}
return false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === SAND or $down->getID() === 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->level->setBlock($this, $this);
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
}
return false;
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, 0, 1),
);
}
}

View File

@ -1,52 +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 CyanFlowerBlock extends FlowableBlock{
public function __construct(){
parent::__construct(CYAN_FLOWER, 0, "Cyan Flower");
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
$this->level->setBlock($block, $this);
return true;
}
return false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -1,52 +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 DandelionBlock extends FlowableBlock{
public function __construct(){
parent::__construct(DANDELION, 0, "Dandelion");
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
$this->level->setBlock($block, $this);
return true;
}
return false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

View File

@ -1,44 +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 DeadBushBlock extends FlowableBlock{
public function __construct(){
parent::__construct(DEAD_BUSH, 0, "Dead Bush");
$this->isReplaceable = true;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
}

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 MelonStemBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(MELON_STEM, $meta, "Melon Stem");
$this->isActivable = true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === FARMLAND){
$this->level->setBlock($block, $this);
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
return false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(MELON_SEEDS, 0, mt_rand(0, 2)));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}elseif($type === BLOCK_UPDATE_RANDOM){
if(mt_rand(0, 2) == 1){
if($this->meta < 0x07){
++$this->meta;
$this->level->setBlock($this, $this);
return BLOCK_UPDATE_RANDOM;
}else{
for($side = 2; $side <= 5; ++$side){
$b = $this->getSide($side);
if($b->getID() === MELON_BLOCK){
return BLOCK_UPDATE_RANDOM;
}
}
$side = $this->getSide(mt_rand(2,5));
$d = $side->getSide(0);
if($side->getID() === AIR and ($d->getID() === FARMLAND or $d->getID() === GRASS or $d->getID() === DIRT)){
$this->level->setBlock($side, new MelonBlock());
}
}
}
return BLOCK_UPDATE_RANDOM;
}
return false;
}
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->level->setBlock($this, $this);
if(($player->gamemode & 0x01) === 0){
$item->count--;
}
return true;
}
return false;
}
public function getDrops(Item $item, Player $player){
return array(
array(MELON_SEEDS, 0, mt_rand(0, 2)),
);
}
}

View File

@ -1,52 +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 RedMushroomBlock extends FlowableBlock{
public function __construct(){
parent::__construct(RED_MUSHROOM, 0, "Red Mushroom");
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->isTransparent === false){
$this->level->setBlock($block, $this);
return true;
}
return false;
}
}

View File

@ -1,94 +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 SaplingBlock extends FlowableBlock{
const OAK = 0;
const SPRUCE = 1;
const BIRCH = 2;
const BURN_TIME = 5;
public function __construct($meta = Sapling::OAK){
parent::__construct(SAPLING, $meta, "Sapling");
$this->isActivable = true;
$names = array(
0 => "Oak Sapling",
1 => "Spruce Sapling",
2 => "Birch Sapling",
);
$this->name = $names[$this->meta & 0x03];
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === GRASS or $down->getID() === DIRT or $down->getID() === FARMLAND){
$this->level->setBlock($block, $this);
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
return false;
}
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
if(($player->gamemode & 0x01) === 0){
$item->count--;
}
return true;
}
return false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}elseif($type === BLOCK_UPDATE_RANDOM){ //Growth
if(mt_rand(1,7) === 1){
if(($this->meta & 0x08) === 0x08){
TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03);
}else{
$this->meta |= 0x08;
$this->level->setBlock($this, $this);
return BLOCK_UPDATE_RANDOM;
}
}else{
return BLOCK_UPDATE_RANDOM;
}
return true;
}
return false;
}
public function getDrops(Item $item, Player $player){
return array(
array($this->id, $this->meta & 0x03, 1),
);
}
}

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.
*/
class SugarcaneBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(SUGARCANE_BLOCK, $meta, "Sugarcane");
}
public function getDrops(Item $item, Player $player){
return array(
array(SUGARCANE, 0, 1),
);
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
$down = $this->getSide(0);
if($down->isTransparent === true and $down->getID() !== SUGARCANE_BLOCK){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SUGARCANE));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}elseif($type === BLOCK_UPDATE_RANDOM){
if($this->getSide(0)->getID() !== SUGARCANE_BLOCK){
if($this->meta === 0x0F){
for($y = 1; $y < 3; ++$y){
$b = $this->level->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
if($b->getID() === AIR){
$this->level->setBlock($b, new SugarcaneBlock());
break;
}
}
$this->meta = 0;
$this->level->setBlock($this, $this);
}else{
++$this->meta;
$this->level->setBlock($this, $this);
}
return BLOCK_UPDATE_RANDOM;
}
}
return false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === SUGARCANE_BLOCK){
$this->level->setBlock($block, new SugarcaneBlock());
return true;
}elseif($down->getID() === GRASS or $down->getID() === DIRT or $down->getID() === SAND){
$block0 = $down->getSide(2);
$block1 = $down->getSide(3);
$block2 = $down->getSide(4);
$block3 = $down->getSide(5);
if(($block0 instanceof WaterBlock)
or ($block1 instanceof WaterBlock)
or ($block2 instanceof WaterBlock)
or ($block3 instanceof WaterBlock)){
$this->level->setBlock($block, new SugarcaneBlock());
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
}
return false;
}
}

View File

@ -1,58 +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 TallGrassBlock extends FlowableBlock{
public function __construct($meta = 1){
parent::__construct(TALL_GRASS, $meta, "Tall Grass");
$this->isReplaceable = true;
$names = array(
0 => "Dead Shrub",
1 => "Tall Grass",
2 => "Fern",
);
$this->name = $names[$this->meta & 0x03];
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}
return false;
}
public function getDrops(Item $item, Player $player){
$drops = array();
if(mt_rand(1,10) === 1){//Seeds
$drops[] = array(WHEAT_SEEDS, 0, 1);
}
return $drops;
}
}

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 WheatBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(WHEAT_BLOCK, $meta, "Wheat Block");
$this->isActivable = true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);
if($down->getID() === FARMLAND){
$this->level->setBlock($block, $this);
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
return false;
}
public function onActivate(Item $item, Player $player){
if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal
$this->meta = 0x07;
$this->level->setBlock($this, $this);
if(($player->gamemode & 0x01) === 0){
$item->count--;
}
return true;
}
return false;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent === true){ //Replace wit common break method
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(WHEAT_SEEDS, 0, 1));
$this->level->setBlock($this, new AirBlock(), false);
return BLOCK_UPDATE_NORMAL;
}
}elseif($type === BLOCK_UPDATE_RANDOM){
if(mt_rand(0, 2) == 1){
if($this->meta < 0x07){
++$this->meta;
$this->level->setBlock($this, $this);
return BLOCK_UPDATE_RANDOM;
}
}else{
return BLOCK_UPDATE_RANDOM;
}
}
return false;
}
public function getDrops(Item $item, Player $player){
$drops = array();
if($this->meta >= 0x07){
$drops[] = array(WHEAT, 0, 1);
$drops[] = array(WHEAT_SEEDS, 0, mt_rand(0, 3));
}else{
$drops[] = array(WHEAT_SEEDS, 0, 1);
}
return $drops;
}
}

View File

@ -1,41 +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 BedrockBlock extends SolidBlock{
public function __construct(){
parent::__construct(BEDROCK, 0, "Bedrock");
$this->breakable = false;
}
public function isBreakable(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return true;
}
return false;
}
}

View File

@ -1,33 +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 BookshelfBlock extends SolidBlock{
public function __construct(){
parent::__construct(BOOKSHELF, 0, "Bookshelf");
}
}

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 BricksBlock extends SolidBlock{
public function __construct(){
parent::__construct(BRICKS_BLOCK, 0, "Bricks");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
if($item->isPickaxe() >= 1){
return array(
array(BRICKS_BLOCK, 0, 1),
);
}else{
return array();
}
}
}

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 BurningFurnaceBlock extends SolidBlock{
public function __construct($meta = 0){
parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace");
$this->isActivable = true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$faces = array(
0 => 4,
1 => 2,
2 => 5,
3 => 3,
);
$this->meta = $faces[$player->entity->getDirection()];
$this->level->setBlock($block, $this);
return true;
}
public function onBreak(Item $item, Player $player){
$server = ServerAPI::request();
$this->level->setBlock($this, new AirBlock(), true, true);
return true;
}
public function onActivate(Item $item, Player $player){
$server = ServerAPI::request();
$t = $server->api->tile->get($this);
$furnace = false;
if($t !== false){
$furnace = $t;
}else{
$furnace = $server->api->tile->add($this->level, TILE_FURNACE, $this->x, $this->y, $this->z, array(
"Items" => array(),
"id" => TILE_FURNACE,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z
));
}
if($furnace->class !== TILE_FURNACE or ($player->gamemode & 0x01) === 0x01){
return true;
}
$player->windowCnt++;
$player->windowCnt = $id = max(2, $player->windowCnt % 255);
$player->windows[$id] = $furnace;
$player->dataPacket(MC_CONTAINER_OPEN, array(
"windowid" => $id,
"type" => WINDOW_FURNACE,
"slots" => FURNACE_SLOTS,
"title" => "Furnace",
));
$slots = array();
for($s = 0; $s < FURNACE_SLOTS; ++$s){
$slot = $furnace->getSlot($s);
if($slot->getID() > 0 and $slot->count > 0){
$slots[] = $slot;
}else{
$slots[] = BlockAPI::getItem(AIR, 0, 0);
}
}
$player->dataPacket(MC_CONTAINER_SET_CONTENT, array(
"windowid" => $id,
"count" => count($slots),
"slots" => $slots
));
return true;
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
$drops = array();
if($item->isPickaxe() >= 1){
$drops[] = array(FURNACE, 0, 1);
}
$t = ServerAPI::request()->api->tile->get($this);
if($t !== false and $t->class === TILE_FURNACE){
for($s = 0; $s < FURNACE_SLOTS; ++$s){
$slot = $t->getSlot($s);
if($slot->getID() > AIR and $slot->count > 0){
$drops[] = array($slot->getID(), $slot->getMetadata(), $slot->count);
}
}
}
return $drops;
}
}

View File

@ -1,132 +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 ChestBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(CHEST, $meta, "Chest");
$this->isActivable = true;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$block0 = $this->getSide(2);
$block1 = $this->getSide(3);
$block2 = $this->getSide(4);
$block3 = $this->getSide(5);
if($block0->getID() !== CHEST and $block1->getID() !== CHEST and $block2->getID() !== CHEST and $block3->getID() !== CHEST){
$faces = array(
0 => 4,
1 => 2,
2 => 5,
3 => 3,
);
$this->meta = $faces[$player->entity->getDirection()];
$this->level->setBlock($block, $this);
$server = ServerAPI::request();
$server->api->tile->add($this->level, TILE_CHEST, $this->x, $this->y, $this->z, array(
"Items" => array(),
"id" => TILE_CHEST,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z
));
return true;
}
return false;
}
public function onBreak(Item $item, Player $player){
$server = ServerAPI::request();
$this->level->setBlock($this, new AirBlock(), true, true);
return true;
}
public function onActivate(Item $item, Player $player){
$top = $this->getSide(1);
if($top->isTransparent !== true){
return true;
}
$server = ServerAPI::request();
$t = $server->api->tile->get($this);
$chest = false;
if($t !== false){
$chest = $t;
}else{
$chest = $server->api->tile->add($this->level, TILE_CHEST, $this->x, $this->y, $this->z, array(
"Items" => array(),
"id" => TILE_CHEST,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z
));
}
if($chest->class !== TILE_CHEST or ($player->gamemode & 0x01) === 0x01){
return true;
}
$player->windowCnt++;
$player->windowCnt = $id = max(2, $player->windowCnt % 255);
$player->windows[$id] = $chest;
$player->dataPacket(MC_CONTAINER_OPEN, array(
"windowid" => $id,
"type" => WINDOW_CHEST,
"slots" => CHEST_SLOTS,
"title" => "Chest",
));
$slots = array();
for($s = 0; $s < CHEST_SLOTS; ++$s){
$slot = $chest->getSlot($s);
if($slot->getID() > AIR and $slot->count > 0){
$slots[] = $slot;
}else{
$slots[] = BlockAPI::getItem(AIR, 0, 0);
}
}
$player->dataPacket(MC_CONTAINER_SET_CONTENT, array(
"windowid" => $id,
"count" => count($slots),
"slots" => $slots
));
return true;
}
public function getDrops(Item $item, Player $player){
$drops = array(
array($this->id, 0, 1),
);
$t = ServerAPI::request()->api->tile->get($this);
if($t !== false and $t->class === TILE_CHEST){
for($s = 0; $s < CHEST_SLOTS; ++$s){
$slot = $t->getSlot($s);
if($slot->getID() > AIR and $slot->count > 0){
$drops[] = array($slot->getID(), $slot->getMetadata(), $slot->count);
}
}
}
return $drops;
}
}

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 ClayBlock extends SolidBlock{
public function __construct(){
parent::__construct(CLAY_BLOCK, 0, "Clay Block");
}
public function getDrops(Item $item, Player $player){
return array(
array(CLAY, 0, 4),
);
}
}

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 CobblestoneBlock extends SolidBlock{
public function __construct(){
parent::__construct(COBBLESTONE, 0, "Cobblestone");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
if($item->isPickaxe() >= 1){
return array(
array(COBBLESTONE, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,56 +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 DiamondBlock extends SolidBlock{
public function __construct(){
parent::__construct(DIAMOND_BLOCK, 0, "Diamond Block");
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
default:
return 25;
}
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 4){
return array(
array(DIAMOND_BLOCK, 0, 1),
);
}else{
return array();
}
}
}

View File

@ -1,44 +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 DirtBlock extends SolidBlock{
public function __construct(){
parent::__construct(DIRT, 0, "Dirt");
$this->isActivable = true;
}
public function onActivate(Item $item, Player $player){
if($item->isHoe()){
if(($player->gamemode & 0x01) === 0){
$item->useOn($this);
}
$this->level->setBlock($this, BlockAPI::get(FARMLAND, 0));
return true;
}
return false;
}
}

View File

@ -1,74 +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 DoubleSlabBlock extends SolidBlock{
public function __construct($meta = 0){
parent::__construct(DOUBLE_SLAB, $meta, "Double Slab");
$names = array(
0 => "Stone",
1 => "Sandstone",
2 => "Wooden",
3 => "Cobblestone",
4 => "Brick",
5 => "Stone Brick",
6 => "Nether Brick",
7 => "Quartz",
);
$this->name = "Double " . $names[$this->meta & 0x07] . " Slab";
}
public function getBreakTime(Item $item, Player $player){
if(($player->gamemode & 0x01) === 0x01){
return 0.20;
}
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, Player $player){
if($item->isPickaxe() >= 1){
return array(
array(SLAB, $this->meta & 0x07, 2),
);
}else{
return array();
}
}
}

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