mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Remove addListener from ColorHandlersImpl
This commit is contained in:
@@ -40,19 +40,22 @@ public class ColorHandlersImpl {
|
||||
|
||||
static {
|
||||
EventBuses.onRegistered(ArchitecturyForge.MOD_ID, bus -> {
|
||||
bus.<ColorHandlerEvent.Item>addListener(event -> {
|
||||
for (Pair<ItemColor, Supplier<ItemLike>[]> pair : ITEM_COLORS) {
|
||||
event.getItemColors().register(pair.getLeft(), unpackItems(pair.getRight()));
|
||||
}
|
||||
});
|
||||
bus.<ColorHandlerEvent.Block>addListener(event -> {
|
||||
for (Pair<BlockColor, Supplier<Block>[]> pair : BLOCK_COLORS) {
|
||||
event.getBlockColors().register(pair.getLeft(), unpackBlocks(pair.getRight()));
|
||||
}
|
||||
});
|
||||
bus.register(ColorHandlersImpl.class);
|
||||
});
|
||||
}
|
||||
|
||||
public static void onItemColorEvent(ColorHandlerEvent.Item event) {
|
||||
for (Pair<ItemColor, Supplier<ItemLike>[]> pair : ITEM_COLORS) {
|
||||
event.getItemColors().register(pair.getLeft(), unpackItems(pair.getRight()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void onBlockColorEvent(ColorHandlerEvent.Block event) {
|
||||
for (Pair<BlockColor, Supplier<Block>[]> pair : BLOCK_COLORS) {
|
||||
event.getBlockColors().register(pair.getLeft(), unpackBlocks(pair.getRight()));
|
||||
}
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static void registerItemColors(ItemColor itemColor, Supplier<ItemLike>... items) {
|
||||
Objects.requireNonNull(itemColor, "color is null!");
|
||||
|
||||
Reference in New Issue
Block a user