Search in sources :

Example 1 with EntityModelFX

use of logisticspipes.pipefxhandlers.EntityModelFX in project LogisticsPipes by RS485.

the class LogisticsNewRenderPipe method renderDestruction.

public static void renderDestruction(CoreUnroutedPipe pipe, World worldObj, int x, int y, int z, EffectRenderer effectRenderer) {
    if (pipe.container != null && pipe.container.renderState != null && pipe.container.renderState.cachedRenderer != null) {
        for (RenderEntry entry : pipe.container.renderState.cachedRenderer) {
            IModel3D model = entry.getModel().twoFacedCopy();
            IBounds bounds = model.bounds();
            double xMid = (bounds.min().x() + bounds.max().x()) / 2;
            double yMid = (bounds.min().y() + bounds.max().y()) / 2;
            double zMid = (bounds.min().z() + bounds.max().z()) / 2;
            model.apply(new LPTranslation(-xMid, -yMid, -zMid));
            effectRenderer.addEffect(new EntityModelFX(worldObj, x + xMid, y + yMid, z + zMid, model, entry.getOperations(), entry.getTexture()));
        }
    }
}
Also used : IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) IBounds(logisticspipes.proxy.object3d.interfaces.IBounds) EntityModelFX(logisticspipes.pipefxhandlers.EntityModelFX)

Example 2 with EntityModelFX

use of logisticspipes.pipefxhandlers.EntityModelFX in project LogisticsPipes by RS485.

the class LogisticsNewRenderPipe method renderDestruction.

@SideOnly(Side.CLIENT)
public static void renderDestruction(CoreUnroutedPipe pipe, World world, int x, int y, int z, ParticleManager effectRenderer) {
    if (pipe.container != null && pipe.container.renderState != null && pipe.container.renderState.cachedRenderer != null) {
        for (RenderEntry entry : pipe.container.renderState.cachedRenderer) {
            IModel3D model = entry.getModel().twoFacedCopy();
            IBounds bounds = model.bounds();
            double xMid = (bounds.min().x() + bounds.max().x()) / 2;
            double yMid = (bounds.min().y() + bounds.max().y()) / 2;
            double zMid = (bounds.min().z() + bounds.max().z()) / 2;
            model.apply(new LPTranslation(-xMid, -yMid, -zMid));
            effectRenderer.addEffect(new EntityModelFX(world, x + xMid, y + yMid, z + zMid, model, entry.getOperations(), entry.getTexture()));
        }
    }
}
Also used : LPTranslation(logisticspipes.proxy.object3d.operation.LPTranslation) IModel3D(logisticspipes.proxy.object3d.interfaces.IModel3D) IBounds(logisticspipes.proxy.object3d.interfaces.IBounds) EntityModelFX(logisticspipes.pipefxhandlers.EntityModelFX) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

EntityModelFX (logisticspipes.pipefxhandlers.EntityModelFX)2 IBounds (logisticspipes.proxy.object3d.interfaces.IBounds)2 IModel3D (logisticspipes.proxy.object3d.interfaces.IModel3D)2 LPTranslation (logisticspipes.proxy.object3d.operation.LPTranslation)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1