Skip to content

Commit

Permalink
Merge pull request #875 from P3pp3rF1y/1.19.x-dev
Browse files Browse the repository at this point in the history
Release merge
  • Loading branch information
P3pp3rF1y authored Oct 20, 2023
2 parents 76137c5 + 2fec745 commit 0eb888d
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 17 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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}")
Expand Down
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.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.+
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -114,7 +115,7 @@ public BlockEntityWithoutLevelRenderer getCustomRenderer() {
public void fillItemCategory(CreativeModeTab group, NonNullList<ItemStack> 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;
}

Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
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.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "高级虚空升级",
Expand Down

0 comments on commit 0eb888d

Please sign in to comment.