Skip to content

Commit

Permalink
feat: ✨ Add caching to improve performance of inserts of items that c…
Browse files Browse the repository at this point in the history
…an't fit in backpack / storage / controlled storage multiblock
  • Loading branch information
P3pp3rF1y committed Oct 18, 2023
1 parent 0ba7e36 commit 3a2d074
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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.+
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -144,7 +145,7 @@ public <T> LazyOptional<T> getCapability(Capability<T> 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a2d074

Please sign in to comment.