cpw.mods.fml.relauncher.SideOnly Java Examples

The following examples show how to use cpw.mods.fml.relauncher.SideOnly. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TileAuraPylon.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SideOnly(Side.CLIENT)
private void doEssentiaTrail() {
    if((ticksExisted & 1) == 0) return;
    TileAuraPylon tile = getMasterTile();
    if(tile == null) return;
    TileAuraPylon inputTile = getInputTile();
    if(inputTile == null) return;
    Aspect a = inputTile.getAspectType();
    if(a == null) return;
    if(inputTile.amount <= 0) return;

    int count = 5;
    FXEssentiaTrail essentiaTrail = new FXEssentiaTrail(tile.getWorldObj(), inputTile.xCoord + 0.5, inputTile.yCoord + 0.2, inputTile.zCoord + 0.5, tile.xCoord + 0.5, tile.yCoord + 1.7, tile.zCoord + 0.5, count, a.getColor(), 1);
    essentiaTrail.noClip = true;
    essentiaTrail.motionY = (0.1F + MathHelper.sin(count / 3.0F) * 0.01F);
    essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.001F + worldObj.rand.nextGaussian() * 0.002000000094994903D);
    essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.001F + worldObj.rand.nextGaussian() * 0.002000000094994903D);
    ParticleEngine.instance.addEffect(tile.getWorldObj(), essentiaTrail);
}
 
Example #2
Source File: EntityItemElement.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void playClientElementEffect(ItemElement.EnumElementType element, World worldObj, double posX, double posY, double posZ) {
    float randOffsetX = worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1);
    float randOffsetY = worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1);
    float randOffsetZ = worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1);
    switch (element) {
        case DARKNESS:
            FXLightningBolt bolt = new FXLightningBolt(Minecraft.getMinecraft().theWorld, posX, posY + 0.2F, posZ,
                    posX + randOffsetX / 2, posY + randOffsetY / 2, posZ + randOffsetZ / 2, Minecraft.getMinecraft().theWorld.rand.nextLong(), 10, 4.0F, 5);
            bolt.defaultFractal();
            bolt.setType(5);
            bolt.finalizeBolt();
            break;
        /*case ORDER:
            Thaumcraft.proxy.wispFX(worldObj, posX + randOffsetX / 4, posY + 0.2F + randOffsetY / 4, posZ + randOffsetZ / 4, 0.1F, 0xFF, 0xFF, 0xFF);
            break;
        case FIRE:
            Minecraft.getMinecraft().effectRenderer.addEffect(
                    new EntityFlameFX(worldObj, posX + randOffsetX / 4, posY + 0.2F + randOffsetY / 4, posZ + randOffsetZ / 4, 0, 0, 0));
            break;*/
    }
}
 
Example #3
Source File: GT_TileEntity_LESU.java    From bartworks with MIT License 6 votes vote down vote up
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister aBlockIconRegister) {

    for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) {
        GT_TileEntity_LESU.iIcons[i] = aBlockIconRegister.registerIcon(MainMod.MOD_ID + ":LESU_CASING_" + i);
        int finalI = i;
        GT_TileEntity_LESU.iIconContainers[i] = new IIconContainer() {
            @Override
            public IIcon getIcon() {
                return GT_TileEntity_LESU.iIcons[finalI];
            }

            @Override
            public IIcon getOverlayIcon() {
                return GT_TileEntity_LESU.iIcons[finalI];
            }

            @Override
            public ResourceLocation getTextureFile() {
                return new ResourceLocation(MainMod.MOD_ID + ":LESU_CASING_" + finalI);
            }
        };
    }

}
 
Example #4
Source File: TileEntityBanner.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
@SideOnly(Side.CLIENT)
private void initializeBannerData() {
	if (patternList == null || colorList == null || field_175121_j == null)
		if (!field_175119_g)
			field_175121_j = "";
		else {
			patternList = Lists.newArrayList();
			colorList = Lists.newArrayList();
			patternList.add(TileEntityBanner.EnumBannerPattern.BASE);
			colorList.add(EnumColour.fromDamage(baseColor));
			field_175121_j = "b" + baseColor;

			if (patterns != null)
				for (int i = 0; i < patterns.tagCount(); i++) {
					NBTTagCompound nbttagcompound = patterns.getCompoundTagAt(i);
					EnumBannerPattern pattern = EnumBannerPattern.getPatternByID(nbttagcompound.getString("Pattern"));

					if (pattern != null) {
						patternList.add(pattern);
						int j = nbttagcompound.getInteger("Color");
						colorList.add(EnumColour.fromDamage(j));
						field_175121_j = field_175121_j + pattern.getPatternID() + j;
					}
				}
		}
}
 
Example #5
Source File: BW_GlasBlocks.java    From bartworks with MIT License 6 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
    if (!this.connectedTex) {
        this.texture = new IIcon[this.textureNames.length];
        for (int i = 0; i < this.textureNames.length; i++) {
            this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]);
        }
        return;
    }
    this.texture = new IIcon[this.textureNames.length];
    this.connectedTexture = new IIcon[16];
    for (int i = 0; i < this.textureNames.length; i++) {
        this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]);
        String[] splitname = this.textureNames[0].split(":");
        for (int j = 0; j < 16; j++) {
            this.connectedTexture[j] = par1IconRegister.registerIcon(
                    splitname[0]
                            + ":connectedTex/"
                            + splitname[1] + '/'
                            + splitname[1] + '_' + j);
        }
    }
}
 
Example #6
Source File: WorldProviderTCEldrich.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SideOnly(Side.CLIENT)
public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) {
    int i = 10518688;
    float f2 = MathHelper.cos(p_76562_1_ * 3.141593F * 2.0F) * 2.0F + 0.5F;
    if (f2 < 0.0F) {
        f2 = 0.0F;
    }
    if (f2 > 1.0F) {
        f2 = 1.0F;
    }
    float f3 = (i >> 16 & 0xFF) / 255.0F;
    float f4 = (i >> 8 & 0xFF) / 255.0F;
    float f5 = (i & 0xFF) / 255.0F;
    f3 *= (f2 * 0.0F + 0.15F);
    f4 *= (f2 * 0.0F + 0.15F);
    f5 *= (f2 * 0.0F + 0.15F);
    return Vec3.createVectorHelper(f3, f4, f5);
}
 
Example #7
Source File: Entity.java    From TickDynamic with MIT License 6 votes vote down vote up
/**
 * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both
 * arguments in degrees.
 */
@SideOnly(Side.CLIENT)
public void setAngles(float p_70082_1_, float p_70082_2_)
{
    float f2 = this.rotationPitch;
    float f3 = this.rotationYaw;
    this.rotationYaw = (float)((double)this.rotationYaw + (double)p_70082_1_ * 0.15D);
    this.rotationPitch = (float)((double)this.rotationPitch - (double)p_70082_2_ * 0.15D);

    if (this.rotationPitch < -90.0F)
    {
        this.rotationPitch = -90.0F;
    }

    if (this.rotationPitch > 90.0F)
    {
        this.rotationPitch = 90.0F;
    }

    this.prevRotationPitch += this.rotationPitch - f2;
    this.prevRotationYaw += this.rotationYaw - f3;
}
 
Example #8
Source File: BW_Blocks.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
    for (int i = 0; i < this.textureNames.length; i++) {
        list.add(new ItemStack(item, 1, i));
    }
}
 
Example #9
Source File: BW_TileEntityContainer.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
    if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) {
        try {
            ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).registerBlockIcons(par1IconRegister);
        } catch (InstantiationException | IllegalAccessException e) {
            e.printStackTrace();
        }
    } else
        super.registerBlockIcons(par1IconRegister);
}
 
Example #10
Source File: BW_TileEntityContainer_Multiple.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
    this.texture = new IIcon[this.textureNames.length];
    for (int i = 0; i < this.textureNames.length; i++) {
        this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]);
    }
}
 
Example #11
Source File: EntityConverter.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void preInit(FMLPreInitializationEvent evt) {
	/**
	 * Backward register all particle effects
	 */

	//Look up for particle factory and pass it into BWEntityFX
	BWEntityFX.fxMap.forEach((k, v) -> Game.entities().register(Game.info().name + ":" + k, () -> new BWEntityFX(k)));
}
 
Example #12
Source File: BW_TileEntityContainer.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
    if (ITileHasDifferentTextureSides.class.isAssignableFrom(this.tileEntity)) {
        try {
            return ((ITileHasDifferentTextureSides) this.tileEntity.newInstance()).getTextureForSide(side, meta);
        } catch (InstantiationException | IllegalAccessException e) {
            e.printStackTrace();
            return super.getIcon(side, meta);
        }
    } else
        return super.getIcon(side, meta);
}
 
Example #13
Source File: StickyJarResearchItem.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public boolean isSpecial() {
    if(Gadomancy.proxy.getSide() == Side.CLIENT) {
        List<ItemStack> items = RegisteredItems.getStickyJarStacks(Minecraft.getMinecraft().thePlayer);
        if(items.size() > 0) {
            itemIcons = items;
        }
    }
    return super.isSpecial();
}
 
Example #14
Source File: FamiliarHandlerClient.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void playerRenderEvent(EntityPlayer player, float partialTicks) {
    String ownerName = player.getCommandSenderName();
    if(!clientFamiliars.containsKey(ownerName)) return;

    ExFamiliarData data = clientFamiliars.get(ownerName);
    PartialEntityFamiliar fam = data.familiar;

    Aspect aspect = Aspect.getAspect(data.data.aspectTag);

    if(ENTITY_WISP == null) ENTITY_WISP = new EntityWisp(new FakeWorld());
    ENTITY_WISP.setType(aspect.getTag());
    ENTITY_WISP.ticksExisted = fam.dummyEntity.ticksExisted;
    GL11.glPushMatrix();
    if(fam.owner == null || fam.owner.get() == null) {
        fam.owner = new WeakReference<EntityPlayer>(player);
    }
    EntityPlayer current = Minecraft.getMinecraft().thePlayer;
    double diffX = fam.renderX - current.posX + player.posX;
    double diffY = fam.renderY - current.posY + player.posY + 0.5;
    double diffZ = fam.renderZ - current.posZ + player.posZ;

    String currentPl = current.getCommandSenderName();
    String otherPl = player.getCommandSenderName();

    if(!currentPl.equals(otherPl)) {
        diffY += 1.32;

        EntityLivingBase entity = Minecraft.getMinecraft().renderViewEntity;
        diffX -= ((entity.posX - entity.lastTickPosX) * partialTicks);
        diffY -= ((entity.posY - entity.lastTickPosY) * partialTicks);
        diffZ -= ((entity.posZ - entity.lastTickPosZ) * partialTicks);
    }

    ItemRenderFamiliar.renderEntityWispFor(fam.owner.get(), ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks);
    GL11.glPopMatrix();
}
 
Example #15
Source File: ClientEventHandler.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
	if (EtFuturum.enablePrismarine)
		if (event.map.getTextureType() == 0) {
			TextureAtlasSprite icon = new PrismarineIcon("prismarine_rough");
			if (event.map.setTextureEntry("prismarine_rough", icon))
				((PrismarineBlocks) ModBlocks.prismarine).setIcon(0, icon);
			else
				((PrismarineBlocks) ModBlocks.prismarine).setIcon(0, event.map.registerIcon("prismarine_rough"));
		}
}
 
Example #16
Source File: FWBlock.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
	Block blockInstance = getBlockInstance(world, new Vector3D(x, y, z));

	if (blockInstance.components.has(Collider.class)) {
		Cuboid cuboid = blockInstance.components.get(Collider.class).boundingBox.get();
		return CuboidConverter.instance().toNative(cuboid.add(new Vector3D(x, y, z)));
	}
	return super.getSelectedBoundingBoxFromPool(world, x, y, z);
}
 
Example #17
Source File: BW_GlasBlocks.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) {
    if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks)
        return false;
    return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide);
}
 
Example #18
Source File: CTMGenericBlock.java    From NewHorizonsCoreMod with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
	for (int i = 0; i < 47; i++) {
           textures[i] = iconRegister.registerIcon(String.format("%s:sets/atlantis/%s/forgeCtm_%d", Refstrings.MODID.toLowerCase(), _mInternalName.toLowerCase(), i + 1));
       }
}
 
Example #19
Source File: Circuit_Programmer.java    From bartworks with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) {
    ItemStack itemStack = new ItemStack(this, 1);
    if (this.getChargedItem(itemStack) == this) {
        ItemStack charged = new ItemStack(this, 1);
        ElectricItem.manager.charge(charged, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false);
        itemList.add(charged);
    }
    if (this.getEmptyItem(itemStack) == this) {
        itemList.add(new ItemStack(this, 1, this.getMaxDamage()));
    }
}
 
Example #20
Source File: ItemBanner.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubItems(Item item, CreativeTabs tab, List subItems) {
	for (EnumColour colour : EnumColour.values())
		subItems.add(new ItemStack(item, 1, colour.getDamage()));
}
 
Example #21
Source File: BlockBabyChest.java    From NewHorizonsCoreMod with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World pWorld, int pX, int pY, int pZ) 
{
    setBlockBoundsBasedOnState(pWorld, pX, pY, pZ);
    return super.getSelectedBoundingBoxFromPool(pWorld, pX, pY, pZ);
}
 
Example #22
Source File: BlockGeneric.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
	for (int i = startMeta; i < types.length; i++)
		list.add(new ItemStack(item, 1, i));
}
 
Example #23
Source File: LookingGlassForgeEventHandler.java    From LookingGlass with GNU General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onWorldUnload(WorldEvent.Unload event) {
	if (!event.world.isRemote) return;
	// When we unload a world client side, we want to make sure that any view entities clean up. Not strictly necessary, but a good practice.
	// I don't trust vanilla to unload entity references quickly/correctly/completely.
	for (Object entity : event.world.loadedEntityList) {
		if (entity instanceof EntityPortal) ((EntityPortal) entity).releaseActiveView();
	}
}
 
Example #24
Source File: Entity.java    From TickDynamic with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public boolean isInRangeToRender3d(double p_145770_1_, double p_145770_3_, double p_145770_5_)
{
    double d3 = this.posX - p_145770_1_;
    double d4 = this.posY - p_145770_3_;
    double d5 = this.posZ - p_145770_5_;
    double d6 = d3 * d3 + d4 * d4 + d5 * d5;
    return this.isInRangeToRenderDist(d6);
}
 
Example #25
Source File: SimpleSubItemClass.java    From bartworks with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
    this.itemIcon = new IIcon[this.tex.length];
    for (int i = 0; i < this.tex.length; i++) {
        this.itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.tex[i]);
    }

}
 
Example #26
Source File: TileEssentiaCompressor.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
private void playEssentiaEffects() {
    if ((ClientHandler.ticks % 20 == 0) && (al.size() > 0)) {
        this.displayAspect = al.getAspects()[(ClientHandler.ticks / 20 % al.size())];
        Color c = new Color(this.displayAspect.getColor());
        this.tr = (c.getRed() / 255.0F);
        this.tg = (c.getGreen() / 255.0F);
        this.tb = (c.getBlue() / 255.0F);
        this.tri = ((this.cr - this.tr) / 20.0F);
        this.tgi = ((this.cg - this.tg) / 20.0F);
        this.tbi = ((this.cb - this.tb) / 20.0F);
    }
    if (this.displayAspect == null) {
        this.tr = (this.tg = this.tb = 1.0F);
        this.tri = (this.tgi = this.tbi = 0.0F);
    } else {
        this.cr -= this.tri;
        this.cg -= this.tgi;
        this.cb -= this.tbi;
    }
    int count = 1;
    cr = Math.min(1.0F, Math.max(0.0F, cr));
    cg = Math.min(1.0F, Math.max(0.0F, cg));
    cb = Math.min(1.0F, Math.max(0.0F, cb));
    FXEssentiaTrail essentiaTrail = new FXEssentiaTrail(worldObj, xCoord + 0.5, yCoord + 0.4, zCoord + 0.5, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, count, new Color(cr, cg, cb).getRGB(), 0.8F);
    essentiaTrail.noClip = true;
    essentiaTrail.motionY = (0.01F + MathHelper.sin(count / 3.0F) * 0.001F);
    essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
    essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
    ParticleEngine.instance.addEffect(worldObj, essentiaTrail);

    essentiaTrail = new FXEssentiaTrail(worldObj, xCoord + 0.5, yCoord + 2.6, zCoord + 0.5, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, count, new Color(cr, cg, cb).getRGB(), 0.8F);
    essentiaTrail.noClip = true;
    essentiaTrail.motionY = -(0.01F + MathHelper.sin(count / 3.0F) * 0.001F);
    essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
    essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.01F + worldObj.rand.nextGaussian() * 0.01D);
    ParticleEngine.instance.addEffect(worldObj, essentiaTrail);
}
 
Example #27
Source File: IntegrationMorph.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public boolean isMorphed() {
    if(methodHasMorph != null) {
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        Boolean result = INJECTOR.invokeMethod(methodHasMorph, player.getCommandSenderName(), true);
        return result != null ? result : false;
    }
    return false;
}
 
Example #28
Source File: Entity.java    From TickDynamic with MIT License 5 votes vote down vote up
/**
 * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
 * length * 64 * renderDistanceWeight Args: distance
 */
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double p_70112_1_)
{
    double d1 = this.boundingBox.getAverageEdgeLength();
    d1 *= 64.0D * this.renderDistanceWeight;
    return p_70112_1_ < d1 * d1;
}
 
Example #29
Source File: BW_MetaGenerated_Items.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
    for (Werkstoff werkstoff : werkstoffHashSet) {
        if (werkstoff != null && werkstoff.hasItemType(this.orePrefixes)) {
            ItemStack tStack = new ItemStack(this, 1, werkstoff.getmID());
            aList.add(tStack);
        }
    }
    //super.getSubItems(var1, aCreativeTab, aList);
}
 
Example #30
Source File: PacketTCNodeBolt.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public IMessage onMessage(PacketTCNodeBolt p, MessageContext ctx) {
    FXLightningBolt bolt = new FXLightningBolt(Minecraft.getMinecraft().theWorld, p.x, p.y, p.z, p.targetX, p.targetY, p.targetZ, Minecraft.getMinecraft().theWorld.rand.nextLong(), 10, 4.0F, 5);
    bolt.defaultFractal();
    bolt.setType(p.type);
    bolt.finalizeBolt();
    return null;
}