Refactored crafting patterns (#4458)
* Deduplicate crafting patterns internals This should save a bit memory for duplicate patterns as well as speed up loading new patterns on reloading chunks. * Encode recipe id in pattern * Use the recipe id directly for looking it up * Slightly refactored how patterns encode whether they are crafting patterns or not. * Renamed PatternHelper. * Added APIs to encode patterns. (#4463) * Removed ICraftingPatternItem. * Renamed isCrafting to isCraftable Co-authored-by: shartte <shartte@users.noreply.github.com>
This commit is contained in:
@@ -226,8 +226,7 @@ public class MolecularAssemblerTileEntity extends AENetworkInvTileEntity
|
||||
|
||||
if (!myPat.isEmpty() && myPat.getItem() instanceof EncodedPatternItem) {
|
||||
final World w = this.getWorld();
|
||||
final EncodedPatternItem iep = (EncodedPatternItem) myPat.getItem();
|
||||
final ICraftingPatternDetails ph = iep.getPatternForItem(myPat, w);
|
||||
final ICraftingPatternDetails ph = Api.instance().crafting().decodePattern(myPat, w);
|
||||
if (ph != null && ph.isCraftable()) {
|
||||
this.forcePlan = true;
|
||||
this.myPlan = ph;
|
||||
@@ -253,8 +252,7 @@ public class MolecularAssemblerTileEntity extends AENetworkInvTileEntity
|
||||
if (!is.isEmpty() && is.getItem() instanceof EncodedPatternItem) {
|
||||
if (!ItemStack.areItemsEqual(is, this.myPattern)) {
|
||||
final World w = this.getWorld();
|
||||
final EncodedPatternItem iep = (EncodedPatternItem) is.getItem();
|
||||
final ICraftingPatternDetails ph = iep.getPatternForItem(is, w);
|
||||
final ICraftingPatternDetails ph = Api.instance().crafting().decodePattern(is, w);
|
||||
|
||||
if (ph != null && ph.isCraftable()) {
|
||||
this.progress = 0;
|
||||
|
||||
Reference in New Issue
Block a user