Skip to content

Commit dbda8e9

Browse files
committed
fix: impl Block#getItem for BlockPipe
1 parent 92acc6a commit dbda8e9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/java/gregtech/api/pipenet/block/BlockPipe.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ public static Cuboid6 getCoverSideBox(EnumFacing side, float thickness) {
134134

135135
public abstract ItemStack getDropItem(IPipeTile<PipeType, NodeDataType> pipeTile);
136136

137+
@NotNull
138+
@Override
139+
@SuppressWarnings({ "deprecation", "rawtypes", "unchecked" })
140+
public ItemStack getItem(@NotNull World world, @NotNull BlockPos pos, @NotNull IBlockState state) {
141+
var te = world.getTileEntity(pos);
142+
if (!(te instanceof IPipeTile pipeTile)) return ItemStack.EMPTY;
143+
return getDropItem((IPipeTile<PipeType, NodeDataType>) pipeTile);
144+
}
145+
137146
protected abstract NodeDataType getFallbackType();
138147

139148
// TODO this has no reason to need an ItemStack parameter

0 commit comments

Comments
 (0)