Search in sources :

Example 1 with ShaderWrapper_Direct

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper_Direct in project ImmersiveEngineering by BluSunrize.

the class TileEntityBalloon method readCustomNBT.

@Override
public void readCustomNBT(NBTTagCompound nbt, boolean descPacket) {
    super.readCustomNBT(nbt, descPacket);
    //to prevent old ballons from going black
    int nbtVersion = nbt.getInteger("nbtVersion");
    if (nbtVersion >= 1) {
        style = nbt.getInteger("style");
        colour0 = nbt.getInteger("colour0");
        colour1 = nbt.getInteger("colour1");
    }
    if (nbt.hasKey("shader")) {
        shader = new ShaderWrapper_Direct("immersiveengineering:balloon");
        shader.deserializeNBT(nbt.getCompoundTag("shader"));
    }
}
Also used : ShaderWrapper_Direct(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper_Direct)

Example 2 with ShaderWrapper_Direct

use of blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper_Direct in project ImmersiveEngineering by BluSunrize.

the class EventHandler method onCapabilitiesAttach.

@SubscribeEvent
public void onCapabilitiesAttach(AttachCapabilitiesEvent.Entity event) {
    if (event.getEntity() instanceof EntityMinecart) {
        EntityMinecart entityMinecart = (EntityMinecart) event.getEntity();
        event.addCapability(new ResourceLocation("immersiveengineering:shader"), new ShaderWrapper_Direct("immersiveengineering:minecart"));
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) EntityMinecart(net.minecraft.entity.item.EntityMinecart) ShaderWrapper_Direct(blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper_Direct) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

ShaderWrapper_Direct (blusunrize.immersiveengineering.api.shader.CapabilityShader.ShaderWrapper_Direct)2 EntityMinecart (net.minecraft.entity.item.EntityMinecart)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1