diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0db20485..695e0024 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -16,6 +16,9 @@ jobs: distribution: zulu cache: gradle - name: Build with Gradle + env: + USERNAME: ${{ secrets.USERNAME }} + READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }} uses: nick-invision/retry@v2 with: timeout_minutes: 10 diff --git a/build.gradle b/build.gradle index e73fb843..73ee2db2 100644 --- a/build.gradle +++ b/build.gradle @@ -40,6 +40,14 @@ repositories { } } maven { url "https://maven.blamejared.com/" } + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/p3pp3rf1y/sophisticatedcore") + credentials { + username = System.getenv("USERNAME") + password = System.getenv("READ_PACKAGES_TOKEN") + } + } } group = 'sophisticatedbackpacks' @@ -109,9 +117,15 @@ dependencies { if (findProject(':SophisticatedCore') != null) { implementation project(':SophisticatedCore') } else { - compileOnly fg.deobf("curse.maven:sophisticatedcore-618298:${sc_cf_file_id}") - runtimeOnly fg.deobf("curse.maven:sophisticatedcore-618298:${sc_cf_file_id}") - testImplementation fg.deobf("curse.maven:sophisticatedcore-618298:${sc_cf_file_id}") + compileOnly fg.deobf("sophisticatedcore:sophisticatedcore:${sc_version}") { + transitive = false + } + runtimeOnly fg.deobf("sophisticatedcore:sophisticatedcore:${sc_version}") { + transitive = false + } + testImplementation fg.deobf("sophisticatedcore:sophisticatedcore:${sc_version}") { + transitive = false + } } compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}") diff --git a/gradle.properties b/gradle.properties index 8c8499be..2a514d29 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.58 +mod_version=3.18.63 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_cf_file_id=4566112 +sc_version=1.19.2-0.5.97.+ 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/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java index 0b16cbed..d3568bf0 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java @@ -64,6 +64,7 @@ import net.p3pp3rf1y.sophisticatedcore.api.IStashStorageItem; import net.p3pp3rf1y.sophisticatedcore.api.IStorageWrapper; import net.p3pp3rf1y.sophisticatedcore.client.gui.utils.TranslationHelper; +import net.p3pp3rf1y.sophisticatedcore.settings.memory.MemorySettingsCategory; import net.p3pp3rf1y.sophisticatedcore.upgrades.ITickableUpgrade; import net.p3pp3rf1y.sophisticatedcore.upgrades.jukebox.ServerStorageSoundHandler; import net.p3pp3rf1y.sophisticatedcore.util.ColorHelper; @@ -114,7 +115,7 @@ public BlockEntityWithoutLevelRenderer getCustomRenderer() { public void fillItemCategory(CreativeModeTab group, NonNullList items) { super.fillItemCategory(group, items); - if (!allowedIn(group) || this != ModItems.BACKPACK.get() || !net.p3pp3rf1y.sophisticatedcore.Config.SERVER.enabledItems.isItemEnabled(this)) { + if (!allowedIn(group) || this != ModItems.BACKPACK.get() || !net.p3pp3rf1y.sophisticatedcore.Config.COMMON.enabledItems.isItemEnabled(this)) { return; } @@ -393,8 +394,17 @@ public ItemStack stash(ItemStack storageStack, ItemStack stack) { } @Override - public boolean isItemStashable(ItemStack storageStack, ItemStack stack) { - return storageStack.getCapability(CapabilityBackpackWrapper.getCapabilityInstance()).map(wrapper -> wrapper.getInventoryForUpgradeProcessing().insertItem(stack, true).getCount() != stack.getCount()).orElse(false); + public StashResult getItemStashable(ItemStack storageStack, ItemStack stack) { + return storageStack.getCapability(CapabilityBackpackWrapper.getCapabilityInstance()).map(wrapper -> { + if (wrapper.getInventoryForUpgradeProcessing().insertItem(stack, true).getCount() == stack.getCount()) { + return StashResult.NO_SPACE; + } + if (wrapper.getInventoryHandler().getSlotTracker().getItems().contains(stack.getItem()) || wrapper.getSettingsHandler().getTypeCategory(MemorySettingsCategory.class).matchesFilter(stack)) { + return StashResult.MATCH_AND_SPACE; + } + + return StashResult.SPACE; + }).orElse(StashResult.NO_SPACE); } public record BackpackContentsTooltip(ItemStack backpack) implements TooltipComponent { diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/refill/RefillUpgradeTab.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/refill/RefillUpgradeTab.java index 7983bd91..42be27db 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/refill/RefillUpgradeTab.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/upgrades/refill/RefillUpgradeTab.java @@ -130,7 +130,7 @@ private void updateTargetSlotTooltip(int mouseX, int mouseY) { private void renderTargetSlotAcronyms(PoseStack poseStack) { poseStack.pushPose(); - poseStack.translate(0, 0, 100); + poseStack.translate(0, 0, 300); getContainer().getSlots().forEach(slot -> { if (!slot.getItem().isEmpty()) { int slotIndex = slot.getSlotIndex(); diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 8d4028b7..3d6b5bd7 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.97,)" #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 diff --git a/src/main/resources/assets/sophisticatedbackpacks/lang/zh_cn.json b/src/main/resources/assets/sophisticatedbackpacks/lang/zh_cn.json index a2b3bd4b..ffd587be 100644 --- a/src/main/resources/assets/sophisticatedbackpacks/lang/zh_cn.json +++ b/src/main/resources/assets/sophisticatedbackpacks/lang/zh_cn.json @@ -27,10 +27,10 @@ "item.sophisticatedbackpacks.feeding_upgrade.tooltip": "将背包内的食物喂给玩家", "item.sophisticatedbackpacks.advanced_feeding_upgrade": "高级喂食升级", "item.sophisticatedbackpacks.advanced_feeding_upgrade.tooltip": "将背包内的食物喂给玩家\n更多喂食条件选项", - "item.sophisticatedbackpacks.compacting_upgrade": "压缩升级", - "item.sophisticatedbackpacks.compacting_upgrade.tooltip": "将物品压缩为对应的压缩变体\n仅2x2配方", - "item.sophisticatedbackpacks.advanced_compacting_upgrade": "高级压缩升级", - "item.sophisticatedbackpacks.advanced_compacting_upgrade.tooltip": "将物品压缩为对应的压缩变体\n包括2x2,3x3配方以及更多的过滤选项", + "item.sophisticatedbackpacks.compacting_upgrade": "压制升级", + "item.sophisticatedbackpacks.compacting_upgrade.tooltip": "将物品压制为对应的压缩变体\n仅2x2配方", + "item.sophisticatedbackpacks.advanced_compacting_upgrade": "高级压制升级", + "item.sophisticatedbackpacks.advanced_compacting_upgrade.tooltip": "将物品压制为对应的压缩变体\n包括2x2,3x3配方以及更多的过滤选项", "item.sophisticatedbackpacks.void_upgrade": "虚空升级", "item.sophisticatedbackpacks.void_upgrade.tooltip": "销毁过滤器中选定的物品", "item.sophisticatedbackpacks.advanced_void_upgrade": "高级虚空升级",