Search in sources :

Example 86 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class GenericWorldProvider method getCloudColor.

@Override
@SideOnly(Side.CLIENT)
public Vec3d getCloudColor(float partialTicks) {
    getDimensionInformation();
    Vec3d cloudColor = super.getCloudColor(partialTicks);
    if (dimensionInformation == null || dimensionInformation.isPatreonBitSet(PatreonType.PATREON_KENNEY)) {
        return cloudColor;
    } else {
        float r = dimensionInformation.getSkyDescriptor().getCloudColorFactorR();
        float g = dimensionInformation.getSkyDescriptor().getCloudColorFactorG();
        float b = dimensionInformation.getSkyDescriptor().getCloudColorFactorB();
        return new Vec3d(cloudColor.x * r, cloudColor.y * g, cloudColor.z * b);
    }
}
Also used : Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 87 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class DimensionMonitorItem method initModel.

@Override
@SideOnly(Side.CLIENT)
public void initModel() {
    for (int i = 0; i <= 8; i++) {
        ResourceLocation registryName = getRegistryName();
        registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + i);
        ModelBakery.registerItemVariants(this, new ModelResourceLocation(registryName, "inventory"));
    // ModelBakery.addVariantName(this, getRegistryName() + i);
    }
    ModelLoader.setCustomMeshDefinition(this, stack -> {
        WorldClient world = Minecraft.getMinecraft().world;
        int id = world.provider.getDimension();
        DimensionStorage storage = DimensionStorage.getDimensionStorage(world);
        int energyLevel = storage.getEnergyLevel(id);
        int level = (9 * energyLevel) / PowerConfiguration.MAX_DIMENSION_POWER;
        if (level < 0) {
            level = 0;
        } else if (level > 8) {
            level = 8;
        }
        ResourceLocation registryName = getRegistryName();
        registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + (8 - level));
        return new ModelResourceLocation(registryName, "inventory");
    });
}
Also used : DimensionStorage(mcjty.rftoolsdim.dimensions.DimensionStorage) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) WorldClient(net.minecraft.client.multiplayer.WorldClient) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 88 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class DimensionModuleItem method addInformation.

@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag whatIsThis) {
    super.addInformation(itemStack, player, list, whatIsThis);
    list.add(TextFormatting.GREEN + "Uses " + GeneralConfiguration.DIMENSIONMODULE_RFPERTICK + " RF/tick");
    NBTTagCompound tagCompound = itemStack.getTagCompound();
    if (tagCompound != null) {
        list.add(TextFormatting.YELLOW + "Label: " + tagCompound.getString("text"));
        list.add(TextFormatting.YELLOW + "Dimension: " + tagCompound.getInteger("dim"));
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 89 with SideOnly

use of net.minecraftforge.fml.relauncher.SideOnly in project RFToolsDimensions by McJty.

the class DimletEnergyModuleItem method initModel.

@Override
@SideOnly(Side.CLIENT)
public void initModel() {
    ModelResourceLocation[] models = new ModelResourceLocation[3];
    for (int i = 0; i < 3; i++) {
        ResourceLocation registryName = getRegistryName();
        registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + i);
        models[i] = new ModelResourceLocation(registryName, "inventory");
        ModelBakery.registerItemVariants(this, models[i]);
    }
    ModelLoader.setCustomMeshDefinition(this, stack -> models[stack.getItemDamage()]);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 90 with SideOnly

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

the class Gas method renderOverlay.

@SideOnly(Side.CLIENT)
@Override
public void renderOverlay(float concentration, float partialTicks, ScaledResolution resolution) {
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    int color = getColor();
    float b = (color & 0xFF) / 255F;
    float g = (color >> 8 & 0xFF) / 255F;
    float r = (color >> 16 & 0xFF) / 255F;
    float a = (color >> 24 & 0xFF) / 255F;
    GlStateManager.color(r, g, b, concentration * a);
    GlStateManager.enableAlpha();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    Minecraft.getMinecraft().getTextureManager().bindTexture(getOverlayTexture());
    ShaderUtil.useShader(OVERLAY_SHADER);
    ShaderUtil.setUniform("gasColor", r, g, b, a);
    ShaderUtil.setUniform("iTime", (int) System.currentTimeMillis());
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder bufferbuilder = tessellator.getBuffer();
    bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
    bufferbuilder.pos(0.0D, (double) resolution.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
    bufferbuilder.pos((double) resolution.getScaledWidth(), (double) resolution.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
    bufferbuilder.pos((double) resolution.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
    bufferbuilder.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
    tessellator.draw();
    ShaderUtil.revert();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) BufferBuilder(net.minecraft.client.renderer.BufferBuilder) 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