Search in sources :

Example 1 with LogisticsPipeItemRenderer

use of logisticspipes.renderer.LogisticsPipeItemRenderer in project LogisticsPipes by RS485.

the class LogisticsPipes method createPipe.

protected Item createPipe(Class<? extends CoreUnroutedPipe> clas, String descr, Side side) {
    final ItemLogisticsPipe res = LogisticsBlockGenericPipe.registerPipe(clas);
    res.setCreativeTab(LogisticsPipes.LPCreativeTab);
    res.setUnlocalizedName(clas.getSimpleName());
    final CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.createPipe(res);
    if (pipe instanceof CoreRoutedPipe) {
        postInitRun.add(() -> res.setPipeIconIndex(((CoreRoutedPipe) pipe).getTextureType(ForgeDirection.UNKNOWN).normal, ((CoreRoutedPipe) pipe).getTextureType(ForgeDirection.UNKNOWN).newTexture));
    }
    if (side.isClient()) {
        if (pipe instanceof PipeBlockRequestTable) {
            MinecraftForgeClient.registerItemRenderer(res, new LogisticsPipeItemRenderer(true));
        } else {
            MinecraftForgeClient.registerItemRenderer(res, MainProxy.proxy.getPipeItemRenderer());
        }
    }
    if (clas != PipeItemsBasicLogistics.class && CoreRoutedPipe.class.isAssignableFrom(clas)) {
        if (clas != PipeFluidBasic.class && PipeFluidBasic.class.isAssignableFrom(clas)) {
            registerShapelessResetRecipe(res, 0, LogisticsPipes.LogisticsFluidBasicPipe, 0);
        } else {
            registerShapelessResetRecipe(res, 0, LogisticsPipes.LogisticsBasicPipe, 0);
        }
    }
    return res;
}
Also used : CoreUnroutedPipe(logisticspipes.pipes.basic.CoreUnroutedPipe) PipeBlockRequestTable(logisticspipes.pipes.PipeBlockRequestTable) PipeItemsBasicLogistics(logisticspipes.pipes.PipeItemsBasicLogistics) ItemLogisticsPipe(logisticspipes.items.ItemLogisticsPipe) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) PipeFluidBasic(logisticspipes.pipes.PipeFluidBasic) LogisticsPipeItemRenderer(logisticspipes.renderer.LogisticsPipeItemRenderer)

Aggregations

ItemLogisticsPipe (logisticspipes.items.ItemLogisticsPipe)1 PipeBlockRequestTable (logisticspipes.pipes.PipeBlockRequestTable)1 PipeFluidBasic (logisticspipes.pipes.PipeFluidBasic)1 PipeItemsBasicLogistics (logisticspipes.pipes.PipeItemsBasicLogistics)1 CoreRoutedPipe (logisticspipes.pipes.basic.CoreRoutedPipe)1 CoreUnroutedPipe (logisticspipes.pipes.basic.CoreUnroutedPipe)1 LogisticsPipeItemRenderer (logisticspipes.renderer.LogisticsPipeItemRenderer)1