use of net.minecraft.client.renderer.texture.TextureMap in project kull by Sxmurai.
the class BlockFluidRenderer method initAtlasSprites.
protected void initAtlasSprites() {
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
this.atlasSpritesLava[0] = texturemap.getAtlasSprite("minecraft:blocks/lava_still");
this.atlasSpritesLava[1] = texturemap.getAtlasSprite("minecraft:blocks/lava_flow");
this.atlasSpritesWater[0] = texturemap.getAtlasSprite("minecraft:blocks/water_still");
this.atlasSpritesWater[1] = texturemap.getAtlasSprite("minecraft:blocks/water_flow");
}
use of net.minecraft.client.renderer.texture.TextureMap in project kull by Sxmurai.
the class Render method renderEntityOnFire.
/**
* Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
*/
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks) {
GlStateManager.disableLighting();
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y, (float) z);
float f = entity.width * 1.4F;
GlStateManager.scale(f, f, f);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
float f1 = 0.5F;
float f2 = 0.0F;
float f3 = entity.height / f;
float f4 = (float) (entity.posY - entity.getEntityBoundingBox().minY);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, -0.3F + (float) ((int) f3) * 0.02F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f5 = 0.0F;
int i = 0;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
while (f3 > 0.0F) {
TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
this.bindTexture(TextureMap.locationBlocksTexture);
float f6 = textureatlassprite2.getMinU();
float f7 = textureatlassprite2.getMinV();
float f8 = textureatlassprite2.getMaxU();
float f9 = textureatlassprite2.getMaxV();
if (i / 2 % 2 == 0) {
float f10 = f8;
f8 = f6;
f6 = f10;
}
worldrenderer.pos((double) (f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f8, (double) f9).endVertex();
worldrenderer.pos((double) (-f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f6, (double) f9).endVertex();
worldrenderer.pos((double) (-f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f6, (double) f7).endVertex();
worldrenderer.pos((double) (f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f8, (double) f7).endVertex();
f3 -= 0.45F;
f4 -= 0.45F;
f1 *= 0.9F;
f5 += 0.03F;
++i;
}
tessellator.draw();
GlStateManager.popMatrix();
GlStateManager.enableLighting();
}
use of net.minecraft.client.renderer.texture.TextureMap in project kull by Sxmurai.
the class Minecraft method startGame.
/**
* Starts the game: initializes the canvas, the title, the settings, etcetera.
*/
private void startGame() throws LWJGLException, IOException {
this.gameSettings = new GameSettings(this, this.mcDataDir);
this.defaultResourcePacks.add(this.mcDefaultResourcePack);
this.startTimerHackThread();
if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) {
this.displayWidth = this.gameSettings.overrideWidth;
this.displayHeight = this.gameSettings.overrideHeight;
}
logger.info("LWJGL Version: " + Sys.getVersion());
this.setWindowIcon();
this.setInitialDisplayMode();
this.createDisplay();
OpenGlHelper.initializeTextures();
this.framebufferMc = new Framebuffer(this.displayWidth, this.displayHeight, true);
this.framebufferMc.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F);
this.registerMetadataSerializers();
this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, new File(this.mcDataDir, "server-resource-packs"), this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings);
this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language);
this.mcResourceManager.registerReloadListener(this.mcLanguageManager);
this.refreshResources();
this.renderEngine = new TextureManager(this.mcResourceManager);
this.mcResourceManager.registerReloadListener(this.renderEngine);
this.drawSplashScreen(this.renderEngine);
this.initStream();
this.skinManager = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.sessionService);
this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves"));
this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings);
this.mcResourceManager.registerReloadListener(this.mcSoundHandler);
this.mcMusicTicker = new MusicTicker(this);
this.fontRendererObj = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false);
if (this.gameSettings.language != null) {
this.fontRendererObj.setUnicodeFlag(this.isUnicode());
this.fontRendererObj.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional());
}
this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false);
this.mcResourceManager.registerReloadListener(this.fontRendererObj);
this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer);
this.mcResourceManager.registerReloadListener(new GrassColorReloadListener());
this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener());
AchievementList.openInventory.setStatStringFormatter(new IStatStringFormat() {
public String formatString(String p_74535_1_) {
try {
return String.format(p_74535_1_, new Object[] { GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode()) });
} catch (Exception exception) {
return "Error: " + exception.getLocalizedMessage();
}
}
});
this.mouseHelper = new MouseHelper();
this.checkGLError("Pre startup");
GlStateManager.enableTexture2D();
GlStateManager.shadeModel(7425);
GlStateManager.clearDepth(1.0D);
GlStateManager.enableDepth();
GlStateManager.depthFunc(515);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.cullFace(1029);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
this.checkGLError("Startup");
this.textureMapBlocks = new TextureMap("textures");
this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels);
this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks);
this.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
this.textureMapBlocks.setBlurMipmapDirect(false, this.gameSettings.mipmapLevels > 0);
this.modelManager = new ModelManager(this.textureMapBlocks);
this.mcResourceManager.registerReloadListener(this.modelManager);
this.renderItem = new RenderItem(this.renderEngine, this.modelManager);
this.renderManager = new RenderManager(this.renderEngine, this.renderItem);
this.itemRenderer = new ItemRenderer(this);
this.mcResourceManager.registerReloadListener(this.renderItem);
this.entityRenderer = new EntityRenderer(this, this.mcResourceManager);
this.mcResourceManager.registerReloadListener(this.entityRenderer);
this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.gameSettings);
this.mcResourceManager.registerReloadListener(this.blockRenderDispatcher);
this.renderGlobal = new RenderGlobal(this);
this.mcResourceManager.registerReloadListener(this.renderGlobal);
this.guiAchievement = new GuiAchievement(this);
GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight);
this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
this.checkGLError("Post startup");
this.ingameGUI = new GuiIngame(this);
if (this.serverName != null) {
this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort));
} else {
this.displayGuiScreen(new GuiMainMenu());
}
this.renderEngine.deleteTexture(this.mojangLogo);
this.mojangLogo = null;
this.loadingScreen = new LoadingScreenRenderer(this);
if (this.gameSettings.fullScreen && !this.fullscreen) {
this.toggleFullscreen();
}
try {
Display.setVSyncEnabled(this.gameSettings.enableVsync);
} catch (OpenGLException var2) {
this.gameSettings.enableVsync = false;
this.gameSettings.saveOptions();
}
this.renderGlobal.makeEntityOutlineShader();
try {
Kull.init();
} catch (Exception e) {
e.printStackTrace();
logger.info("my bad g");
}
}
use of net.minecraft.client.renderer.texture.TextureMap in project UtilityClient2 by Utility-Client.
the class BlockFluidRenderer method initAtlasSprites.
protected void initAtlasSprites() {
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
this.atlasSpritesLava[0] = texturemap.getAtlasSprite("minecraft:blocks/lava_still");
this.atlasSpritesLava[1] = texturemap.getAtlasSprite("minecraft:blocks/lava_flow");
this.atlasSpritesWater[0] = texturemap.getAtlasSprite("minecraft:blocks/water_still");
this.atlasSpritesWater[1] = texturemap.getAtlasSprite("minecraft:blocks/water_flow");
}
use of net.minecraft.client.renderer.texture.TextureMap in project UtilityClient2 by Utility-Client.
the class Render method renderEntityOnFire.
/**
* Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
*/
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks) {
GlStateManager.disableLighting();
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y, (float) z);
float f = entity.width * 1.4F;
GlStateManager.scale(f, f, f);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
float f1 = 0.5F;
float f2 = 0.0F;
float f3 = entity.height / f;
float f4 = (float) (entity.posY - entity.getEntityBoundingBox().minY);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, 0.0F, -0.3F + (float) ((int) f3) * 0.02F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
float f5 = 0.0F;
int i = 0;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
while (f3 > 0.0F) {
TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
this.bindTexture(TextureMap.locationBlocksTexture);
float f6 = textureatlassprite2.getMinU();
float f7 = textureatlassprite2.getMinV();
float f8 = textureatlassprite2.getMaxU();
float f9 = textureatlassprite2.getMaxV();
if (i / 2 % 2 == 0) {
float f10 = f8;
f8 = f6;
f6 = f10;
}
worldrenderer.pos((double) (f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f8, (double) f9).endVertex();
worldrenderer.pos((double) (-f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f6, (double) f9).endVertex();
worldrenderer.pos((double) (-f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f6, (double) f7).endVertex();
worldrenderer.pos((double) (f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f8, (double) f7).endVertex();
f3 -= 0.45F;
f4 -= 0.45F;
f1 *= 0.9F;
f5 += 0.03F;
++i;
}
tessellator.draw();
GlStateManager.popMatrix();
GlStateManager.enableLighting();
}
Aggregations