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) {
}
});
}
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;
}
}
}
}
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;
}
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();
}
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();
}
Aggregations