/*создаю чакру(ману) и полоску которая будет показывать сколько ее есть и максимальное ее количество .Во всех остальных файлах все */нормально.
Java:
package RastabiusWolfs.NinjaWorld;
import java.lang.annotation.ElementType;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
//Просит переименовать Side
@SideOnly(Side.CLIENT)
public class GuiChacraBar extends Gui
{
private Minecraft mc;
private static final ResourceLocation texturepath = new ResourceLocation("ninjaworld", "textures/gui/mana_bar.png");
public GuiChacraBar(Minecraft mc)
{
super();
this.mc = mc;
}
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent event)
{
//Просить переименовать EXPERIANCE
if (event.isCancelable() || event.type != ElementType.EXPERIANCE)
{
return;
}
ExtendedPlayer props = ExtendedPlayer.get(this.mc.thePlayer);
if (props == null || props.getMaxChacra() == 0)
{
return;
}
int xPos = 2;
int yPos = 2;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
this.mc.getTextureManager().bindTexture(texturepath);
this.drawTexturedModalRect(xPos, yPos, 0, 0, 50, 4);
int chacrabarwidth = (int)(((float) props.getCurrentChacra() / props.getMaxChacra()) * 25);
System.out.println("[GUI CHACRA] Current chacra bar width: " + chacrabarwidth);
this.drawTexturedModalRect(xPos, yPos + 1, 0, 4, chacrabarwidth, 2);
}
}
Последнее редактирование модератором: