Commit Graph

27 Commits

Author SHA1 Message Date
e990c5a0a5 Protocol changes for 1.16.0 2020-06-26 14:06:41 +01:00
c5bbb2bcbc Move crafting action detection from InventoryTransactionPacket to Player 2020-06-26 11:59:30 +01:00
b6bbf655d7 InventoryTransactionPacket: fixed crafting flags being set on useless empty transactions
this fixes some misleading debug noise when getting stuff from creative inventory and triggers some different spam instead.
2019-12-06 20:08:09 +00:00
740f0a2314 crafting now works on 1.13, but it's not good 2019-12-02 21:50:52 +00:00
cce99b07af 1.10.0 updates 2019-03-20 19:17:41 +00:00
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
0f941410f6 Use more appropriate exceptions in the protocol layer 2019-01-03 17:57:06 +00:00
8572e9e560 Crafting: nuke
This commit brings in a much-needed rewrite of crafting transaction handling.

The following classes have been removed:
- CraftingTransferMaterialAction
- CraftingTakeResultAction

The following classes have significant changes:
- CraftingTransaction
	- All API methods have been removed and are now handled in CraftItemEvent
- CraftItemEvent
	- added the following:
		- getInputs()
		- getOutputs()
		- getRepetitions() (tells how many times a recipe was crafted in this event)
- Recipe interface:
	- Removed getResult() (individual recipes may handle this differently)
- CraftingRecipe interface
	- removed the following:
		- matchItems()
		- getExtraResults()
		- getAllResults()
	- added the following
		- getResults()
		- getIngredientList() : Item[], which must return a 1D array of items that should be consumed (wildcards accepted).
		- matchesCraftingGrid(CraftingGrid)
- ShapedRecipe
	- constructor now accepts string[], Item[], Item[]
- ShapelessRecipe
	- constructor now accepts Item[], Item[]
2018-03-29 12:05:22 +01:00
41592a04b7 InventoryTransactionPacket: Update some field names 2018-01-24 13:50:30 +00:00
95d42b9907 Network: Remove legacy Vector3 primitive encode/decode methods 2018-01-20 10:58:39 +00:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
240cc3043a Rewritten crafting, fixed #45 2017-09-24 14:14:24 +01:00
6897cb4774 Moved inventory action magic slot constants where they belong 2017-09-20 18:27:29 +01:00
0fac3b9a9d Added encode for InventoryTransactionPacket and refactor some stuff 2017-09-13 11:14:04 +01:00
23a38400e2 Added CraftingGrid and BigCraftingGrid, WIP stuff for crafting
moving whole stacks in & out of the crafting grid works now, splitting stacks is fucked up because the transaction system can't handle the same slot changing multiple times in one transaction
2017-09-12 19:34:06 +01:00
a3d21de559 Cleaned up network inventory action reading and core action creation 2017-08-28 20:04:35 +01:00
9be1b929a5 Added PhpDoc for packet field types and changed float x,y,z to Vector3 2017-08-13 20:02:07 +01:00
8958b3c51c Many many changes related to inventory transactions, fixed item dropping, fixed creative menu 2017-08-11 19:57:30 +01:00
c1ff7bbef4 Added creative-inventory magic slot numbers and renamed some constants 2017-08-11 12:31:11 +01:00
5208ad885c Added crafting use-ingredient fake transaction source 2017-08-10 18:42:14 +01:00
7958fffa07 Move some code around to fix block placing, breaking, and throwing snowballs 2017-08-07 12:28:07 +01:00
49506659e0 More constants 2017-08-06 17:21:51 +01:00
7886918140 Cleaned up some bad code in DataPacket, added encode/decodeHeader and made encode/decodePayload protected 2017-08-06 17:21:51 +01:00
50dffeb6a1 Day 3, part 1 2017-08-06 17:21:51 +01:00
63d2b341b9 Day 2 2017-08-06 17:21:51 +01:00
77cd8e7799 More broken mess to spawn 1.2 2017-08-06 17:21:51 +01:00