7715 Commits

Author SHA1 Message Date
Dylan K. Taylor
2660448601 Crafting: Match recipe based only on transaction inputs/outputs
As of 1.2.13 release, the client now skips the crafting grid step when it crafts with right-click on the recipe book. This means that we can't validate crafting based on the crafting grid contents anymore. The only way to do it now is to use the inputs and outputs calculated by the transaction balance.
2018-04-04 12:48:17 +01:00
Dylan K. Taylor
eb354916d4 CraftingTransaction: simplifiy repetition calculation handling 2018-04-04 12:18:24 +01:00
Dylan K. Taylor
033b44df5a CraftingTransaction: Start from pre-computed iteration count for input matching
This will be faster to bail out on failures.
2018-04-04 12:15:46 +01:00
Dylan K. Taylor
ef2dd1de92 Inventory: Use exceptions to report back why a transaction failed
Returning false all the time could mean any one of a range of things. Throwing exceptions is better in that it allows us to catch them and see what actually broke.
2018-04-04 12:11:24 +01:00
Dylan K. Taylor
5b7b2dd0e2 Merge changes from ALPHA11 for 1.2.13 2018-04-04 11:31:39 +01:00
Dylan K. Taylor
3a10df634b Protocol bump for release 2018-04-04 11:13:36 +01:00
Dylan K. Taylor
f1aecc3a71 Updated block IDs json from release (thanks MrARM) 2018-04-04 11:09:12 +01:00
Frago9876543210
42d04a4418 Allow use of 128x128 skins for last beta build (#2123) 2018-04-04 11:03:51 +01:00
Dylan K. Taylor
3fe4ebc301 Found more unknown things 2018-04-04 11:03:36 +01:00
Dylan K. Taylor
d97abfaa7b Found some unknown things 2018-04-04 11:03:25 +01:00
Dylan K. Taylor
526f05631e fix metadata properties for new beta
there are more things than this, but I don't have time to figure them all out.
2018-04-04 11:03:05 +01:00
Dylan K. Taylor
ebaef89e06 bump 2018-04-04 11:02:19 +01:00
Dylan K. Taylor
6ab0cff9d3 Bump for 1.2.13.10
doesn't appear that anything of interest has changed
2018-04-04 11:01:46 +01:00
Dylan K. Taylor
ae31ce1d25 LevelSoundEventPacket: updated sounds constants 2018-04-04 11:01:29 +01:00
Dylan K. Taylor
a1cf5dbd1e fix doc inconsistency 2018-04-04 11:01:14 +01:00
Dylan K. Taylor
c86132028e BlockFactory: add new "dynamic" fake runtime IDs for unknown legacy ID/meta combinations
This is basically how blockstate discovery would actually work in the full-blown system. This maps blocks with unrecognized blockstates to static runtimeIDs not known to the client.

This means that all blocks which don't have corresponding runtimeIDs in the new system will translate to update! blocks instead.

Mojang do this differently: they try to a) match id+meta, if that fails b) match id+0, and if that fails, then replace with update! block runtime ID. I can't do that here because I need to be able to convert both ways. They only need to be able to convert from legacy -> new.
2018-04-04 11:00:58 +01:00
Dylan K. Taylor
5ce55bd3b0 duct tape for block ID remapping 2018-04-04 11:00:39 +01:00
Dylan K. Taylor
c81f178cdb fix skins on 1.2.13.5
this is not the full changeset and more things are needed!
2018-04-04 10:59:09 +01:00
Dylan K. Taylor
fc795b80ae Protocol changes for 1.2.10 2018-04-04 10:58:49 +01:00
Dylan K. Taylor
99134de6b6 Updated NBT dependency
this needs further changes (particularly to Furnace) to stop things abusing NBT for runtime data handling, otherwise performance is going to drop off a cliff.
2018-04-04 10:29:32 +01:00
Dylan K. Taylor
1fc388d6de DataPropertyManager: fix an unnecessary FQN 2018-04-02 12:34:05 +01:00
Dylan K. Taylor
eba1ca030c Fix variadic type docs ...again
PhpStorm changed its mind how it wants these documenting in 2018.1, and apparently the correct syntax follows the PHP code.
2018-04-02 12:33:24 +01:00
Dylan K. Taylor
8ce0fab8cc Remove unused imports 2018-04-02 12:26:13 +01:00
Dylan K. Taylor
5ed2d6022c GiveCommand: don't catch Throwables
this caused me to think a thyntax error in my code was a syntax error in the NBT I was trying to parse.
2018-04-01 12:17:17 +01:00
Dylan K. Taylor
37d085f793 UPnP: error messages on failure to portforward instead of silently failing 2018-03-31 12:51:17 +01:00
Dylan K. Taylor
69c54de460 UPnP: remove useless 'or false' 2018-03-31 12:42:11 +01:00
Dylan K. Taylor
b9d3bd22a3 Player: fixed getLastPlayed() being useless
this should only be set on quit, not on join.
2018-03-31 10:44:59 +01:00
Dylan K. Taylor
d4d57aa9ea Merge branch 'feature/xp-event' 2018-03-30 12:46:53 +01:00
Dylan K. Taylor
4ce1f228e6 Player: removed checkBlockCollision() override 2018-03-30 12:23:00 +01:00
Dylan K. Taylor
4b03dbebba Entity: use temporalVector in checkBlockCollision() instead of creating a new Vector3 2018-03-30 12:21:37 +01:00
Dylan K. Taylor
1d5978df98 Fixed falling blocks getting moved by currents, closes #2080 2018-03-30 12:20:59 +01:00
Dylan K. Taylor
5d32587cf7 DeadBush: match placement condition with break condition, fixes #2116 2018-03-30 11:54:57 +01:00
Dylan K. Taylor
d53258c943 EffectCommand: restrict range of values for duration, fixes #2055 2018-03-30 11:51:20 +01:00
Dylan K. Taylor
773f760fff VanillaCommand: added getBoundedInt() 2018-03-30 11:48:42 +01:00
Dylan K. Taylor
c20b16a0fe Living: fixed damage resistance negating >100% of damage, closes #2052 2018-03-30 11:31:43 +01:00
Johnmacrocraft
b151cb26a5 Fix deprecated event message (#2127) 2018-03-30 11:09:24 +01:00
Dylan K. Taylor
49622cc2a5 NetworkBinaryStream: simplify read of canPlaceOn and canDestroy lists 2018-03-30 11:07:29 +01:00
Dylan K. Taylor
56328f66a7 InventoryAction: remove useless creationTime field 2018-03-29 12:20:13 +01:00
Dylan K. Taylor
f41a731493 DropItemAction: don't require a source item in constructor 2018-03-29 12:18:19 +01:00
Dylan K. Taylor
ec332e3e60 Fill null UUIDs in CraftingDataPacket, remove all UUID things from CraftingRecipe
This allows deleting lots of code, and additionally provides a huge reduction in the compressed size of CraftingDataPacket. Since we don't care about these UUIDs (they are only used in CraftingEventPacket, which is broken and unused in PM) we fill them with zeros instead.
2018-03-29 12:05:23 +01:00
Dylan K. Taylor
a1090623a2 CraftingRecipe: added methods to allow recipes to derive outputs from inputs
this will be needed for special recipes like shulker-box and banner recipes.
2018-03-29 12:05:22 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
bc836aaec1 Make CraftingManager::sort() more cool with spaceship operators 😎 2018-03-29 11:45:12 +01:00
Dylan K. Taylor
145a4fad0f CraftingManager: Make sort() static
this doesn't need access to $this
2018-03-29 11:45:06 +01:00
Dylan K. Taylor
08c48d8145 CraftingRecipe: removed requiresCraftingTable()
the requirement for a crafting table is determined by the number of ingredients can fit on the grid (shapeless) or the max height and width (shaped). It's impossible to craft a big recipe with a small crafting table simply because you're not able to put the required resources into the grid.
2018-03-29 11:43:31 +01:00
Dylan K. Taylor
81ecb56095 ShapedRecipe: fixed bug in constructor 2018-03-29 11:32:39 +01:00
Dylan K. Taylor
a6d7365a28 Moved CraftingManager init to its own function
this allows the crafting manager to be re-initialized on the fly without recreating it.
2018-03-29 11:32:22 +01:00
Dylan K. Taylor
1f4f8ab3f0 Inventory: Removed BigCraftingGrid, allow arbitrary size parameter
This is more flexible and requires less classes.
2018-03-29 11:24:28 +01:00
Dylan K. Taylor
1420cd1fa5 InventoryTransaction: Added a more robust action flattening mechanism
This now handles the case where there are multiple options which could be taken, and opts for the first result which successfully ties all the actions together. Previously it would be entirely down to chance (ordering) whether the actions would get ordered successfully.
2018-03-29 11:23:52 +01:00
Dylan K. Taylor
30a83544a0 don't break double chests 2018-03-27 10:23:18 +01:00