Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release merge #874

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}:api")
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.18.2
forge_version=40.1.30
mod_version=3.18.60
mod_version=3.18.65
jei_mc_version=1.18.2
jei_version=9.7.0+
curios_version=1.18.2-5.0.6.+
botania_version=1.18.2-430-SNAPSHOT
patchouli_version=1.18.2-66
balm_cf_file_id=3914491
sc_cf_file_id=4566111
sc_version=1.18.2-0.5.97.+
crafting_tweaks_cf_file_id=3584842
parchment_version=1.18.1-2022.03.06-1.18.2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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 @@ -146,7 +147,7 @@ public <T> LazyOptional<T> getCapability(Capability<T> cap, @Nullable Direction

if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
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 == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,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 @@ -118,7 +119,7 @@ public BlockEntityWithoutLevelRenderer getItemStackRenderer() {
public void fillItemCategory(CreativeModeTab group, NonNullList<ItemStack> items) {
super.fillItemCategory(group, items);

if (!allowdedIn(group) || this != ModItems.BACKPACK.get() || !net.p3pp3rf1y.sophisticatedcore.Config.SERVER.enabledItems.isItemEnabled(this)) {
if (!allowdedIn(group) || this != ModItems.BACKPACK.get() || !net.p3pp3rf1y.sophisticatedcore.Config.COMMON.enabledItems.isItemEnabled(this)) {
return;
}

Expand Down Expand Up @@ -397,8 +398,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.18.2-0.5.61,)" #mandatory
versionRange="[1.18.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
Loading