|
40 | 40 | import net.minecraftforge.common.Tags; |
41 | 41 | import net.minecraftforge.common.util.TriPredicate; |
42 | 42 |
|
| 43 | +import appeng.api.implementations.blockentities.IColorableBlockEntity; |
43 | 44 | import appeng.api.util.AEColor; |
44 | 45 | import appeng.blockentity.networking.CableBusBlockEntity; |
45 | 46 | import com.google.common.collect.ImmutableMap; |
@@ -204,8 +205,13 @@ private boolean handleSpecialBlockEntities(BlockEntity first, int limit, UseOnCo |
204 | 205 | if (player == null) { |
205 | 206 | return false; |
206 | 207 | } |
207 | | - if (GTCEu.Mods.isAE2Loaded() && AE2CallWrapper.isAE2Cable(first)) { |
208 | | - var collected = AE2CallWrapper.collect(first, limit); |
| 208 | + if (GTCEu.Mods.isAE2Loaded() && AE2CallWrapper.isColorable(first)) { |
| 209 | + Set<? extends IColorableBlockEntity> collected; |
| 210 | + if (first instanceof CableBusBlockEntity) { |
| 211 | + collected = AE2CallWrapper.collect(first, limit); |
| 212 | + } else { |
| 213 | + collected = Set.of((IColorableBlockEntity) first); |
| 214 | + } |
209 | 215 | var ae2Color = color == null ? AEColor.TRANSPARENT : AEColor.values()[color.ordinal()]; |
210 | 216 | for (var c : collected) { |
211 | 217 | if (c.getColor() == ae2Color) { |
@@ -479,8 +485,8 @@ static Set<CableBusBlockEntity> collect(BlockEntity first, int limit) { |
479 | 485 | limit, limit * 6); |
480 | 486 | } |
481 | 487 |
|
482 | | - static boolean isAE2Cable(BlockEntity be) { |
483 | | - return be instanceof CableBusBlockEntity; |
| 488 | + static boolean isColorable(BlockEntity be) { |
| 489 | + return be instanceof IColorableBlockEntity; |
484 | 490 | } |
485 | 491 |
|
486 | 492 | static boolean ae2CablePredicate(CableBusBlockEntity parent, CableBusBlockEntity child, Direction direction) { |
|
0 commit comments