Skip to content

Commit 4ea0470

Browse files
authored
Merge pull request #326 from gottsch/1.18.2-develop
fixes
2 parents 76fc72a + ca456ac commit 4ea0470

File tree

6 files changed

+37
-13
lines changed

6 files changed

+37
-13
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.1.2] - 2023-07-13
9+
10+
### Changed
11+
12+
- Updated AbstractTreasureChestBlockEntity to use the sided call to CapabilityProvider#getCapability().
13+
This fixes the Jade crash issue.
14+
815
## [3.1.1] - 2023-07-11
916

1017
### Changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ dependencies {
187187
compileOnly fg.deobf("someguyssoftware.gottschcore:GottschCore:mc1.18.2-f40.1.0-v2.1.0")
188188

189189
//compileOnly fg.deobf("curse.maven:champions-307152:${cf_champions}")
190-
//compileOnly fg.deobf("curse.maven:jade-324717:4082408")
190+
compileOnly fg.deobf("curse.maven:jade-324717:4575623") // jade 1.18.2
191191
compileOnly fg.deobf("curse.maven:compass-coords-368398:3765883")
192192

193193
// implementation files(gottschcore_path)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package_group=gottsch
88
# use alpha, beta, or v (for version)
99
mod_version_type=
1010

11-
mod_version=3.1.1
11+
mod_version=3.1.2
1212

1313
#versions
1414
mc_version=1.18.2

src/main/java/mod/gottsch/forge/treasure2/core/block/entity/AbstractTreasureChestBlockEntity.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import javax.annotation.Nonnull;
2626
import javax.annotation.Nullable;
2727

28+
import org.jetbrains.annotations.NotNull;
29+
2830
import mod.gottsch.forge.gottschcore.enums.IRarity;
2931
import mod.gottsch.forge.treasure2.Treasure;
3032
import mod.gottsch.forge.treasure2.api.TreasureApi;
@@ -208,19 +210,33 @@ protected void onContentsChanged(int slot) {
208210

209211
@Override
210212
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
211-
// TODO add check for locked property and return false is enabled
212-
// return ForgeHooks.getBurnTime(stack, RecipeType.SMELTING) > 0;
213-
return true;
213+
return !isLocked();
214214
}
215215

216216
@Nonnull
217217
@Override
218218
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
219-
// if (ForgeHooks.getBurnTime(stack, RecipeType.SMELTING) <= 0) {
220-
// return stack;
221-
// }
219+
if (isLocked()) {
220+
return ItemStack.EMPTY;
221+
}
222222
return super.insertItem(slot, stack, simulate);
223223
}
224+
225+
@Override
226+
public @NotNull ItemStack getStackInSlot(int slot) {
227+
if (isLocked()) {
228+
return ItemStack.EMPTY;
229+
}
230+
return super.getStackInSlot(slot);
231+
}
232+
233+
@Override
234+
public void setStackInSlot(int slot, @NotNull ItemStack stack) {
235+
if (isLocked()) {
236+
return;
237+
}
238+
super.setStackInSlot(slot, stack);
239+
}
224240
};
225241
}
226242

@@ -229,7 +245,7 @@ public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
229245
if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
230246
return instanceHandler.cast();
231247
}
232-
return super.getCapability(cap);
248+
return super.getCapability(cap, side);
233249
}
234250

235251
/**

src/main/resources/META-INF/mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ issueTrackerURL="https://github.com/gottsch/gottsch-minecraft-Treasure/issues" #
1717
modId="treasure2" #mandatory
1818

1919
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
20-
version="3.1.1" #mandatory
20+
version="3.1.2" #mandatory
2121

2222
# A display name for the mod
2323
displayName="Treasure2" #mandatory

update.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"homepage": "https://minecraft.curseforge.com/projects/treasure2",
33
"promos": {
4-
"1.18.2-latest": "3.1.1",
5-
"1.18.2-recommended": "3.1.1"
4+
"1.18.2-latest": "3.1.2",
5+
"1.18.2-recommended": "3.1.2"
66
},
77
"1.18.2": {
88
"3.0.0": "Initial port from 1.16.5. See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md",
99
"3.1.0": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md",
10-
"3.1.1": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md"
10+
"3.1.1": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md",
11+
"3.1.2": "See https://raw.githubusercontent.com/gottsch/gottsch-minecraft-Treasure/1.18.2-master/CHANGELOG.md"
1112
}
1213
}

0 commit comments

Comments
 (0)