Search in sources :

Example 86 with Minecraft

use of net.minecraft.client.Minecraft in project RFToolsDimensions by McJty.

the class SkyRenderer method registerEnderSky.

public static void registerEnderSky(GenericWorldProvider provider) {
    provider.setSkyRenderer(new IRenderHandler() {

        @Override
        public void render(float partialTicks, WorldClient world, Minecraft mc) {
            SkyRenderer.renderEnderSky();
        }
    });
    provider.setCloudRenderer(new IRenderHandler() {

        @Override
        public void render(float partialTicks, WorldClient world, Minecraft mc) {
        }
    });
}
Also used : IRenderHandler(net.minecraftforge.client.IRenderHandler) WorldClient(net.minecraft.client.multiplayer.WorldClient) Minecraft(net.minecraft.client.Minecraft)

Example 87 with Minecraft

use of net.minecraft.client.Minecraft in project ArsMagica2 by Mithion.

the class AMGuiHelper method overrideKeyboardInput.

public static void overrideKeyboardInput() {
    Minecraft mc = Minecraft.getMinecraft();
    if (mc.thePlayer != null && mc.theWorld != null && ExtendedProperties.For(mc.thePlayer).shouldReverseInput()) {
        EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
        if (mc.gameSettings.keyBindLeft.getIsKeyPressed()) {
            LogHelper.info("Override Left");
            player.movementInput.moveStrafe -= 2;
        }
        if (mc.gameSettings.keyBindRight.getIsKeyPressed()) {
            LogHelper.info("Override Rights");
            player.movementInput.moveStrafe += 2;
        }
        if (mc.thePlayer.isPotionActive(BuffList.scrambleSynapses)) {
            if (mc.gameSettings.keyBindForward.getIsKeyPressed()) {
                player.movementInput.moveForward -= 2;
            }
            if (mc.gameSettings.keyBindBack.getIsKeyPressed()) {
                player.movementInput.moveForward += 2;
            }
        }
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) Minecraft(net.minecraft.client.Minecraft)

Example 88 with Minecraft

use of net.minecraft.client.Minecraft in project Railcraft by Railcraft.

the class ClientEffectProxy method thinParticles.

private boolean thinParticles(boolean canDisable) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    int particleSetting = mc.gameSettings.particleSetting;
    if (!canDisable && particleSetting > 1)
        particleSetting = 1;
    if (particleSetting == 1 && MiscTools.RANDOM.nextInt(3) == 0)
        particleSetting = 2;
    return particleSetting > 1;
}
Also used : Minecraft(net.minecraft.client.Minecraft)

Example 89 with Minecraft

use of net.minecraft.client.Minecraft in project RecurrentComplex by Ivorforce.

the class RCForgeEventHandler method onDrawWorld.

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onDrawWorld(RenderWorldLastEvent event) {
    Minecraft mc = Minecraft.getMinecraft();
    int ticks = mc.player.ticksExisted;
    Entity renderEntity = mc.getRenderViewEntity();
    RCEntityInfo info = RCEntityInfo.get(mc.player, null);
    double entityX = renderEntity.lastTickPosX + (renderEntity.posX - renderEntity.lastTickPosX) * (double) event.getPartialTicks();
    double entityY = renderEntity.lastTickPosY + (renderEntity.posY - renderEntity.lastTickPosY) * (double) event.getPartialTicks();
    double entityZ = renderEntity.lastTickPosZ + (renderEntity.posZ - renderEntity.lastTickPosZ) * (double) event.getPartialTicks();
    GlStateManager.pushMatrix();
    GlStateManager.translate(-entityX, -entityY, -entityZ);
    if (info != null && info.showGrid) {
        int spacing = 10;
        GlStateManager.disableTexture2D();
        GlStateManager.color(0.5f, 0.5f, 0.5f);
        GlStateManager.pushMatrix();
        GlStateManager.translate(MathHelper.floor(entityX / spacing) * spacing, MathHelper.floor(entityY / spacing) * spacing, MathHelper.floor(entityZ / spacing) * spacing);
        GridRenderer.renderGrid(8, spacing, 100, 0.05f);
        GlStateManager.popMatrix();
        GlStateManager.enableTexture2D();
    }
    SelectionRenderer.renderSelection(mc.player, ticks, event.getPartialTicks());
    if (info != null && info.danglingOperation != null)
        info.danglingOperation.renderPreview(info.getPreviewType(), mc.world, ticks, event.getPartialTicks());
    GlStateManager.popMatrix();
}
Also used : Entity(net.minecraft.entity.Entity) RCEntityInfo(ivorius.reccomplex.capability.RCEntityInfo) Minecraft(net.minecraft.client.Minecraft) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 90 with Minecraft

use of net.minecraft.client.Minecraft in project Witchworks by Um-Mitternacht.

the class TileRenderKettle method renderTileEntityAt.

@SuppressWarnings("ConstantConditions")
@Override
public void renderTileEntityAt(TileKettle te, double x, double y, double z, float partialTicks, int destroyStage) {
    Optional<FluidStack> optional = te.getFluid();
    if (optional.isPresent() && optional.get().amount > 0) {
        FluidStack fluidStack = optional.get();
        Fluid fluid = fluidStack.getFluid();
        ResourceLocation location = fluid.getStill();
        double level = (double) fluidStack.amount / (Fluid.BUCKET_VOLUME * 2D);
        GlStateManager.pushMatrix();
        GlStateManager.disableLighting();
        GlStateManager.translate(x, y + 0.1 + level, z);
        if (fluid == FluidRegistry.WATER || te.hasIngredients()) {
            float r = (te.getColorRGB() >>> 16 & 0xFF) / 256.0F;
            float g = (te.getColorRGB() >>> 8 & 0xFF) / 256.0F;
            float b = (te.getColorRGB() & 0xFF) / 256.0F;
            GlStateManager.color(r, g, b);
            if (fluid == FluidRegistry.WATER)
                location = ResourceLocations.GRAY_WATER;
        }
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GlStateManager.disableAlpha();
        final float w = 0.125F;
        GlStateManager.translate(w, 0, w);
        GlStateManager.rotate(90F, 1F, 0F, 0F);
        final float s = 0.0460425F;
        GlStateManager.scale(s, s, s);
        renderWater(location);
        GlStateManager.enableAlpha();
        GlStateManager.disableBlend();
        GlStateManager.enableLighting();
        GlStateManager.popMatrix();
    }
    GlStateManager.pushMatrix();
    GlStateManager.translate(x + 0.5, y + 0.2D, z + 0.35);
    GlStateManager.rotate(90F, 1F, 0, 0);
    ItemStack stack = te.getContainer();
    if (!stack.isEmpty()) {
        Minecraft mc = Minecraft.getMinecraft();
        mc.getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
    }
    GlStateManager.popMatrix();
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) Fluid(net.minecraftforge.fluids.Fluid) ResourceLocation(net.minecraft.util.ResourceLocation) ItemStack(net.minecraft.item.ItemStack) Minecraft(net.minecraft.client.Minecraft)

Aggregations

Minecraft (net.minecraft.client.Minecraft)100 ItemStack (net.minecraft.item.ItemStack)17 ScaledResolution (net.minecraft.client.gui.ScaledResolution)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)15 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)10 ResourceLocation (net.minecraft.util.ResourceLocation)8 ArrayList (java.util.ArrayList)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)7 FontRenderer (net.minecraft.client.gui.FontRenderer)6 WorldClient (net.minecraft.client.multiplayer.WorldClient)6 World (net.minecraft.world.World)6 Tessellator (net.minecraft.client.renderer.Tessellator)5 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)5 Block (net.minecraft.block.Block)4 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)4 IRenderHandler (net.minecraftforge.client.IRenderHandler)4 SimplePageView (com.almuradev.almura.feature.guide.client.gui.SimplePageView)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 Field (java.lang.reflect.Field)3 GuiScreen (net.minecraft.client.gui.GuiScreen)3