Skip to content

Commit

Permalink
0.4.1: Stop potential NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
3TUSK committed Aug 19, 2023
1 parent c64ad61 commit 40c8667
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(17)
// definitions at gradle/teacon-forge.gradle
teacon {
modId = 'xkdeco'
modVersion = '0.4.0'
modVersion = '0.4.1'
modLicense = 'BSD-3-Clause'
modGitHubRepo = 'teaconmc/XKDeco'
modAuthors = ['xekr (XeKr)', 'ustc-zzzz', 'LucunJi']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public void load(@NotNull CompoundTag pTag) {
this.item = ItemStack.of(pTag.getCompound(ITEMSTACK_NBT_KEY));
}
if (pTag.contains(BLOCKSTATE_NBT_KEY)) {
var lookup = this.level != null ? this.level.holderLookup(Registries.BLOCK) : BuiltInRegistries.BLOCK.asLookup();
var level = this.level;
var lookup = level != null ? level.holderLookup(Registries.BLOCK) : BuiltInRegistries.BLOCK.asLookup();
this.blockState = NbtUtils.readBlockState(lookup, pTag.getCompound(BLOCKSTATE_NBT_KEY));
}
if (pTag.contains(SELECTED_PROPERTY_NBT_KEY)) {
Expand Down

0 comments on commit 40c8667

Please sign in to comment.