diff --git a/CHANGELOG.md b/CHANGELOG.md index 288e82f39..8132f1725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.2] - 2023-07-13 + +### Changed + +- Updated AbstractTreasureChestBlockEntity to use the sided call to CapabilityProvider#getCapability(). + This fixes the Jade crash issue. + ## [3.1.1] - 2023-07-11 ### Changed diff --git a/build.gradle b/build.gradle index 8c5672161..945607d9b 100644 --- a/build.gradle +++ b/build.gradle @@ -187,7 +187,7 @@ dependencies { compileOnly fg.deobf("someguyssoftware.gottschcore:GottschCore:mc1.18.2-f40.1.0-v2.1.0") //compileOnly fg.deobf("curse.maven:champions-307152:${cf_champions}") - //compileOnly fg.deobf("curse.maven:jade-324717:4082408") + compileOnly fg.deobf("curse.maven:jade-324717:4575623") // jade 1.18.2 compileOnly fg.deobf("curse.maven:compass-coords-368398:3765883") // implementation files(gottschcore_path) diff --git a/gradle.properties b/gradle.properties index 35c6bc5f3..b7d8acbb2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ package_group=gottsch # use alpha, beta, or v (for version) mod_version_type= -mod_version=3.1.1 +mod_version=3.1.2 #versions mc_version=1.18.2 diff --git a/src/main/java/mod/gottsch/forge/treasure2/core/block/entity/AbstractTreasureChestBlockEntity.java b/src/main/java/mod/gottsch/forge/treasure2/core/block/entity/AbstractTreasureChestBlockEntity.java index 49a94d24a..7bf44c9b1 100644 --- a/src/main/java/mod/gottsch/forge/treasure2/core/block/entity/AbstractTreasureChestBlockEntity.java +++ b/src/main/java/mod/gottsch/forge/treasure2/core/block/entity/AbstractTreasureChestBlockEntity.java @@ -25,6 +25,8 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.jetbrains.annotations.NotNull; + import mod.gottsch.forge.gottschcore.enums.IRarity; import mod.gottsch.forge.treasure2.Treasure; import mod.gottsch.forge.treasure2.api.TreasureApi; @@ -208,19 +210,33 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - // TODO add check for locked property and return false is enabled - // return ForgeHooks.getBurnTime(stack, RecipeType.SMELTING) > 0; - return true; + return !isLocked(); } @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - // if (ForgeHooks.getBurnTime(stack, RecipeType.SMELTING) <= 0) { - // return stack; - // } + if (isLocked()) { + return ItemStack.EMPTY; + } return super.insertItem(slot, stack, simulate); } + + @Override + public @NotNull ItemStack getStackInSlot(int slot) { + if (isLocked()) { + return ItemStack.EMPTY; + } + return super.getStackInSlot(slot); + } + + @Override + public void setStackInSlot(int slot, @NotNull ItemStack stack) { + if (isLocked()) { + return; + } + super.setStackInSlot(slot, stack); + } }; } @@ -229,7 +245,7 @@ public LazyOptional getCapability(Capability cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return instanceHandler.cast(); } - return super.getCapability(cap); + return super.getCapability(cap, side); } /** diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 4a5b042ba..2f2b8eb74 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -17,7 +17,7 @@ issueTrackerURL="https://github.com/gottsch/gottsch-minecraft-Treasure/issues" # modId="treasure2" #mandatory # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it -version="3.1.1" #mandatory +version="3.1.2" #mandatory # A display name for the mod displayName="Treasure2" #mandatory diff --git a/update.json b/update.json index 0f2a31253..90223e3a3 100644 --- a/update.json +++ b/update.json @@ -1,12 +1,13 @@ { "homepage": "https://minecraft.curseforge.com/projects/treasure2", "promos": { - "1.18.2-latest": "3.1.1", - "1.18.2-recommended": "3.1.1" + "1.18.2-latest": "3.1.2", + "1.18.2-recommended": "3.1.2" }, "1.18.2": { "3.0.0": "Initial port from 1.16.5. See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md", "3.1.0": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md", - "3.1.1": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md" + "3.1.1": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md", + "3.1.2": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md" } } \ No newline at end of file