/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/render/tileentity/RenderRotationTester.java
47 строк
1 KB
HbmMods
let's just hope that didn't break everything
22 июн 2020, 22:31
22 июн 2020, 22:31
bdc0cd4
Код
Авторство
О чём код?
package com.hbm.render.tileentity; import org.lwjgl.opengl.GL11; import com.hbm.lib.RefStrings; import com.hbm.render.model.ModelRotationTester; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class RenderRotationTester extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":" + "textures/blocks/test_container.png"); private ModelRotationTester model; public RenderRotationTester() { this.model = new ModelRotationTester(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); switch(tileentity.getBlockMetadata()) { case 5: GL11.glRotatef(90, 0F, 1F, 0F); break; case 3: GL11.glRotatef(180, 0F, 1F, 0F); break; case 4: GL11.glRotatef(270, 0F, 1F, 0F); break; case 2: GL11.glRotatef(0, 0F, 1F, 0F); break; } this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } }