Skip to content

Commit 8822d55

Browse files
authored
Impl Block#getItem for BlockPipe (#2852)
1 parent 7b0d46d commit 8822d55

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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", "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)