Skip to content

Commit

Permalink
Merge pull request #876 from P3pp3rF1y/1.20.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 bd53c88 + 155f9cc commit ef9576c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ tasks.withType(ProcessResources).configureEach {
loader_version_range: loader_version_range,
mod_id : mod_id, mod_version: mod_version,
mod_full_version : "${project.mod_version}.${getBuildNumber()}${getStable()}",
sc_version : sc_version.substring(sc_version.indexOf("-") + 1, sc_version.lastIndexOf('.'))
sc_version : sc_version.substring(sc_version.indexOf("-") + 1, sc_version.lastIndexOf(',')) + ".+"
]
inputs.properties replaceProperties

Expand All @@ -155,7 +155,7 @@ static def getBuildNumber() {
}

static def getStable() {
if ((System.getenv("GITHUB_REF") == null || System.getenv("GITHUB_REF").endsWith("-dev"))) {
if (System.getenv("GITHUB_REF") == null || System.getenv("GITHUB_REF").endsWith("-dev")) {
return "-SNAPSHOT"
}
return ""
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false

mod_id=sophisticatedbackpacks
mod_group_id=sophisticatedbackpacks
mod_version=3.18.59
mod_version=3.18.65
sonar_project_key=sophisticatedbackpacks:SophisticatedBackpacks
github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedBackpacks

Expand All @@ -22,5 +22,5 @@ botania_version=1.19.2-439-FORGE-SNAPSHOT
patchouli_version=1.19.2-78-SNAPSHOT
balm_cf_file_id=4597440
crafting_tweaks_cf_file_id=4596466
sc_version=1.20.1-0.5.82.+
sc_version=[1.20.1-0.5.99,1.21)
parchment_version=1.19.3-2023.03.12-1.20
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 @@ -62,6 +62,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 @@ -112,7 +113,7 @@ public BlockEntityWithoutLevelRenderer getCustomRenderer() {
public void addCreativeTabItems(Consumer<ItemStack> itemConsumer) {
super.addCreativeTabItems(itemConsumer);

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

Expand Down Expand Up @@ -391,8 +392,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 @@ -132,7 +132,7 @@ private void updateTargetSlotTooltip(int mouseX, int mouseY) {
private void renderTargetSlotAcronyms(GuiGraphics guiGraphics) {
PoseStack poseStack = guiGraphics.pose();
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mod": "rats",
"entity_tools": [
{
"rats:rat": [
"rats:tamed_rat": [
"rats:cheese_stick",
"rats:patrol_stick",
"rats:radius_stick"
Expand Down

0 comments on commit ef9576c

Please sign in to comment.