use of com.teamresourceful.resourcefulbees.api.beedata.HoneycombData in project ResourcefulBees by Resourceful-Bees.
the class ColorHandler method onItemColors.
public static void onItemColors(ColorHandlerEvent.Item event) {
ItemColors colors = event.getItemColors();
BEE_REGISTRY.getBees().forEach(((s, beeData) -> {
HoneycombData honeycombData = beeData.getHoneycombData();
if (honeycombData.getHoneycombType().equals(HoneycombType.DEFAULT) && !honeycombData.getColor().isDefault()) {
registerItems(colors, HoneycombItem::getColor, BeeInfoUtils.getItem(ResourcefulBees.MOD_ID + ":" + s + "_honeycomb"));
registerItems(colors, HoneycombBlock::getItemColor, BeeInfoUtils.getItem(ResourcefulBees.MOD_ID + ":" + s + "_honeycomb_block"));
}
if (!beeData.getRenderData().getColorData().getSpawnEggPrimaryColor().isDefault() && !beeData.getRenderData().getColorData().getSpawnEggSecondaryColor().isDefault()) {
registerItems(colors, BeeSpawnEggItem::getColor, BeeInfoUtils.getItem(ResourcefulBees.MOD_ID + ":" + s + "_bee_spawn_egg"));
}
}));
HoneyRegistry.getRegistry().getHoneyBottles().forEach((h, honeyData) -> {
registerItems(colors, CustomHoneyBottleItem::getColor, honeyData.getHoneyBottleRegistryObject().get());
if (Config.HONEY_GENERATE_BLOCKS.get() && honeyData.doGenerateHoneyBlock()) {
registerItems(colors, CustomHoneyBlock::getItemColor, honeyData.getHoneyBlockItemRegistryObject().get());
}
if (Config.HONEY_GENERATE_FLUIDS.get() && honeyData.doGenerateHoneyFluid()) {
registerItems(colors, CustomHoneyBucketItem::getColor, honeyData.getHoneyBucketItemRegistryObject().get());
}
});
registerItems(colors, BeeJar::getColor, ModItems.BEE_JAR.get());
}
use of com.teamresourceful.resourcefulbees.api.beedata.HoneycombData in project ResourcefulBees by Resourceful-Bees.
the class RecipeBuilder method onResourceManagerReload.
@Override
public void onResourceManagerReload(@NotNull ResourceManager resourceManager) {
LOGGER.info("Loading comb recipes for {} bees...", BEE_REGISTRY.getBees().size());
BEE_REGISTRY.getBees().forEach((s, beeData) -> {
CentrifugeData centrifugeData = beeData.getCentrifugeData();
HoneycombData honeycombData = beeData.getHoneycombData();
if (centrifugeData.hasCentrifugeOutput() && honeycombData.getHoneycombType().equals(HoneycombType.DEFAULT)) {
Recipe<?> honeycombCentrifuge = this.centrifugeRecipe(s, centrifugeData, honeycombData, 1);
Recipe<?> honeycombBlockCentrifuge = this.centrifugeRecipe(s, centrifugeData, honeycombData, 9);
getRecipeManager().recipes.computeIfAbsent(honeycombCentrifuge.getType(), t -> new HashMap<>()).put(honeycombCentrifuge.getId(), honeycombCentrifuge);
getRecipeManager().recipes.computeIfAbsent(honeycombBlockCentrifuge.getType(), t -> new HashMap<>()).put(honeycombBlockCentrifuge.getId(), honeycombBlockCentrifuge);
}
if (Config.HONEYCOMB_BLOCK_RECIPES.get() && honeycombData.getHoneycombType().equals(HoneycombType.DEFAULT)) {
Recipe<?> honeycombBlock = this.makeHoneycombRecipe(s, honeycombData);
Recipe<?> honeycomb = this.combBlockToCombRecipe(s, honeycombData);
getRecipeManager().recipes.computeIfAbsent(honeycombBlock.getType(), t -> new HashMap<>()).put(honeycombBlock.getId(), honeycombBlock);
getRecipeManager().recipes.computeIfAbsent(honeycomb.getType(), t -> new HashMap<>()).put(honeycomb.getId(), honeycomb);
}
});
if (Config.HONEY_BLOCK_RECIPES.get() && Config.HONEY_GENERATE_BLOCKS.get()) {
HoneyRegistry.getRegistry().getHoneyBottles().forEach((s, honeyData) -> {
if (honeyData.doGenerateHoneyBlock() && honeyData.doHoneyBlockRecipe()) {
Recipe<?> honeyBlock = this.makeHoneyBlockRecipe(honeyData);
Recipe<?> honeyBottle = this.makeHoneyBottleRecipe(honeyData);
Recipe<?> bottleToBucket = this.makeBottleToBucketRecipe(honeyData);
Recipe<?> bucketToBottle = this.makeBucketToBottleRecipe(honeyData);
Recipe<?> blockToBucket = this.makeBlockToBucketRecipe(honeyData);
Recipe<?> bucketToBlock = this.makeBucketToBlockRecipe(honeyData);
getBottleRecipes(honeyBlock, honeyBottle, bottleToBucket);
getBottleRecipes(bucketToBottle, blockToBucket, bucketToBlock);
}
});
}
}
use of com.teamresourceful.resourcefulbees.api.beedata.HoneycombData in project ResourcefulBees by Resourceful-Bees.
the class RegistryHandler method registerDynamicBees.
public static void registerDynamicBees() {
BeeRegistry.getRegistry().getBees().forEach((name, beeData) -> {
HoneycombData honeyData = beeData.getHoneycombData();
if (honeyData.getHoneycombType().equals(HoneycombType.DEFAULT)) {
registerHoneycomb(name, honeyData);
}
registerBee(name, beeData.getRenderData().getSizeModifier());
});
}
use of com.teamresourceful.resourcefulbees.api.beedata.HoneycombData in project ResourcefulBees by Resourceful-Bees.
the class ColorHandler method onBlockColors.
public static void onBlockColors(ColorHandlerEvent.Block event) {
BlockColors colors = event.getBlockColors();
BEE_REGISTRY.getBees().forEach(((s, beeData) -> {
HoneycombData honeycombData = beeData.getHoneycombData();
if (honeycombData.getHoneycombType().equals(HoneycombType.DEFAULT) && (!honeycombData.getColor().isDefault())) {
registerBlocks(colors, HoneycombBlock::getBlockColor, BeeInfoUtils.getBlock(ResourcefulBees.MOD_ID + ":" + s + "_honeycomb_block"));
}
}));
HoneyRegistry.getRegistry().getHoneyBottles().forEach((h, honeyData) -> {
if (Config.HONEY_GENERATE_BLOCKS.get() && honeyData.doGenerateHoneyBlock()) {
registerBlocks(colors, CustomHoneyBlock::getBlockColor, honeyData.getHoneyBlockRegistryObject().get());
}
});
}
Aggregations