use of WayofTime.bloodmagic.alchemyArray.AlchemyCircleRenderer in project BloodMagic by WayofTime.
the class RenderAlchemyArray method render.
@Override
public void render(TileAlchemyArray alchemyArray, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
ItemStack inputStack = alchemyArray.getStackInSlot(0);
ItemStack catalystStack = alchemyArray.getStackInSlot(1);
int craftTime = alchemyArray.activeCounter;
AlchemyCircleRenderer renderer = AlchemyArrayRecipeRegistry.getAlchemyCircleRenderer(inputStack, catalystStack);
if (renderer == AlchemyArrayRecipeRegistry.DEFAULT_RENDERER) {
RecipeAlchemyArray recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyArray(inputStack, catalystStack);
if (recipe != null)
renderer = new AlchemyCircleRenderer(recipe.getCircleTexture());
}
renderer.renderAt(alchemyArray, x, y, z, (craftTime > 0 ? craftTime + partialTicks : 0));
}
use of WayofTime.bloodmagic.alchemyArray.AlchemyCircleRenderer in project BloodMagic by WayofTime.
the class AlchemyArrayRecipeRegistry method registerRecipe.
public static void registerRecipe(ItemStack inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) {
AlchemyCircleRenderer circleRenderer = arrayResource == null ? DEFAULT_RENDERER : new AlchemyCircleRenderer(arrayResource);
registerRecipe(Collections.singletonList(inputStacks), catalystStack, arrayEffect, circleRenderer);
}
use of WayofTime.bloodmagic.alchemyArray.AlchemyCircleRenderer in project BloodMagic by WayofTime.
the class BookUtils method getAlchemyPage.
public static PageAlchemyArray getAlchemyPage(String key) {
ItemStack[] recipe = AlchemyArrayRecipeRegistry.getRecipeForArrayEffect(key);
if (recipe[0] != null) {
ItemStack inputStack = recipe[0];
ItemStack catalystStack = recipe[1];
AlchemyCircleRenderer renderer = AlchemyArrayRecipeRegistry.getAlchemyCircleRenderer(inputStack, catalystStack);
if (renderer instanceof DualAlchemyCircleRenderer) {
List<ResourceLocation> resources = new ArrayList<>();
resources.add(((DualAlchemyCircleRenderer) renderer).arrayResource);
resources.add(((DualAlchemyCircleRenderer) renderer).secondaryArrayResource);
return new PageAlchemyArray(resources, inputStack, catalystStack);
} else {
return new PageAlchemyArray(renderer.arrayResource, inputStack, catalystStack);
}
}
return null;
}
use of WayofTime.bloodmagic.alchemyArray.AlchemyCircleRenderer in project BloodMagic by WayofTime.
the class BookUtils method getAlchemyPage.
public static PageAlchemyArray getAlchemyPage(ItemStack outputStack) {
ItemStack[] recipe = AlchemyArrayRecipeRegistry.getRecipeForOutputStack(outputStack);
if (recipe[0] != null) {
ItemStack inputStack = recipe[0];
ItemStack catalystStack = recipe[1];
AlchemyCircleRenderer renderer = AlchemyArrayRecipeRegistry.getAlchemyCircleRenderer(inputStack, catalystStack);
if (renderer != null) {
if (renderer instanceof DualAlchemyCircleRenderer) {
List<ResourceLocation> resources = new ArrayList<>();
resources.add(((DualAlchemyCircleRenderer) renderer).arrayResource);
resources.add(((DualAlchemyCircleRenderer) renderer).secondaryArrayResource);
return new PageAlchemyArray(resources, inputStack, catalystStack, outputStack);
} else {
return new PageAlchemyArray(renderer.arrayResource, inputStack, catalystStack, outputStack);
}
}
}
return null;
}
use of WayofTime.bloodmagic.alchemyArray.AlchemyCircleRenderer in project BloodMagic by WayofTime.
the class AlchemyArrayRecipeRegistry method registerRecipe.
public static void registerRecipe(List<ItemStack> inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) {
AlchemyCircleRenderer circleRenderer = arrayResource == null ? DEFAULT_RENDERER : new AlchemyCircleRenderer(arrayResource);
registerRecipe(inputStacks, catalystStack, arrayEffect, circleRenderer);
}
Aggregations