mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-09-28 20:01:05 +02:00
3f70981076
Crafting, Textures, In- and Output etc. done!
65 lines
No EOL
3.1 KiB
Java
65 lines
No EOL
3.1 KiB
Java
package ellpeck.someprettyrandomstuff.inventory;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import ellpeck.someprettyrandomstuff.tile.TileEntityBase;
|
|
import ellpeck.someprettyrandomstuff.tile.TileEntityFeeder;
|
|
import ellpeck.someprettyrandomstuff.util.Util;
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
import net.minecraft.util.ResourceLocation;
|
|
import net.minecraft.util.StatCollector;
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
import java.util.Arrays;
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
public class GuiFeeder extends GuiContainer{
|
|
|
|
private static final ResourceLocation resLoc = Util.getGuiLocation("guiFeeder");
|
|
private TileEntityFeeder tileFeeder;
|
|
|
|
public int loveCounter;
|
|
|
|
public GuiFeeder(InventoryPlayer inventory, TileEntityBase tile){
|
|
super(new ContainerFeeder(inventory, tile));
|
|
this.tileFeeder = (TileEntityFeeder)tile;
|
|
this.xSize = 176;
|
|
this.ySize = 70+86;
|
|
}
|
|
|
|
@Override
|
|
public void drawGuiContainerBackgroundLayer(float f, int x, int y){
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
this.mc.getTextureManager().bindTexture(Util.GUI_INVENTORY_LOCATION);
|
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86);
|
|
this.mc.getTextureManager().bindTexture(resLoc);
|
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 70);
|
|
|
|
if(this.tileFeeder.currentTimer > 0){
|
|
int i = this.tileFeeder.getCurrentTimerToScale(22);
|
|
this.drawTexturedModalRect(guiLeft + 80, guiTop + 42 - i, 176, 16 + 22 - i, 16, 22);
|
|
}
|
|
|
|
if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < this.tileFeeder.animalThreshold) this.drawTexturedModalRect(guiLeft + 70, guiTop + 31, 192, 16, 8, 8);
|
|
|
|
if(this.tileFeeder.currentAnimalAmount >= this.tileFeeder.animalThreshold) this.drawTexturedModalRect(guiLeft + 70, guiTop + 31, 192, 24, 8, 8);
|
|
|
|
if(this.loveCounter > 0){
|
|
this.loveCounter++;
|
|
if(this.loveCounter >= 15){
|
|
this.loveCounter = 0;
|
|
}
|
|
this.drawTexturedModalRect(guiLeft + 76, guiTop + 4, 176, 0, 25, 16);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void drawScreen(int x, int y, float f){
|
|
super.drawScreen(x, y, f);
|
|
if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){
|
|
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount + " " + StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".feeder.animals.desc")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < this.tileFeeder.animalThreshold) ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".feeder.enoughToBreed.desc") : (this.tileFeeder.currentAnimalAmount >= this.tileFeeder.animalThreshold ? StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".feeder.tooMany.desc") : StatCollector.translateToLocal("info." + Util.MOD_ID_LOWER + ".feeder.notEnough.desc")))};
|
|
this.func_146283_a(Arrays.asList(array), x, y);
|
|
}
|
|
}
|
|
} |