Skip to content

Commit

Permalink
fix compressed chest (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: mul <1040179812@qq.com>
  • Loading branch information
nutant233 and nutant233 authored Oct 20, 2024
1 parent 209c30e commit cff01b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"avaritia:compressed_chest"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public void onPlace(@NotNull BlockState pState, Level pLevel, @NotNull BlockPos
Container container = (Container) blockentity;
for (String index : nameTag.getAllKeys()) {
var name = nameTag.getString(index);
var count = countTag.getInt(index);
var nbt = nbtTag.getCompound(index);
var newItem = ForgeRegistries.ITEMS.getValue(new ResourceLocation(name));
if (newItem == null) continue;
ItemStack is = new ItemStack(newItem);
is.setCount(count);
is.setTag(nbt);
is.setCount(countTag.getInt(index));
if (nbtTag != null && !nbtTag.getCompound(index).isEmpty()) {
is.setTag(nbtTag.getCompound(index));
}
container.setItem(Integer.parseInt(index), is);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected void addTags(HolderLookup.@NotNull Provider pProvider) {
ModBlocks.denser_neutron_collector.get(), ModBlocks.densest_neutron_collector.get(),
ModBlocks.neutron_compressor.get()
);
tag(BlockTags.MINEABLE_WITH_AXE).add(ModBlocks.compressed_chest.get());
tag(BlockTags.MINEABLE_WITH_SHOVEL).add(ModBlocks.endless_cake.get());
tag(BlockTags.BEACON_BASE_BLOCKS).add(
ModBlocks.crystal_matrix.get(),
Expand Down

0 comments on commit cff01b4

Please sign in to comment.