mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Some cleanup in incense plate tesr, move red string tesr to fasttesr, remove life imbuer tesr
This commit is contained in:
1 parent
79210e484c
commit
0887f76575
4 files changed
+15
-64
No files matched your search
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
@@ -26,14 +27,11 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelIncensePlate;
|
||||
import vazkii.botania.common.block.tile.TileIncensePlate;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncensePlate> {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
};
|
||||
|
||||
ResourceLocation texture = new ResourceLocation(LibResources.MODEL_INCENSE_PLATE);
|
||||
ModelIncensePlate model = new ModelIncensePlate();
|
||||
private static final Map<EnumFacing, Integer> ROTATIONS = ImmutableMap.of(EnumFacing.NORTH, 180, EnumFacing.SOUTH, 0, EnumFacing.WEST, 270, EnumFacing.EAST, 90);
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
|
||||
@@ -45,27 +43,17 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
// Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS[Math.max(Math.min(ROTATIONS.length, facing.getIndex() - 2), 0)], 0F, 1F, 0F);
|
||||
// model.render();
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.rotate(ROTATIONS.get(facing), 0F, 1F, 0F);
|
||||
|
||||
ItemStack stack = plate.getStackInSlot(0);
|
||||
if(stack != null) {
|
||||
GlStateManager.pushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
float s = 0.4F;
|
||||
GlStateManager.translate(-0.075F, -1.25F, 0F);
|
||||
GlStateManager.scale(s, s, s);
|
||||
//GlStateManager.rotate(180F, 0F, 1F, 0F);
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.GROUND);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
@@ -10,15 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraftforge.client.model.animation.FastTESR;
|
||||
import vazkii.botania.client.core.handler.RedStringRenderer;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
|
||||
public class RenderTileRedString extends TileEntitySpecialRenderer<TileRedString> {
|
||||
public class RenderTileRedString extends FastTESR<TileRedString> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileRedString trs, double x, double y, double z, float partticks, int digProgress) {
|
||||
public void renderTileEntityFast(TileRedString trs, double x, double y, double z, float partialTicks, int destroyStage, WorldRenderer worldRenderer) {
|
||||
RedStringRenderer.redStringTiles.add(trs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 5:46:10 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelSpawnerClaw;
|
||||
|
||||
public class RenderTileSpawnerClaw extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPAWNER_CLAW);
|
||||
private static final ModelSpawnerClaw model = new ModelSpawnerClaw();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8, int digProgress) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.translate(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
|
||||
GlStateManager.translate(0.5F, 1.5F, 0.5F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
|
||||
model.render();
|
||||
GlStateManager.color(1F, 1F, 1F);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -90,4 +90,9 @@ public abstract class TileRedString extends TileMod implements ITileBound {
|
||||
return binding == null ? Blocks.air : worldObj.getBlockState(binding).getBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFastRenderer() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user