From 3a2d074775b48e888dfb95c232bcea55169c90fd Mon Sep 17 00:00:00 2001 From: P3pp3rF1y Date: Thu, 19 Oct 2023 00:10:10 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Add=20caching=20to=20improv?= =?UTF-8?q?e=20performance=20of=20inserts=20of=20items=20that=20can't=20fi?= =?UTF-8?q?t=20in=20backpack=20/=20storage=20/=20controlled=20storage=20mu?= =?UTF-8?q?ltiblock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 4 ++-- .../sophisticatedbackpacks/backpack/BackpackBlockEntity.java | 3 ++- src/main/resources/META-INF/mods.toml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index f7fc5a32..ca83670a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.daemon=false minecraft_version=1.19.2 forge_version=43.2.13 -mod_version=3.18.61 +mod_version=3.18.62 jei_mc_version=1.19.2-forge jei_version=11.6.0.+ curios_version=1.19.2-5.1.1.+ @@ -9,5 +9,5 @@ botania_version=1.19.2-439-FORGE-SNAPSHOT patchouli_version=1.19.2-78-SNAPSHOT balm_cf_file_id=3914527 crafting_tweaks_cf_file_id=3914007 -sc_version=1.19.2-0.5.91.+ +sc_version=1.19.2-0.5.94.+ parchment_version=1.18.2-2022.06.05-1.19 \ No newline at end of file diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackBlockEntity.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackBlockEntity.java index 2b3f332a..2b2891b7 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackBlockEntity.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackBlockEntity.java @@ -23,6 +23,7 @@ import net.p3pp3rf1y.sophisticatedcore.api.IStorageWrapper; import net.p3pp3rf1y.sophisticatedcore.controller.ControllerBlockEntityBase; import net.p3pp3rf1y.sophisticatedcore.controller.IControllableStorage; +import net.p3pp3rf1y.sophisticatedcore.inventory.CachedFailedInsertInventoryHandler; import net.p3pp3rf1y.sophisticatedcore.renderdata.RenderInfo; import net.p3pp3rf1y.sophisticatedcore.renderdata.TankPosition; import net.p3pp3rf1y.sophisticatedcore.upgrades.ITickableUpgrade; @@ -144,7 +145,7 @@ public LazyOptional getCapability(Capability cap, @Nullable Direction if (cap == ForgeCapabilities.ITEM_HANDLER) { if (itemHandlerCap == null) { - itemHandlerCap = LazyOptional.of(() -> getBackpackWrapper().getInventoryForInputOutput()); + itemHandlerCap = LazyOptional.of(() -> new CachedFailedInsertInventoryHandler(getBackpackWrapper().getInventoryForInputOutput(), () -> level != null ? level.getGameTime() : 0)); } return itemHandlerCap.cast(); } else if (cap == ForgeCapabilities.FLUID_HANDLER) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 8d4028b7..d0a105e3 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -60,7 +60,7 @@ side="BOTH" [[dependencies.sophisticatedbackpacks]] modId="sophisticatedcore" #mandatory mandatory=true #mandatory -versionRange="[1.19.2-0.5.62,)" #mandatory +versionRange="[1.19.2-0.5.94,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering="NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER