2016-02-20 15:23:03 +01:00
|
|
|
/*
|
|
|
|
* This file ("GuiBooklet.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
|
|
|
* http://ellpeck.de/actaddlicense/
|
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
|
|
|
* © 2016 Ellpeck
|
|
|
|
*/
|
|
|
|
|
|
|
|
package de.ellpeck.actuallyadditions.mod.blocks.render;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
2016-02-20 21:25:18 +01:00
|
|
|
import net.minecraft.client.Minecraft;
|
2016-02-20 15:23:03 +01:00
|
|
|
import net.minecraft.client.renderer.GlStateManager;
|
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.init.Blocks;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
|
|
|
|
public class RenderCompost extends TileEntitySpecialRenderer{
|
|
|
|
|
|
|
|
@Override
|
2016-02-20 16:16:41 +01:00
|
|
|
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage){
|
2016-02-20 15:23:03 +01:00
|
|
|
if(te instanceof TileEntityCompost){
|
2016-02-20 16:16:41 +01:00
|
|
|
TileEntityCompost compost = (TileEntityCompost)te;
|
2016-02-20 15:23:03 +01:00
|
|
|
if(compost.getStackInSlot(0) != null){
|
2016-02-20 16:16:41 +01:00
|
|
|
float i = compost.getAmount()/TileEntityCompost.AMOUNT;
|
2016-02-20 15:23:03 +01:00
|
|
|
GlStateManager.pushMatrix();
|
2016-02-20 16:16:41 +01:00
|
|
|
GlStateManager.translate((float)x+0.5F, (float)y+(i/3F)+0.01F, (float)z+0.5F);
|
2016-02-20 21:25:18 +01:00
|
|
|
//Hehe
|
|
|
|
if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){
|
|
|
|
GlStateManager.translate(0F, 1F, 0F);
|
|
|
|
}
|
2016-02-20 15:23:03 +01:00
|
|
|
GlStateManager.scale(1.5F, i, 1.5F);
|
2016-04-20 21:39:03 +02:00
|
|
|
AssetUtil.renderBlockInWorld(Blocks.DIRT, compost.getStackInSlot(0).getItem() == InitItems.itemFertilizer ? 1 : 0);
|
2016-02-20 15:23:03 +01:00
|
|
|
GlStateManager.popMatrix();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|