Search in sources :

Example 91 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project Gaspunk by Ladysnake.

the class ModItems method registerRenders.

@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void registerRenders(ModelRegistryEvent event) {
    ModelLoader.setCustomModelResourceLocation(EMPTY_SYRINGE, 0, new ModelResourceLocation(new ResourceLocation("pathos:empty_syringe"), "inventory"));
    ModelLoader.setCustomModelResourceLocation(FILLED_SYRINGE, 0, new ModelResourceLocation(new ResourceLocation("pathos:filled_syringe"), "inventory"));
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 92 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.

the class BlockBlackHoleStorage method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
    TileEntity tile = world.getTileEntity(pos);
    if (tile instanceof TileEntityBlackHoleStorage) {
        TileEntityBlackHoleStorage storage = (TileEntityBlackHoleStorage) tile;
        if (!storage.disableBlackHole) {
            for (int i = 0; i < 16; i++) {
                double x = pos.getX() + rand.nextFloat() - 0.5D;
                double y = pos.getY() + 0.5D;
                double z = pos.getZ() + rand.nextFloat();
                double motionX = rand.nextDouble() - 0.5D;
                double motionZ = rand.nextDouble() - 0.5D;
                MorePlanetsCore.PROXY.spawnParticle(EnumParticleTypesMP.DARK_PORTAL, x + 0.5D, y, z, motionX, 1.0D, 0.0D);
                MorePlanetsCore.PROXY.spawnParticle(EnumParticleTypesMP.DARK_PORTAL, x + 0.5D, y, z + 0.0D, 0.0D, 1.0D, motionZ);
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityBlackHoleStorage(stevekung.mods.moreplanets.tileentity.TileEntityBlackHoleStorage) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 93 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.

the class BlockDarkEnergyReceiver method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
    TileEntity tile = world.getTileEntity(pos);
    if (tile instanceof TileEntityDarkEnergyReceiver) {
        TileEntityDarkEnergyReceiver dark = (TileEntityDarkEnergyReceiver) tile;
        if (dark.activated && !dark.successful) {
            for (int i = 0; i < 32; ++i) {
                double d0 = pos.getX() + rand.nextFloat();
                double d1 = pos.getY() + rand.nextFloat();
                double d2 = pos.getZ() + rand.nextFloat();
                double d3 = (rand.nextFloat() - 0.5D) * 0.5D;
                double d4 = (rand.nextFloat() - 0.5D) * 0.5D;
                double d5 = (rand.nextFloat() - 0.5D) * 0.5D;
                int j = rand.nextInt(2) * 2 - 1;
                d2 = pos.getZ() + 0.5D + 0.25D * j;
                d5 = rand.nextFloat() * 2.0F * j;
                MorePlanetsCore.PROXY.spawnParticle(EnumParticleTypesMP.DARK_PORTAL, d0, d1, d2, d3, d4, d5);
            }
            for (int i = 0; i < 32; ++i) {
                double d0 = pos.getX() + rand.nextFloat();
                double d1 = pos.getY() + rand.nextFloat();
                double d2 = pos.getZ() + rand.nextFloat();
                double d3 = (rand.nextFloat() - 0.5D) * 0.5D;
                double d4 = (rand.nextFloat() - 0.5D) * 0.5D;
                double d5 = (rand.nextFloat() - 0.5D) * 0.5D;
                int j = rand.nextInt(2) * 2 - 1;
                d0 = pos.getX() + 0.5D + 0.25D * j;
                d3 = rand.nextFloat() * 2.0F * j;
                MorePlanetsCore.PROXY.spawnParticle(EnumParticleTypesMP.DARK_PORTAL, d0, d1, d2, d3, d4, d5);
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityDarkEnergyReceiver(stevekung.mods.moreplanets.tileentity.TileEntityDarkEnergyReceiver) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 94 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.

the class BlockRocketCrusher method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
    TileEntity tile = world.getTileEntity(pos);
    if (tile instanceof TileEntityRocketCrusher) {
        TileEntityRocketCrusher tileEntity = (TileEntityRocketCrusher) tile;
        ItemStack itemStack = new ItemStack(AsteroidsItems.basicItem, 1, 0);
        if (tileEntity.processTicks > 20) {
            for (int i = 0; i < 2; i++) {
                world.spawnParticle(EnumParticleTypes.ITEM_CRACK, pos.getX() + (double) rand.nextFloat(), pos.getY() + 1.0D, pos.getZ() + (double) rand.nextFloat(), 0.1D * (rand.nextFloat() - 0.5D), 0.2D, (rand.nextFloat() - 0.5D) * 0.1D, new int[] { Item.getIdFromItem(itemStack.getItem()), itemStack.getMetadata() });
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityRocketCrusher(stevekung.mods.moreplanets.tileentity.TileEntityRocketCrusher) ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 95 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project MorePlanets by SteveKunG.

the class BlockFluidNuclearWaste method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
    if (this.blockMaterial == Material.LAVA && world.getBlockState(pos.up()).getMaterial() == Material.AIR && !world.getBlockState(pos.up()).isOpaqueCube()) {
        if (rand.nextInt(50) == 0) {
            double d5 = pos.getX() + rand.nextFloat();
            double d6 = pos.getY() + state.getBoundingBox(world, pos).maxY;
            double d7 = pos.getZ() + rand.nextFloat();
            world.playSound(d5, d6, d7, SoundEvents.BLOCK_LAVA_POP, SoundCategory.BLOCKS, 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
        }
        if (rand.nextInt(200) == 0) {
            world.playSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.BLOCK_LAVA_AMBIENT, SoundCategory.BLOCKS, 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
        }
    }
    if (rand.nextInt(10) == 0 && world.getBlockState(pos.down()).isSideSolid(world, pos.down(), EnumFacing.UP)) {
        Material material = world.getBlockState(pos.down(2)).getMaterial();
        if (!material.blocksMovement() && !material.isLiquid()) {
            double d5 = pos.getX() + rand.nextFloat();
            double d6 = pos.getY() - 1.05D;
            double d7 = pos.getZ() + rand.nextFloat();
            MorePlanetsCore.PROXY.spawnParticle(EnumParticleTypesMP.NUCLEAR_WASTE_DRIP, d5, d6, d7);
        }
    }
}
Also used : Material(net.minecraft.block.material.Material) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1328 ItemStack (net.minecraft.item.ItemStack)238 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)149 IBlockState (net.minecraft.block.state.IBlockState)140 ResourceLocation (net.minecraft.util.ResourceLocation)139 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)127 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)126 BlockPos (net.minecraft.util.math.BlockPos)85 Block (net.minecraft.block.Block)82 TileEntity (net.minecraft.tileentity.TileEntity)80 EntityPlayer (net.minecraft.entity.player.EntityPlayer)72 Vec3d (net.minecraft.util.math.Vec3d)71 World (net.minecraft.world.World)69 EnumFacing (net.minecraft.util.EnumFacing)64 Minecraft (net.minecraft.client.Minecraft)62 ArrayList (java.util.ArrayList)50 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)42 Nonnull (javax.annotation.Nonnull)41 Entity (net.minecraft.entity.Entity)39 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)39