Jump to content

[1.8] Aligning cuztome info gui to the bottom left Corner of waw


perromercenary00

Recommended Posts

good days

little hard to explain english is not mi native languague

 

 

in the past i create a custom gui not like the one that come when you open a chest but the kind that is always visible in screen this

to show the gun munition and stats, it suppost to allways stay in to the botom left corner no mather the value of  int guiscale=mc.gameSettings.guiScale; was

 

but no luck  minecraft is not just using this values and must be another elements afecting the final positition of the mi gui resulting in missplace

 

3 values im using to position mi gui are

 

                                guiscale=mc.gameSettings.guiScale;

                displayWidth=mc.displayWidth;

                displayHeight=mc.displayHeight;

width and height are correct,  i test them agains the output of xwininfo in linux

 

 

here a little example for testing i set mi gui to draw allways starting at 10% of displayWidth  and 10% of displayHeight

 

        posX=(int)(displayHeight * 0.1); // gui X position

                posY=(int)(displayWidth * 0.1);  // gui Y position

 

so it must allways stay on upper left corner but the result is far from upper left must of the time and is afected more than espected by windows size and guiscale

https://drive.google.com/file/d/0B8sU_NyZQBd7bFVId0lyaDNTNUE/view?usp=sharing

view?usp=sharing

 

https://drive.google.com/file/d/0B8sU_NyZQBd7OHR2SmV4bXBRb3M/view?usp=sharing

view?usp=sharing

 

the closest to expected is when guiscale = 1

 

//#####

i remenber this from long old topic i dont find but that time and i could not solvet it that time

 

when i solved this i gona use this to set the position of butons also missplaced in another gui but for a bag pack   

 

 

can you help mi hwith this

 

thanks for reading

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

package mercenarymod.gui;

import mercenarymod.Mercenary;
import mercenarymod.items.MercenaryModItems;
import mercenarymod.utilidades.chat;
import mercenarymod.utilidades.util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;

public class NotificationMercenaria extends Gui {
private static Minecraft mc;
private int posX = 0, posY = 0, mulY = -1;

private int displayWidth = 0;
private int displayHeight = 0;

private int guiscale = 0;
private int x = 0; // gui size
private float xf = x + 0.0F;
private float balas = 0;
private int tipoBalas = 0;

private static long systemTime = 0;
private static int graficaltick = 0; // conteo para sincronizar las
										// animaciones con el mundo local
private static int conteo = 0; // conteo para llevar los tiempos en que se
								// actualiza la gui
private static int conteo100 = 0; // conteo para ciclar las texturas en los
									// items
private static int conteo200 = 0; // conteo para ciclar las texturas en los
									// items

private static int vlmunicion = 0; // conteo para llevar la cuenta del
									// consumo de redstone
private static boolean permitirVlmunicion = true; // conteo para evitar que
													// vlmunicion cuente mas
													// de una vez por tick

private static int lconteo = 0; // conteo para llevar el tiempo que se
								// presion click izquierdo
private static int rconteo = 0; // conteo para llevar el tiempo que se
								// presion click izquierdo

private static int mensage00 = 0;

private static boolean permitirLdisparo2s = true; // conteo para evitar que
													// se dispare mas de una
													// granada en 2 seg
private int permitirLdisparo2sConteo = 0;// conteo para la variable anterior

private static boolean permitirSonido = true; // conteo para evitar que el
												// mismo sonido se ejecute
												// mas de una vez por tick
private static boolean permitirMensaje = true;

private String icono0 = "modmercenario:textures/items/gui/transparencia.png";// transparencia
private String icono1 = "modmercenario:textures/items/gui/transparencia.png";// transparencia
private String icono2 = "modmercenario:textures/items/gui/transparencia.png";// transparencia
private String icono3 = "modmercenario:textures/items/gui/transparencia.png";// transparencia
private String icono4 = "modmercenario:textures/items/gui/transparencia.png";// transparencia
private String icono5 = "modmercenario:textures/items/gui/transparencia.png";// transparencia

boolean transparencia = true;

private int metadata = 0;
private int municion = 0;
private int municionmaxima = 0;
private int municiondisponible = 0;
private int tipomunicion = 0;
private int tipomunicionDisplay = 0;
private int tipocargador = 0;
private int tipocargadormax = 0;

private int tipodisparo = 0;
private int tipodisparomax = 0;

private boolean habilitado = false;
private boolean recargando = false;

private boolean descargar = false;
private boolean descargando = false;
private boolean remplazando = false;

private boolean reload = false;
private boolean cargar = false;
private boolean shoot = false;
private boolean unload = false;
private float strength = 0.0F;
private boolean enable = false;

private static int texturajson = 0;
private static int accion = 0;

private String text0 = "";

public NotificationMercenaria(Minecraft mc, Configuration config) {
	super();
	this.mc = mc;

	displayWidth = mc.displayWidth;
	displayHeight = mc.displayHeight;

	x = 40; // gui size

}

// ####################################################################################################################3
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRender(RenderGameOverlayEvent event) {
	// Render above the chat
	if (event.isCancelable() || event.type != RenderGameOverlayEvent.ElementType.ALL)
		return;
	// Render only if there's a new notification
	// if (step == -1) return;

	conteo++;

	if ((conteo % 20) == 0 & Mercenary.getGuiOn()) {
		int modo = 0;



		EntityPlayer playerIn = mc.thePlayer;
		int hand = playerIn.inventory.currentItem;
		ItemStack stack0 = playerIn.inventory.getCurrentItem();

		icono0 = "modmercenario:textures/items/gui/transparencia.png";
		icono1 = "modmercenario:textures/items/gui/transparencia.png";
		icono2 = "modmercenario:textures/items/gui/transparencia.png";
		icono3 = "modmercenario:textures/items/gui/transparencia.png";
		icono4 = "modmercenario:textures/items/gui/transparencia.png";
		icono5 = "modmercenario:textures/items/gui/transparencia.png";
		text0 = "";
		tipomunicionDisplay = 0;


            metadata = stack0.getMetadata();
            municion = getInttag(stack0, "municion");
            municionmaxima =getInttag(stack0, "municionmaxima");
            municiondisponible=getInttag(stack0, "municiondisponible");
            tipomunicion=getInttag(stack0, "tipomunicion");
            tipocargador=getInttag(stack0, "tipocargador");
            tipocargadormax=getInttag(stack0, "tipocargadormax");

    		tipodisparo=getInttag(stack0, "tipodisparo");
	    	tipodisparomax=getInttag(stack0, "tipodisparomax");

		    reload= getBooleantag(stack0, "reload");
		    cargar= getBooleantag(stack0, "cargar");
		    shoot= getBooleantag(stack0, "shoot");
		    unload= getBooleantag(stack0, "unload");
		    strength=getFloattag(stack0, "strength");
		    enable= getBooleantag(stack0, "enable");
        
		    habilitado= getBooleantag(stack0, "habilitado");
		    recargando= getBooleantag(stack0, "recargando");
		    descargar= getBooleantag(stack0, "descargar");
		    descargando= getBooleantag(stack0, "descargando");
		    remplazando= getBooleantag(stack0, "remplazando");
		    
		    int lmunicion = getInttag(stack0, "lmunicion");
		    int ltipomunicion=getInttag(stack0, "ltipomunicion");


		if (stack0 != null) {
			Item item0 = stack0.getItem();
			boolean transparencia = true;

			NBTTagCompound etiquetas = stack0.getTagCompound();
			if (etiquetas != null) { // nbt
				// boolean ex=etiquetas.getBoolean(tag);

				// System.out.println("item0="+item0.getUnlocalizedName());

				if (unload) {
					modo = 1;
				}

				if (tipocargador <= 0) {
					modo = 2;
				}

				// ########################
				if (item0.equals(MercenaryModItems.cargador45acp)) {

					switch (tipomunicion) {
					case 0:
						icono5 = "modmercenario:textures/items/gui/transparencia.png";
						break;
					case 1:
						icono5 = "modmercenario:textures/items/gui/A.png";
						break;
					case 2:
						icono5 = "modmercenario:textures/items/gui/R.png";
						break;
					case 3:
						icono5 = "modmercenario:textures/items/gui/O.png";
						break;
					}

					switch (tipocargador) {
					case 1:
						icono0 = "modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CC_icono.png";
						break;
					case 2:
						icono0 = "modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CL_icono.png";
						break;
					case 3:
						icono0 = "modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CG_icono.png";
						break;
					}

					if (descargar | descargando) {
						switch (tipocargador) {
						case 1:
							icono0 = "modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CC_iconoInv.png";
							break;
						case 2:
							icono0 = "modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CL_iconoInv.png";
							break;
						case 3:
							icono0 = "modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CG_iconoInv.png";
							break;
						}
						// icono4="modmercenario:textures/items/gui/transparencia.png";
						// icono5="modmercenario:textures/items/gui/transparencia.png";
					}

					switch (tipomunicion) {
					case 1:
						tipomunicionDisplay = 8;
						break;
					case 2:
						tipomunicionDisplay = 9;
						break;
					case 3:
						tipomunicionDisplay = 10;
						break;
					}

					text0 = "" + municion + " / " + municionmaxima;
					transparencia = false;

					switch (tipomunicion) {
					case 1:
						icono1 = "modmercenario:textures/items/gui/botones_ARO_A.png";
						break;
					case 2:
						icono1 = "modmercenario:textures/items/gui/botones_ARO_R.png";
						break;
					case 3:
						icono1 = "modmercenario:textures/items/gui/botones_ARO_O.png";
						break;
					}

					icono3 = "modmercenario:textures/items/gui/botones.png";

				}

				// ########################
				if ((item0.equals(MercenaryModItems.pistolaSocom))
						| (item0.equals(MercenaryModItems.pistolaSocomS))) {
					switch (tipomunicion) {
					case 0:
						icono5 = "modmercenario:textures/items/gui/transparencia.png";
						break;
					case 1:
						icono5 = "modmercenario:textures/items/gui/A.png";
						break;
					case 2:
						icono5 = "modmercenario:textures/items/gui/R.png";
						break;
					case 3:
						icono5 = "modmercenario:textures/items/gui/O.png";
						break;
					}

					icono0 = "modmercenario:textures/items/armasdefuego/armas45cal/socom_icono.png";

					if (recargando | descargando | remplazando) {
						icono0 = "modmercenario:textures/items/armasdefuego/armas45cal/socom_iconoInv.png";
						icono4 = "modmercenario:textures/items/gui/transparencia.png";
						icono5 = "modmercenario:textures/items/gui/transparencia.png";
					}

					transparencia = false;
					text0 = "" + municion + "/" + municionmaxima;

					switch (tipodisparo) {
					case 2:
						icono1 = "modmercenario:textures/items/gui/auto.png";
						break;
					case 0:
						icono1 = "modmercenario:textures/items/gui/manual.png";
						break;
					case 1:
						icono1 = "modmercenario:textures/items/gui/semiAuto.png";
						break;
					}

					// icono1="modmercenario:textures/items/gui/manualO.png";
					icono3 = "modmercenario:textures/items/gui/botonesAsterisco.png";

					switch (tipomunicion) {
					case 1:
						tipomunicionDisplay = 8;
						break;
					case 2:
						tipomunicionDisplay = 9;
						break;
					case 3:
						tipomunicionDisplay = 10;
						break;
					}

				}

				// ##########################################################################################

			} // nbttag
		} // (stack0 != null)

		displayWidth = mc.displayWidth;
		displayHeight = mc.displayHeight;
		guiscale = mc.gameSettings.guiScale;

		System.out.println("guiscale=" + guiscale);
		System.out.println("displayWidth=" + displayWidth);
		System.out.println("displayHeight=" + displayHeight);
		System.out.println("displayHeight=(" + (displayHeight / 2) + ")");

		System.out.println("\n\n\n");


		switch (guiscale) {
		case 0: // mid
		{
			posX = 30; // controls the gui size
			posY = (displayHeight / 2);// -60 (displayHeight - 120);
			x = 40; // gui size
		}
			;
			break;

		case 3: // grande
		{
			posX = 16; // controls the gui size
			posY = ((int) (displayHeight * 0.25F));
			x = 40; // gui size
		}
			;
			break;

		case 2: // mid
		{
			posX = (int) (displayHeight * 0.1); // 30; //controls the gui
												// size
			posY = (int) (displayWidth * 0.1); // (displayHeight - 120);
			x = 40; // gui size
		}
			;
			break;

		case 1: // little
		{
			posX = 16; // controls the gui size
			posY = (int) (displayHeight * 0.95F); // ((displayHeight)-100);
			x = 10; // gui size
		}
			;
			break;
		/*
		 * guiscale=1 displayWidth=1680 displayHeight=970
		 * displayHeight=(850)
		 */

		}

################################################
################################################
################################################
################################################


//here is where im seting the gui position


		posX = (int) (displayHeight * 0.1); // controls the gui X position
		posY = (int) (displayWidth * 0.1); // controls the gui Y position
		x = 40; // gui size

		switch (tipomunicionDisplay) {
		case 0:
			icono2 = "modmercenario:textures/items/gui/transparencia.png";
			break;
		case 1:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraRedStone.png";
			break;

		case 2:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraBala9mmA.png";
			break;
		case 3:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraBala9mmR.png";
			break;
		case 4:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraBala9mmO.png";
			break;

		case 5:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraBala5728mm_acero.png";
			break;
		case 6:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraBala5728mm_redstone.png";
			break;
		case 7:
			icono2 = "modmercenario:textures/items/armasdefuego/balas/barraBala5728mm_obsidiana.png";
			break;

		}

		// el ancho de la barra al que equivale cada unidad de municion
		switch (tipomunicionDisplay) {
		default:
			balas = 32.0F;
			break;
		case 1:
			balas = 256.0F;
			break;
		case 8:
		case 9:
		case 10:
		case 11:
		case 12:
		case 13:
		case 17:
		case 18:
		case 19:
			balas = 16.0F;
			break;
		}

		xf = x + 0.0F;

	} // ( (conteo%20)==0 )

	// Prepare rendering
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
	GL11.glDisable(GL11.GL_LIGHTING);

	if (municion < 0) {
		municion = 0;
	}

	if (Mercenary.getGuiOn()) {

		// drawModalRectWithCustomSizedtexture(int x, int y,float u,float
		// v,int width,int height,float textureWidth,float textureHeight);

		this.mc.renderEngine.bindTexture(new ResourceLocation(icono0));
		this.drawModalRectWithCustomSizedTexture((posX - 5), (posY), 0.0F, 0.0F, x, x, xf, xf); // imagen
																								// al
																								// 60%
		// this.drawModalRectWithCustomSizedtexture(posX + 8, posY + 8,
		// 0.0F, 0.0F, 200, 200 , 200.0F, 200.0F);

		this.mc.renderEngine.bindTexture(new ResourceLocation(icono1));
		this.drawModalRectWithCustomSizedTexture((posX + x), (posY), 0.0F, 0.0F, (int) (x * 1.5), (x / 3),
				(xf * 1.5F), (xf / 3)); // imagen al 60%

		this.mc.renderEngine.bindTexture(new ResourceLocation(icono2));
		this.drawModalRectWithCustomSizedTexture((posX + x), (posY + (x / 3)), 0.0F, 0.0F,
				(int) (((x * 1.0) / balas) * municion), (x / 3), (xf * 1.0F), (xf / 3));

		this.mc.renderEngine.bindTexture(new ResourceLocation(icono3));
		this.drawModalRectWithCustomSizedTexture((posX + x), (posY + ((x / 3) * 2)), 0.0F, 0.0F, (int) (x * 1.5),
				(x / 3), (xf * 1.5F), (xf / 3));

		this.mc.renderEngine.bindTexture(new ResourceLocation(icono4));
		this.drawModalRectWithCustomSizedTexture((posX - 5), (posY), 0.0F, 0.0F, x, x / 2, xf, xf / 2); // imagen
																										// al
																										// 60%

		this.mc.renderEngine.bindTexture(new ResourceLocation(icono5));
		this.drawModalRectWithCustomSizedTexture((posX - 5), (posY + (x / 2)), 0.0F, 0.0F, x, x / 2, xf, xf / 2); // imagen
																													// al
																													// 60%

		this.mc.fontRendererObj.drawStringWithShadow(text0, posX, ((posY) + x), 0xffcccccc);
		// this.mc.fontRendererObj.drawStringWithShadow(text0, posX + 32 +
		// 8, posX + 8, 0xffcccccc);

	}

}
// ####################################################################################################################3

// ####################################################################################################################3
}// fin de la classe

           

Link to comment
Share on other sites

I don't see a problem with what you are doing:

 

posX=(int)(displayHeight * 0.1)

 

I am doing the same in a mod I am currently working on to do percentage layouts as well.

 

Have you tried writing the positions to the log along with the screen width values?  What does it say when the position appears wrong on the screen for:

 

1. The position of your gui element

2. The width of the screen

Link to comment
Share on other sites

 

well  i actually leave this in a  (deje así)  state

and work arounded using the things i learn whith the questions in this other post

http://www.minecraftforge.net/forum/index.php/topic,35931.0.html

 

 

#####

Have you tried writing the positions to the log along with the screen width values?  What does it say when the position appears wrong on the screen for:

 

1. The position of your gui element

2. The width of the screen

#####

 

yes but i want the gui to keep aligned whith corner all the time, when windowed when maximaxed or when full screen

 

hand coded the closest values to what i want are the ones from

            switch(guiscale)
            {
            case 0: 
            {
            	posX=10; 
                posY= 200;
                //x=30;  
            } ;break;
            
            case 3:
            {
            	posX=10;//( (int) (displayWidth  * 0.025F) ); //30 controls the gui size
                posY=( (int) (displayHeight * 0.30F) );
                //x=40;  //gui size    
            } ;break;
            
            case 2:
            {
            	posX=10;//( (int) (displayWidth  * 0.025F) ); //30 controls the gui size
                posY=( (int) (displayHeight * 0.45F) );
                //x=40;  //gui size    
            } ;break;
            
            case 1:
            {
            	posX=10;//( (int) (displayWidth  * 0.05F) ); //16; //controls the gui size
                posY=( (int)(displayHeight * 0.92F));
                //x=40;  //gui size    
            } ;break;
            
            
            }

 

but if you changes whindows mode or size the gui some times to ends to much up, some times half out of the botom

 

for what i learn scavenguin the code from other moders 

i theorized than for this case and only this gui type, minecraft internally is using his own values to set

the elements in the window totally ignoring the values from displayWidth and displayHeight

 

a bether try to explain this

i put some buttons in another gui to manually move the guns gui position 

and whit this buttons move the gui to the upper right corner soo i could know the trully values of height and width

and looks like

 

width=800 height=500http://s11.postimg.org/65jvxnedv/Pantallazo_25.png[/img]

 

defaults windowed at 854x480

when: guiscale=0 

displayWidth=854

displayHeight=480   

 

posX=415

posY=238

 

the truly window size is like 420 x 240

 

 

set guiscale to 1 the gui is now in middle so manully set it again to upper right

when: guiscale=1

displayWidth=854

displayHeight=480   

 

posX=845

posY=458

 

when: guiscale=1 the true size is like 460 x 480  but the real windows size has not change still at 854x480

 

now whithout changing nothing i maximaxed the window

and mi gui goes to the center again and whoa the numbers change again

 

guiscale=1

displayWidth=1680

displayHeight=970

 

posX=928  //i supouse thiis diferent coz the posX= ( (int) (displayWidth  * 0.1F) );

posY=507

 

so i manually move the gui to bottom right again

posX=1668

posY=957

 

and now looks like the real value is the same as displayWidth and displayHeight

 

 

 

###

Well the is no patron here the real internal size width height  values are diferent from the one i get

from displayWidth displayHeight

and values are afected by the guiscale value and the real window size and mode

 

in the other type of gui the one we use to make the chest like guis take this values from the gui class

 

    /** The width of the screen object. */

    public int width;

    /** The height of the screen object. */

    public int height;

 

but when i call this values from mi gun gui this returns allways zeros and mi gui class is extending GuiScreen and that one is  extends Gui

 

 

public class NotificationMercenaria extends GuiScreen // Gui

 

            System.out.println("this.width ="+this.width);

            System.out.println("this.height="+this.height);

 

returns

[10:44:12][mercenarymod.gui.NotificationMercenaria:onRender:1963]: this.width =0

[10:44:12][mercenarymod.gui.NotificationMercenaria:onRender:1964]: this.height=0

 

well i also change mi class to extends Gui but no look it still returns zeroes

public class NotificationMercenaria extends Gui

 

jummmmm

 

well i alredy leave this issue in (deje así) state I just set some buttons for the user to manually set gui position to wherever he/her/it wants

 

but it would be nine to know how to get the internal windows size values are

 

############

 

well this has become to long

 

 

this is testing code in mi gui class

            displayWidth=mc.displayWidth;
            displayHeight=mc.displayHeight;
            guiscale=mc.gameSettings.guiScale;            
                      
            System.out.println("guiscale="+guiscale);
            System.out.println("displayWidth="+displayWidth);
            System.out.println("displayHeight="+displayHeight);
            
            posX= ( (int) (displayWidth  * 0.1F) );
            posY= ( (int) (displayHeight * 0.1F) );
            
            //Offset added for the gui whit the buttons
            posX = posX + ppx;
            posY = posY + ppy;
            
            System.out.println("posX="+posX );
            System.out.println("posY="+posY );
            
            System.out.println("\n\n\n" ); 

 

 

console output

[10:12:05] [Client thread/INFO] [sTDOUT]: [mercenarymod.gui.NotificationMercenaria:onRender:1952]: guiscale=0
[10:12:05] [Client thread/INFO] [sTDOUT]: [mercenarymod.gui.NotificationMercenaria:onRender:1953]: displayWidth=854
[10:12:05] [Client thread/INFO] [sTDOUT]: [mercenarymod.gui.NotificationMercenaria:onRender:1954]: displayHeight=480
[10:12:05] [Client thread/INFO] [sTDOUT]: [mercenarymod.gui.NotificationMercenaria:onRender:2006]: posX=415
[10:12:05] [Client thread/INFO] [sTDOUT]: [mercenarymod.gui.NotificationMercenaria:onRender:2007]: posY=238

 

 

 

and this is the full guns gui class

 

thanks fro reading

 

ther is other things in this class but relevant code come from the 1890 line

package mercenarymod.gui;

import mercenarymod.Mercenary;
import mercenarymod.items.MercenaryModItems;
import mercenarymod.utilidades.chat;
import mercenarymod.utilidades.util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.Color;
import org.lwjgl.util.ReadableColor;

public class NotificationMercenaria extends GuiScreen // Gui
{
    private static Minecraft mc;
    private static int posX=0;
private static int posY=0;
private int mulY=-1;
    
    private int displayWidth=0;
    private int displayHeight=0;
    
    public static int ppx=0;
    public static int ppy=0;
    
    private static int guiTick = 0;
    
    
    private int guiscale=0;
    public static int x=30;  //gui size
    private static float xf=x+0.0F; 
    private float balas=0;
    private int tipoBalas=0;
    
    private static long systemTime=0;
    private static int graficaltick=0; //conteo para sincronizar las animaciones con el mundo local 
    private static int conteo=0;  //conteo para llevar los tiempos en que se actualiza la gui
    private static int conteo100=0; //conteo para ciclar las texturas en los items
    private static int conteo200=0; //conteo para ciclar las texturas en los items
    
    private static int vlmunicion=0; //conteo para llevar la cuenta del consumo de redstone
    private static boolean permitirVlmunicion=true; //conteo para evitar que vlmunicion cuente mas de una vez por tick
    
    private static int lconteo=0;  //conteo para llevar el tiempo que se presion click izquierdo
    private static int rconteo=0;  //conteo para llevar el tiempo que se presion click izquierdo
    
    private static int mensage00=0;
    
    private static boolean permitirLdisparo2s =true; //conteo para evitar que se dispare mas de una granada en 2 seg 
    private int permitirLdisparo2sConteo=0;//conteo para la variable anterior
    
    private static boolean permitirSonido=true; //conteo para evitar que el mismo sonido se ejecute mas de una vez por tick 
    private static boolean permitirMensaje=true;
    
    private String icono0="modmercenario:textures/items/gui/transparencia.png";//transparencia
    private String icono1="modmercenario:textures/items/gui/transparencia.png";//transparencia
    private String icono2="modmercenario:textures/items/gui/transparencia.png";//transparencia
    private String icono3="modmercenario:textures/items/gui/transparencia.png";//transparencia
    private String icono4="modmercenario:textures/items/gui/transparencia.png";//transparencia
    private String icono5="modmercenario:textures/items/gui/transparencia.png";//transparencia
    
    
    boolean transparencia=true;
    
    private int metadata=0;
    private int municion =0;
    private int municionmaxima =0;
    private int municiondisponible=0;
    private int tipomunicion=0;
    private int tipomunicionDisplay=0;
    private int tipocargador=0;
    private int tipocargadormax=0;

    private int tipodisparo=0;
    private int tipodisparomax=0;
  

private boolean habilitado=false;
    private boolean recargando=false;
    
    private boolean descargar=false;
    private boolean descargando=false;
    private boolean remplazando=false;

    private boolean reload=false;
    private boolean cargar=false;
    private boolean shoot=false;
    private boolean unload=false;
    private float strength=0.0F;
    private boolean enable=false;
    
    private static int texturajson = 0;
    private static int accion = 0;
    
    private String text0 = "";
    
    private static Configuration configFile;
    
    
    public NotificationMercenaria(Minecraft mc) 
    {
        super();
        this.mc = mc;
        
        
        this.configFile = Mercenary.getConfigFile();
        
        
        if (configFile != null){

	Property cfg_guiX = configFile.get("Gui", "Gui pos X", 0, "posicion x de la gui");
	Property cfg_guiY = configFile.get("Gui", "Gui pos Y", 0, "posicion y de la gui");
	Property cfg_guiSize = configFile.get("Gui", "Gui Size", 30, "Tamaño de la gui");

	// saving the configuration to its file
        //configFile.save();

	ppx = cfg_guiX.getInt(0);
	ppy = cfg_guiY.getInt(0);
	x = cfg_guiSize.getInt(30);
        }
        
        
    }
//####################################################################################################################3
    @SubscribeEvent(priority = EventPriority.NORMAL)
    public void onRender(RenderGameOverlayEvent event) 
    {
    	//Render above the chat
        if(event.isCancelable() || event.type != RenderGameOverlayEvent.ElementType.ALL) return;
        //Render only if there's a new notification
        //if (step == -1) return;

    	
        conteo++;
        
        
        if ( (conteo % 30)==0 )
        {
        	permitirMensaje = true;
        }
        
        if ( (conteo%4)==0 )//systemTime
        {
           	conteo100 ++;
           	graficaltick ++;
           	
        	permitirSonido=true;
        	permitirVlmunicion=true;

        	
        	if (Mouse.isButtonDown(0) & (Minecraft.getMinecraft().currentScreen == null) )
        	{
        		lconteo +=4;
        	}
        	else
        	{
        		lconteo= 0 ;
        	}	
        	
        	if (Mouse.isButtonDown(1) & (Minecraft.getMinecraft().currentScreen == null) )
        	{
        		rconteo +=4;
        	}
        	else
        	{
        		rconteo= 0 ;
        	}	
        	
        	
        }
        
        
        if(!permitirLdisparo2s){
        
        	permitirLdisparo2sConteo ++;	
        	
        	if (permitirLdisparo2sConteo > 10 ){
        		permitirLdisparo2sConteo=0;
        		permitirLdisparo2s=true;
            }
        
        }
        
    
        
        
        
        if ( (conteo%20)==0 & Mercenary.getGuiOn() )
        {
        int modo=0;
        
        	if (conteo > 20000)
        	{
        		conteo=0;
        	}
        	
          	if (guiTick > 0)
        	{
        		guiTick--;
        	}

  
        	//tckin para controlar las animaciones
        	if (conteo100 > 20000)
        	{
        	conteo100=0;
        	}
        
        
        EntityPlayer playerIn=mc.thePlayer;
        int         hand = playerIn.inventory.currentItem;
        ItemStack stack0 = playerIn.inventory.getCurrentItem();
        
    	icono0="modmercenario:textures/items/gui/transparencia.png";
    	icono1="modmercenario:textures/items/gui/transparencia.png";
    	icono2="modmercenario:textures/items/gui/transparencia.png";
    	icono3="modmercenario:textures/items/gui/transparencia.png";
    	icono4="modmercenario:textures/items/gui/transparencia.png";
    	icono5="modmercenario:textures/items/gui/transparencia.png";
    	text0="";
    	tipomunicionDisplay=0;	

        
            if (stack0 != null )
            {
       	    Item       item0 = stack0.getItem();
            boolean transparencia=true;
            
                      	
            	NBTTagCompound etiquetas = stack0.getTagCompound();
            	if (etiquetas != null)
            	{   
         
            
            metadata = stack0.getMetadata();
            municion = getInttag(stack0, "municion");
            municionmaxima =getInttag(stack0, "municionmaxima");
            municiondisponible=getInttag(stack0, "municiondisponible");
            tipomunicion=getInttag(stack0, "tipomunicion");
            tipocargador=getInttag(stack0, "tipocargador");
            tipocargadormax=getInttag(stack0, "tipocargadormax");

    		tipodisparo=getInttag(stack0, "tipodisparo");
    	tipodisparomax=getInttag(stack0, "tipodisparomax");

	    reload= getBooleantag(stack0, "reload");
	    cargar= getBooleantag(stack0, "cargar");
	    shoot= getBooleantag(stack0, "shoot");
	    unload= getBooleantag(stack0, "unload");
	    strength=getFloattag(stack0, "strength");
	    enable= getBooleantag(stack0, "enable");
        
	    habilitado= getBooleantag(stack0, "habilitado");
	    recargando= getBooleantag(stack0, "recargando");
	    descargar= getBooleantag(stack0, "descargar");
	    descargando= getBooleantag(stack0, "descargando");
	    remplazando= getBooleantag(stack0, "remplazando");
	    
	    int lmunicion = getInttag(stack0, "lmunicion");
	    int ltipomunicion=getInttag(stack0, "ltipomunicion");
	    
	        if (unload)
	        {modo=1;}
	        
	        if (tipocargador<=0)
	        {modo=2;}
	        


//########################
	        if ( item0.equals(MercenaryModItems.fusilSCARH) | item0.equals(MercenaryModItems.fusilSCARHB) | item0.equals(MercenaryModItems.fusilSCARHG) )
	        {

	        	
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/fusilscar/scarh_icono.png";
	        		
	        	if (recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/fusilscar/scarh_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}		
	        			
	        			
	        	
	        	
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
	        	icono3="modmercenario:textures/items/gui/botones.png";
	        
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=20;break;
	        	case 2:	tipomunicionDisplay=21;break;
	        	case 3:	tipomunicionDisplay=22;break;
	        	}
	        	
	        	
	        	
	        	if (item0.equals(MercenaryModItems.fusilSCARHG)){
	        		if (lmunicion > 0)
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/GA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/GR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/GO.png";break;
	        			}
	        		}	
	        		else
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/dA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/dR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/dO.png";break;
	        			}
	        		}
	        	}
	        	
	        	
	        	
	        	
	        }	
	      //########################
	        if ( item0.equals(MercenaryModItems.fusil47AK) | item0.equals(MercenaryModItems.fusil47AKB) | item0.equals(MercenaryModItems.fusil47AKG) )
	        {

	        	
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	

	        	icono0="modmercenario:textures/items/armasdefuego/fusil200ak/fusil47ak_icono.png";
	        		
	        	if (recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/fusil200ak/fusil47ak_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}		
	        			
	        			
	        	
	        	
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
	        	icono3="modmercenario:textures/items/gui/botones.png";
	        
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=20;break;
	        	case 2:	tipomunicionDisplay=21;break;
	        	case 3:	tipomunicionDisplay=22;break;
	        	}
	        	
	        	
	        	
	        	if (item0.equals(MercenaryModItems.fusil47AKG)){
	        		if (lmunicion > 0)
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/GA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/GR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/GO.png";break;
	        			}
	        		}	
	        		else
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/dA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/dR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/dO.png";break;
	        			}
	        		}
	        	}
	        	
	        	
	        	
	        	
	        } 
	        
//########################
	        if (item0.equals(MercenaryModItems.cargador76239))
	        {
	        	
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	

	        	switch (tipocargador)
	        	{
	        	case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador76239/cargador76239_CC_icono.png";break;
	        	case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador76239/cargador76239_CL_icono.png";break;
	        	case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador76239/cargador55645_CG_icono.png";break;
	        	}
	        
	        	
	        	
		      if (descargar | descargando )	
				{
		        	switch (tipocargador)
		        	{
		        	case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador76239/cargador76239_CC_iconoInv.png";break;
		        	case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador76239/cargador76239_CL_iconoInv.png";break;
		        	case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador76239/cargador76239_CG_iconoInv.png";break;
		        	}
		        		//icono4="modmercenario:textures/items/gui/transparencia.png";
		        		//icono5="modmercenario:textures/items/gui/transparencia.png";
		        }	
	        	
	        	
	        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=20;break;
		        case 2:	tipomunicionDisplay=21;break;
		        case 3:	tipomunicionDisplay=22;break;
		        }
	        	
		        text0=""+municion+" / "+municionmaxima ;
		        transparencia=false;
	        
		        switch (tipomunicion)
		        {
		        case 1:icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
		        case 2:icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
		        case 3:icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
		        }
		        	
		        icono3="modmercenario:textures/items/gui/botones.png";
	        }

            	
	        
//########################		        
	        if ( item0.equals(MercenaryModItems.fusil200AK) | item0.equals(MercenaryModItems.fusil200AKB) | item0.equals(MercenaryModItems.fusil200AKG) )
	        {
	        			        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/fusil200ak/fusil200ak_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/fusil200ak/fusil200ak_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}		
	        			
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
	        	icono3="modmercenario:textures/items/gui/botones.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=14;break;
	        	case 2:	tipomunicionDisplay=15;break;
	        	case 3:	tipomunicionDisplay=16;break;
	        	}
	        	

	        	
	        	
	        	if (item0.equals(MercenaryModItems.fusil200AKG)){
	        		if (lmunicion > 0)
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/GA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/GR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/GO.png";break;
	        			}
	        		}	
	        		else
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/dA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/dR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/dO.png";break;
	        			}
	        		}
	        	}
	    		
	    		
	    		
	    		
	    		
	        	
	        	
	        }	      
	        
//########################			        
	        
	        if ( item0.equals(MercenaryModItems.fusilM4A1) | item0.equals(MercenaryModItems.fusilM4A1B) | item0.equals(MercenaryModItems.fusilM4A1G) )
	        {



	        			        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	



	        	icono0="modmercenario:textures/items/armasdefuego/fusilm4a1/fusilm4a1_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/fusilm4a1/fusilm4a1_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}		
	        			
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
	        	icono3="modmercenario:textures/items/gui/botones.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=14;break;
	        	case 2:	tipomunicionDisplay=15;break;
	        	case 3:	tipomunicionDisplay=16;break;
	        	}
	        	

	        	
	        	
	        	if (item0.equals(MercenaryModItems.fusilM4A1G)){
	        		if (lmunicion > 0)
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/GA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/GR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/GO.png";break;
	        			}
	        		}	
	        		else
	        		{
	        			switch (ltipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/dA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/dR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/dO.png";break;
	        			}
	        		}
	        	}
	    		
	    		
	    		
	    		
	    		
	        	
	        	
	        }		
	        
	        
	        
//########################		        
	        if (item0.equals(MercenaryModItems.cargador5728))
	        {
	        			        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	

	        	switch (tipocargador)
	        	{
	        	case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador5728/cargador5728_CC_icono.png";break;
	        	case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador5728/cargador5728_CL_icono.png";break;
	        	case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador5728/cargador5728_CG_icono.png";break;
	        	}
	        			        
	        	
	        	
		      if (descargar | descargando )	
				{
		        	switch (tipocargador)
		        	{
	        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador5728/cargador5728_CC_iconoInv.png";break;
	        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador5728/cargador5728_CL_iconoInv.png";break;
	        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador5728/cargador5728_CG_iconoInv.png";break;
		        	}

		        }	
	        	
	        	
	        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=5;break;
		        case 2:	tipomunicionDisplay=6;break;
		        case 3:	tipomunicionDisplay=7;break;
		        }
	        	
		        text0=""+municion+" / "+municionmaxima ;
		        transparencia=false;
	        
		        switch (tipomunicion)
		        {
		        case 1:icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
		        case 2:icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
		        case 3:icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
		        }
		        	
		        icono3="modmercenario:textures/items/gui/botones.png";
		    	
	        }
//########################		        
	        if (item0.equals(MercenaryModItems.pistola57NF))
	        {
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/pistola75nf/75NF_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/pistola75nf/75NF_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=5;break;
	        	case 2:	tipomunicionDisplay=6;break;
	        	case 3:	tipomunicionDisplay=7;break;
	        	}
	        }
	        
//########################		        
	        if (item0.equals(MercenaryModItems.subfusil90PNF))
	        {

	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/subfusil90pnf/90PNF_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/subfusil90pnf/90PNF_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
		        
		      	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	  
		        
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=5;break;
	        	case 2:	tipomunicionDisplay=6;break;
	        	case 3:	tipomunicionDisplay=7;break;
	        	}
	        	
	        }	
	        
//########################
	        if (item0.equals(MercenaryModItems.subfusil57ar))
	        {
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/subfusil75ar/75ar_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/subfusil75ar/75ar_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
		        
		      	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	  
		        
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=5;break;
	        	case 2:	tipomunicionDisplay=6;break;
	        	case 3:	tipomunicionDisplay=7;break;
	        	}
	        	 	
	        }	

	        
	        
//########################		        
	        if ( (item0.equals(MercenaryModItems.cargadorFM9X)) )
	        {
	        	
	        switch (tipomunicion)
        	{
        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/H.png";break;
        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
        	}
        	
        	switch (tipocargador)
        	{
        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargadorfm9x/mf9x_CC_icono.png";break;
        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargadorfm9x/mf9x_CL_icono.png";break;
        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargadorfm9x/mf9x_CG_icono.png";break;
        	}
        			        
        	
        	
	      if (descargar | descargando )	
			{
	        	switch (tipocargador)
	        	{
        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargadorfm9x/mf9x_CC_iconoInv.png";break;
        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargadorfm9x/mf9x_CL_iconoInv.png";break;
        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargadorfm9x/mf9x_CG_iconoInv.png";break;
	        	}

	        }	
        		        	
        
	        switch (tipomunicion)
	        {
	        case 1:	tipomunicionDisplay=2;break;
	        case 2:	tipomunicionDisplay=3;break;
	        case 3:	tipomunicionDisplay=4;break;
	        }
        	
	        
	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;
        
	        
	        switch (tipomunicion)
	        {
	        case 1:icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
	        case 2:icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
	        case 3:icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
	        }
	        	
	        icono3="modmercenario:textures/items/gui/botones.png";
	        }
//########################
	        if (item0.equals(MercenaryModItems.pistolaFM92))
	        {
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/H.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/92_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas9mm/92_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
		        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=2;break;
		        case 2:	tipomunicionDisplay=3;break;
		        case 3:	tipomunicionDisplay=4;break;
		        }
	        		        	


	        }
	        
//########################		        
	        if (item0.equals(MercenaryModItems.pistolaFM93R))
	        {
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/H.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/93r_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas9mm/93r_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		    
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        
	        	
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
		        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=2;break;
		        case 2:	tipomunicionDisplay=3;break;
		        case 3:	tipomunicionDisplay=4;break;
		        }
		        			        
	        	
	        }
//########################
	        if (item0.equals(MercenaryModItems.subfusilMP5T5))
	        {
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/H.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/mp5t5_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas9mm/mp5t5_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		    
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        
	        	
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
		        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=2;break;
		        case 2:	tipomunicionDisplay=3;break;
		        case 3:	tipomunicionDisplay=4;break;
		        }

	        }
	        
//########################		        
	        if (item0.equals(MercenaryModItems.subfusilAresFMG))
	        {
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/H.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/ares_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas9mm/ares_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		    
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        
	        	
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
		        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=2;break;
		        case 2:	tipomunicionDisplay=3;break;
		        case 3:	tipomunicionDisplay=4;break;
		        }
		        			        
	        	
	        }
	        
//########################		        
	        if (item0.equals(MercenaryModItems.pistolaMauserC92))
	        {
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/H.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/mauser_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas9mm/mauser_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		    
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        
	        	
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
		        
		        switch (tipomunicion)
		        {
		        case 1:	tipomunicionDisplay=2;break;
		        case 2:	tipomunicionDisplay=3;break;
		        case 3:	tipomunicionDisplay=4;break;
		        }
		        			        
	        	
	        }
	        
	        
//########################		        
	        if (item0.equals(MercenaryModItems.cargador45acp))
	        {
	        	

		        switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
        		switch (tipocargador)
        		{
        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CC_icono.png";break;
        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CL_icono.png";break;
        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CG_icono.png";break;
        		}
	        			        
	        	
	        	
		      if (descargar | descargando )	
				{
		        	switch (tipocargador)
		        	{
	        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CC_iconoInv.png";break;
	        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CL_iconoInv.png";break;
	        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador45acp/cargador45acp_CG_iconoInv.png";break;
		        	}

		        }	
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=8;break;
	        	case 2:	tipomunicionDisplay=9;break;
	        	case 3:	tipomunicionDisplay=10;break;
	        	}
	        	
	        	text0=""+municion+" / "+municionmaxima ;
		        transparencia=false;
	        
		        
		        switch (tipomunicion)
		        {
		        case 1:icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
		        case 2:icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
		        case 3:icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
		        }
		        	
		        icono3="modmercenario:textures/items/gui/botones.png";

		        }
	        
//########################		        

	        
	        
	        if (item0.equals(MercenaryModItems.pistola1911colt))
	        {
	            switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas45cal/1911colt_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas45cal/1911colt_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=8;break;
	        	case 2:	tipomunicionDisplay=9;break;
	        	case 3:	tipomunicionDisplay=10;break;
	        	}


	        }
	        
//########################		        
	        if (item0.equals(MercenaryModItems.pistolaDesertEagle))
	        {
	        	
	            switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas45cal/deserteagle_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas45cal/deserteagle_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=8;break;
	        	case 2:	tipomunicionDisplay=9;break;
	        	case 3:	tipomunicionDisplay=10;break;
	        	}
        	
	        	
	        }
//########################		        
	        if ( (item0.equals(MercenaryModItems.pistolaSocom)) | (item0.equals(MercenaryModItems.pistolaSocomS)) )
	        {
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/armas45cal/socom_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas45cal/socom_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        	
		        //icono1="modmercenario:textures/items/gui/manualO.png";
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=8;break;
	        	case 2:	tipomunicionDisplay=9;break;
	        	case 3:	tipomunicionDisplay=10;break;
	        	}
        	
	        	
	        }    
	        
	       
//########################		        
	        if ( (item0.equals(MercenaryModItems.arcoMercenarioDeMadera)) 
	           | (item0.equals(MercenaryModItems.arcoMercenario))
	           | (item0.equals(MercenaryModItems.vallestaMercenaria))	
	           | (item0.equals(MercenaryModItems.vallestaMercenariaDeMadera))
	        		
	        		)
	        {
	        	switch(tipomunicion)
	        	{
	        	case 1: icono0="modmercenario:textures/items/arcos/flechas/flechaV_icono.png";break;
	        	case 2: icono0="modmercenario:textures/items/arcos/flechas/flechaMercenariaA_icono.png";break;
	        	case 3: icono0="modmercenario:textures/items/arcos/flechas/flechaMercenariaR_icono.png";break;
	        	case 4: icono0="modmercenario:textures/items/arcos/flechas/flechaMercenariaO_icono.png";break;
	        	case 5: icono0="modmercenario:textures/items/arcos/flechas/flechaMercenariaE_icono.png";break;
                    }
	        	
	        	
	        text0=""+municiondisponible; 
	        transparencia=false;
	        tipomunicionDisplay=0;
	        icono3="modmercenario:textures/items/gui/botonesDivRes.png";
	        
	        
	        if ( mensage00 > 0 )
	        {		        
	        icono4 = "modmercenario:textures/items/gui/headS.png";
	        mensage00 --;
	        }
	        
	        }
       

	        
//#######################		        
	        if (item0.equals(MercenaryModItems.revolverMagnum))
	        {
	        	
	        	switch(modo)
	        	{
	        	case 0: icono0="modmercenario:textures/items/armasdefuego/revolvermagnum/magnum_icono.png";break;
	        	case 1: icono0="modmercenario:textures/items/armasdefuego/revolvermagnum/magnum_iconoInv.png";break;
	        	case 2: icono0="modmercenario:textures/items/armasdefuego/revolvermagnum/magnum_icono.png";break;
                    }
	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;

	    	switch (tipomunicion)
        	{
        	case 1:	tipomunicionDisplay=8;icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
        	case 2:	tipomunicionDisplay=9;icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
        	case 3:	tipomunicionDisplay=10;icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
        	}
        		    	
	        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        }
	        
	        
	        
//########################		        
	        if (item0.equals(MercenaryModItems.cargadorRedClub))
	        {
	        	
	            switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	            
	            
	            
	            
        		switch (tipocargador)
        		{
        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargadorredclub/cargadorredclub_icono.png";break;
        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargadorredclub/cargadorredclub_icono.png";break;
        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargadorredclub/cargadorredclub_icono.png";break;
        		}
	        			        
	        	
	        	
		      if (descargar | descargando )	
				{
		        	switch (tipocargador)
		        	{
	        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargadorredclub/cargadorredclub_iconoInv.png";break;
	        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargadorredclub/cargadorredclub_iconoInv.png";break;
	        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargadorredclub/cargadorredclub_iconoInv.png";break;			        	}

		        }	
	        		        	
		        text0=""+municion+" / "+municionmaxima ;
		        transparencia=false;
		        
		    	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=10;icono1="modmercenario:textures/items/gui/redclub_ARO_O.png";break;
	        	case 2:	tipomunicionDisplay=10;icono1="modmercenario:textures/items/gui/redclub_ARO_O.png";break;
	        	case 3:	tipomunicionDisplay=10;icono1="modmercenario:textures/items/gui/redclub_ARO_O.png";break;
	        	}
	        
		    	icono3="modmercenario:textures/items/gui/botones.png";
	        }
	        
	        
//########################		        
	        if (item0.equals(MercenaryModItems.pistolaRedClub))
	        {
	        	
	        	
	            switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	            
	            
	        	icono0="modmercenario:textures/items/armasdefuego/armas45cal/redclub_icono.png";
	        		
	        	if ( recargando | descargando | remplazando)
	        	{
	        		icono0="modmercenario:textures/items/armasdefuego/armas45cal/redclub_iconoInv.png";
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
	        	switch(tipodisparo)
	        	{
	        	case 0: icono1="modmercenario:textures/items/gui/redclub_R.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/redclub_A.png";break;
	        	case 2: icono1="modmercenario:textures/items/gui/redclub_Z.png";break;
	        	
	        	}
	        	
	        	transparencia=false;
	        	text0=""+municion+"/"+municionmaxima;
	        	
		        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        		        	
	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=10;break;
	        	case 2:	tipomunicionDisplay=10;break;
	        	case 3:	tipomunicionDisplay=10;break;
	        	}
	        	
	        	
	        	
	        	
	        	
	        	
	        	switch(modo)
	        	{
	        	case 0: icono0="modmercenario:textures/items/armasdefuego/armas45cal/redclub_icono.png";break;
	        	case 1: icono0="modmercenario:textures/items/armasdefuego/armas45cal/redclub_iconoInv.png";break;
	        	case 2: icono0="modmercenario:textures/items/armasdefuego/armas45cal/redclub_icono.png";break;
                    }//########################
	        	
	        	
	        	
	        }	
	        	
        
	        

	        
	        

        
//########################		        
	        if (item0.equals(MercenaryModItems.subfusilAresFMG))
	        {
	        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/ares_icono.png";
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}

	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;
	        
	        switch (tipomunicion)
        	{
        	case 1:	tipomunicionDisplay=2;break;
        	case 2:	tipomunicionDisplay=3;break;
        	case 3:	tipomunicionDisplay=4;break;
        	}
	        
	        icono3="modmercenario:textures/items/gui/botones.png";
	        }

//########################		        
	        if (item0.equals(MercenaryModItems.escopetaSPAS12))
	        {
	        	icono0="modmercenario:textures/items/armasdefuego/escopetaspas12/spas12_icono.png";
	        	
	        	
	        	
	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;
	        
	        switch (tipomunicion)
        	{
        	case 1:	tipomunicionDisplay=11;break;
        	case 2:	tipomunicionDisplay=12;break;
        	case 3:	tipomunicionDisplay=13;break;
        	}
	        
	    
	        switch (tipomunicion)
        	{
        	case 1:	icono1="modmercenario:textures/items/gui/cartuchosRojo.png";break;
        	case 2:	icono1="modmercenario:textures/items/gui/cartuchosVerde.png";break;
        	case 3:	icono1="modmercenario:textures/items/gui/cartuchosAzul.png";break;
        	}
	        
	        icono3="modmercenario:textures/items/gui/botones.png";

	        }
	        
	        
	        
	        
//#######################		        
	        if (item0.equals(MercenaryModItems.escopetaWinchester1200))
	        {
	        	icono0="modmercenario:textures/items/armasdefuego/escopetawinchester1200/winchester1200_icono.png";
	        	
	        	 icono1="modmercenario:textures/items/gui/manual.png";
	        	
	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;
	        
	        switch (tipomunicion)
        	{
        	case 1:	tipomunicionDisplay=11;break;
        	case 2:	tipomunicionDisplay=12;break;
        	case 3:	tipomunicionDisplay=13;break;
        	}
	        
	        
	        switch (tipomunicion)
        	{
        	case 1:	icono1="modmercenario:textures/items/gui/cartuchosRojo.png";break;
        	case 2:	icono1="modmercenario:textures/items/gui/cartuchosVerde.png";break;
        	case 3:	icono1="modmercenario:textures/items/gui/cartuchosAzul.png";break;
        	}
	        
	        icono3="modmercenario:textures/items/gui/botones.png";

	        
	        }
	        
	        
//#######################		        
	        if (item0.equals(MercenaryModItems.lanzagranadas79M))
	        {
	        	
	        	
	        icono0="modmercenario:textures/items/armasdefuego/lanzagrandas79m/M79_icono.png";
	        	
	        		if (municion > 0)
	        		{
	        			switch (tipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/GA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/GR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/GO.png";break;
	        			}
	        		}	
	        		else
	        		{
	        			switch (tipomunicion)
	        			{
	        			case 0:	icono4="modmercenario:textures/items/gui/transparencia.png";break;
	        			case 1:	icono4="modmercenario:textures/items/gui/dA.png";break;
	        			case 2:	icono4="modmercenario:textures/items/gui/dR.png";break;
	        			case 3:	icono4="modmercenario:textures/items/gui/dO.png";break;
	        			}
	        		}
	        	
	        	

	        
	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;
	        
        	if (tipomunicion==1)
        	{tipomunicionDisplay=17;
        	icono1="modmercenario:textures/items/gui/granadas_A.png";
        	}
        	if (tipomunicion==2)
        	{tipomunicionDisplay=18;
        	icono1="modmercenario:textures/items/gui/granadas_R.png";
        	}
        	if (tipomunicion==3)
        	{tipomunicionDisplay=19;
        	icono1="modmercenario:textures/items/gui/granadas_O.png";
        	}
        	
        	icono3="modmercenario:textures/items/gui/botones.png";
	        }
	        

//########################
	        if ( item0.equals(MercenaryModItems.fusilMarkLancer)  )
	        {
        	
        	boolean extraer = util.getBooleantag(stack0, "extraer");
        	
	        	
        	
        	switch(tipodisparo)
        	{
        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
        	}
        	
        	
        	
        	switch (tipomunicion)
        	{
        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
        	}
        	
        	
        	
        	icono0="modmercenario:textures/items/armasdefuego/fusilmarklancer/mark1_icono.png";
        		
        	if ( extraer )
        	{
        		
        		icono4="modmercenario:textures/items/gui/transparencia.png";
        		icono5="modmercenario:textures/items/gui/transparencia.png";
        	}	
        	
        	

        	icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        
	        

	        
        	int accion = util.getInttag(stack0, "accion");
        	
        	if (accion == 5)
        	{
        		lmunicion = lmunicion - getLmunicion();
        	}
        	
        	transparencia=false;
        	text0="B "+municion+"/"+municionmaxima+"  R "+ lmunicion +"/"+" 5K";

        	switch (tipomunicion)
        	{
        	case 1:	tipomunicionDisplay=14;break;
        	case 2:	tipomunicionDisplay=15;break;
        	case 3:	tipomunicionDisplay=16;break;
        	}
	        	
	        }		

//########################

	     

//########################
	        if ( item0.equals(MercenaryModItems.fusilMark2Lancer)  )
		        {
	        	
	        	boolean extraer = util.getBooleantag(stack0, "extraer");
	        	
		        	
	        	
	        	switch(tipodisparo)
	        	{
	        	case 2: icono1="modmercenario:textures/items/gui/auto.png";break;
	        	case 0: icono1="modmercenario:textures/items/gui/manual.png";break;
	        	case 1: icono1="modmercenario:textures/items/gui/semiAuto.png";break;
	        	}
	        	
	        	
	        	
	        	switch (tipomunicion)
	        	{
	        	case 0:	icono5="modmercenario:textures/items/gui/transparencia.png";break;
        		case 1:	icono5="modmercenario:textures/items/gui/A.png";break;
	        	case 2:	icono5="modmercenario:textures/items/gui/R.png";break;
	        	case 3:	icono5="modmercenario:textures/items/gui/O.png";break;
	        	}
	        	
	        	
	        	
	        	icono0="modmercenario:textures/items/armasdefuego/fusilmark2lancer/mark2_icono.png";
	        		
	        	if ( extraer )
	        	{
	        		
	        		icono4="modmercenario:textures/items/gui/transparencia.png";
	        		icono5="modmercenario:textures/items/gui/transparencia.png";
	        	}	
	        	
        	

	        	icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
		        
		        

		        
	        	int accion = util.getInttag(stack0, "accion");
	        	
	        	if (accion == 5)
	        	{
	        		lmunicion = lmunicion - getLmunicion();
	        	}
	        	
	        	transparencia=false;
	        	text0="B "+municion+"/"+municionmaxima+"  R "+ lmunicion +"/"+" 5K";

	        	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=14;break;
	        	case 2:	tipomunicionDisplay=15;break;
	        	case 3:	tipomunicionDisplay=16;break;
	        	}
		        	
		        }		

//########################
		        if (item0.equals(MercenaryModItems.cargador55645))
		        {
		        	
		        switch (modo)
		        {	
		        	default:{
		        		switch (tipocargador)
		        		{
		        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CC_icono.png";break;
		        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CL_icono.png";break;
		        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CG_icono.png";break;
		        		}
		        	}break;
		        	
		        	case 1:{
		        		switch (tipocargador)
		        		{
		        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CC_iconoInv.png";break;
		        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CL_iconoInv.png";break;
		        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CG_iconoInv.png";break;
		        		}
		        	}break;
		        	
		        }
		        
		        text0=""+municion+" / "+municionmaxima ;
		        transparencia=false;
		        
		    	switch (tipomunicion)
	        	{
	        	case 1:	tipomunicionDisplay=14;icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
	        	case 2:	tipomunicionDisplay=15;icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
	        	case 3:	tipomunicionDisplay=16;icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
	        	}
	        
		    	icono3="modmercenario:textures/items/gui/botones.png";
		        }



	        
	        


//########################
	        if (item0.equals(MercenaryModItems.cargador55645))
	        {
	        	
	        switch (modo)
	        {	
	        	default:{
	        		switch (tipocargador)
	        		{
	        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CC_icono.png";break;
	        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CL_icono.png";break;
	        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CG_icono.png";break;
	        		}
	        	}break;
	        	
	        	case 1:{
	        		switch (tipocargador)
	        		{
	        		case 1:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CC_iconoInv.png";break;
	        		case 2:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CL_iconoInv.png";break;
	        		case 3:	icono0="modmercenario:textures/items/armasdefuego/cargador55645/cargador55645_CG_iconoInv.png";break;
	        		}
	        	}break;
	        	
	        }
	        
	        text0=""+municion+" / "+municionmaxima ;
	        transparencia=false;
	        
	    	switch (tipomunicion)
        	{
        	case 1:	tipomunicionDisplay=14;icono1="modmercenario:textures/items/gui/botones_ARO_A.png";break;
        	case 2:	tipomunicionDisplay=15;icono1="modmercenario:textures/items/gui/botones_ARO_R.png";break;
        	case 3:	tipomunicionDisplay=16;icono1="modmercenario:textures/items/gui/botones_ARO_O.png";break;
        	}
        
	    	icono3="modmercenario:textures/items/gui/botones.png";
	        }


	        
	        
//########################		        
	        if (item0.equals(MercenaryModItems.taladroMercenario))
	        {
	        	switch(tipodisparo)
	        	{	
	        	default: icono0="modmercenario:textures/items/herramientas/taladro/taladro00cam02.png";break;
	        	case 1: icono0="modmercenario:textures/items/herramientas/taladro/modo1.png";break;
	        	case 2: icono0="modmercenario:textures/items/herramientas/taladro/modo2.png";break;
	        	case 3: icono0="modmercenario:textures/items/herramientas/taladro/modo3.png";break;
	        	case 4: icono0="modmercenario:textures/items/herramientas/taladro/modo4.png";break;
	        	case 5: icono0="modmercenario:textures/items/herramientas/taladro/modo5.png";break;
	        	case 6: icono0="modmercenario:textures/items/herramientas/taladro/modo6.png";break;
	        	}
	        text0=""+municion+" / "+municionmaxima; 
		    transparencia=false;
		    tipomunicionDisplay=1;
		    icono3="modmercenario:textures/items/gui/botones.png";
		    }
//########################		        
	        if (item0.equals(MercenaryModItems.sierraMercenaria))
	        {
	        	switch(tipodisparo)
	        	{	
	        	default: icono0="modmercenario:textures/items/herramientas/sierra/sierramercenaria0.png";break;
	        	}
	        text0=""+municion+" / "+256; 
		    transparencia=false;
		    tipomunicionDisplay=1;
		    icono3="modmercenario:textures/items/gui/botones.png";
		    }
	        
	        

	        
	        
//########################		        

	        
	        
	        if ( unload | reload )
	        {icono1="modmercenario:textures/items/gui/holdRigthClick.png";}
	        

	        
	                
            	}//nbttag
            }//(stack0 != null)
            
            
            
          //paint a default gun just to show the position  
          //########################
        if (guiTick > 0)
        {
        	transparencia=false;
        	icono5="modmercenario:textures/items/gui/H.png";
        	icono0="modmercenario:textures/items/armasdefuego/armas9mm/92_icono.png";
        	text0="00/00";
        	
	        icono1="modmercenario:textures/items/gui/manualO.png";
	        icono3="modmercenario:textures/items/gui/botonesAsterisco.png";
	        tipomunicionDisplay=2;	        	
        }
            
        
            displayWidth=mc.displayWidth;
            displayHeight=mc.displayHeight;
            guiscale=mc.gameSettings.guiScale;            
                      
            System.out.println("guiscale="+guiscale);
            System.out.println("displayWidth="+displayWidth);
            System.out.println("displayHeight="+displayHeight);
            
        	//posX= ( (int) (displayWidth  * 0.1F) );
           // posY= ( (int) (displayHeight * 0.1F) );
            
            

            
           
            System.out.println("this.width ="+this.width);
            System.out.println("this.height="+this.height);

            
            switch(guiscale)
            {
            case 0: 
            {
            	posX=10; //1 6; //controls the gui size
                posY= 200;//((displayHeight/2)-25);
                //x=30;  //gui size    
            } ;break;
            
            case 3:
            {
            	posX=10;//( (int) (displayWidth  * 0.025F) ); //30 controls the gui size
                posY=( (int) (displayHeight * 0.30F) );
                //x=40;  //gui size    
            } ;break;
            
            case 2:
            {
            	posX=10;//( (int) (displayWidth  * 0.025F) ); //30 controls the gui size
                posY=( (int) (displayHeight * 0.45F) );
                //x=40;  //gui size    
            } ;break;
            
            case 1:
            {
            	posX=10;//( (int) (displayWidth  * 0.05F) ); //16; //controls the gui size
                posY=( (int)(displayHeight * 0.92F));
                //x=40;  //gui size    
            } ;break;
            
            
            }
            
            
           // posX = this.width / 2; 
           // posY = this.height / 2;
            


        	posX = posX + ppx;//( (int) (displayWidth  * 0.05F) ); //16; //controls the gui size
            posY = posY + ppy;

            System.out.println("posX="+posX );
            System.out.println("posY="+posY );
            
            System.out.println("\n\n\n" );
            

            
            //  System.out.println("posX="+ppx );
            //  System.out.println("posY="+ppy );
            //  System.out.println("x="+x );
            
            
            
            switch(tipomunicionDisplay)           
            {
            case 0: icono2="modmercenario:textures/items/gui/transparencia.png"; break;
            case 1: icono2="modmercenario:textures/items/armasdefuego/balas/barraRedStone.png"; break;
            
            case 2: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala9mmA.png"; break;
            case 3: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala9mmR.png"; break;
            case 4: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala9mmO.png"; break;
            
            case 5: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala5728mm_acero.png"; break;
            case 6: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala5728mm_redstone.png"; break;
            case 7: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala5728mm_obsidiana.png"; break;
            
            case 8:  icono2="modmercenario:textures/items/armasdefuego/balas/barraBalacal45acp_acero.png"; break;
            case 9:  icono2="modmercenario:textures/items/armasdefuego/balas/barraBalacal45acp_redstone.png"; break;
            case 10: icono2="modmercenario:textures/items/armasdefuego/balas/barraBalacal45acp_obsidiana.png"; break;
                             
            case 11: icono2="modmercenario:textures/items/armasdefuego/balas/barra12Grojo.png"; break;
            case 12: icono2="modmercenario:textures/items/armasdefuego/balas/barra12Gverde.png"; break;
            case 13: icono2="modmercenario:textures/items/armasdefuego/balas/barra12Gazul.png"; break;
            
            case 14: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala55645mm_acero.png"; break;
            case 15: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala55645mm_restone.png"; break;
            case 16: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala55645mm_obsidiana.png"; break;
            
            case 17: icono2="modmercenario:textures/items/armasdefuego/balas/barraGranada_A.png"; break;
            case 18: icono2="modmercenario:textures/items/armasdefuego/balas/barraGranada_R.png"; break;
            case 19: icono2="modmercenario:textures/items/armasdefuego/balas/barraGranada_O.png"; break;

            case 20: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala76239mm_acero.png"; break;
            case 21: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala76239mm_redstone.png"; break;
            case 22: icono2="modmercenario:textures/items/armasdefuego/balas/barraBala76239mm_obsidiana.png"; break;

            
            }
            
            //el ancho de la barra al que equivale cada unidad de municion
            switch(tipomunicionDisplay)           
            {
            default: balas=32.0F; break;
            case 1:  balas=256.0F; break;
            case 8: 
            case 9: 
            case 10: 
            case 11:
            case 12:
            case 13:
            case 17:
            case 18:
            case 19: balas=16.0F; break;	
            }
            
            

            
            xf=x+0.0F;
            	
            
            
        }//( (conteo%20)==0 )
        
        //Prepare rendering
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_LIGHTING);
        
        
        
        if (municion<0)
        {
        municion=0;	
        }	
        

        if ( Mercenary.getGuiOn() ){
        	
        	
        
           //drawModalRectWithCustomSizedtexture(int x, int y,float u,float v,int width,int height,float textureWidth,float textureHeight);
        
        this.mc.renderEngine.bindTexture(new ResourceLocation(icono0));
        this.drawModalRectWithCustomSizedTexture( (posX - 5), (posY), 0.0F, 0.0F, x, x, xf, xf); //imagen al 60%
      //this.drawModalRectWithCustomSizedtexture(posX + 8, posY + 8, 0.0F, 0.0F, 200, 200 , 200.0F, 200.0F);
        
        this.mc.renderEngine.bindTexture(new ResourceLocation(icono1));
        this.drawModalRectWithCustomSizedTexture( (posX + x ), (posY ), 0.0F, 0.0F, (int) (x * 1.5), (x / 3), (xf * 1.5F), (xf / 3) ); //imagen al 60%
        
        this.mc.renderEngine.bindTexture(new ResourceLocation(icono2));
        this.drawModalRectWithCustomSizedTexture( (posX + x ), (posY + (x / 3) ), 0.0F, 0.0F, (int)  (((x * 1.0) / balas ) * municion), (x / 3), (xf * 1.0F), (xf / 3) ); 
        
        this.mc.renderEngine.bindTexture(new ResourceLocation(icono3));
        this.drawModalRectWithCustomSizedTexture( (posX + x ), (posY + ((x / 3) * 2) ), 0.0F, 0.0F, (int) (x * 1.5), (x / 3), (xf * 1.5F), (xf / 3) ); 
        
        this.mc.renderEngine.bindTexture(new ResourceLocation(icono4));
        this.drawModalRectWithCustomSizedTexture( (posX - 5), (posY), 0.0F, 0.0F, x, x/2 , xf, xf/2 ); //imagen al 60%
        
        this.mc.renderEngine.bindTexture(new ResourceLocation(icono5));
        this.drawModalRectWithCustomSizedTexture( (posX - 5), (posY + (x/2)), 0.0F, 0.0F, x, x/2 , xf, xf/2 ); //imagen al 60%

        
        this.mc.fontRendererObj.drawStringWithShadow(text0,  posX, ((posY ) + x) , 0xffcccccc);
        //this.mc.fontRendererObj.drawStringWithShadow(text0,  posX + 32 + 8, posX + 8, 0xffcccccc);
        
        
    }
        
        
    }
//####################################################################################################################3

       

public static boolean getPermitirMensaje()
{
 boolean p = permitirMensaje;
 permitirMensaje=false;
 return p;

}   
    
public static int getlconteoAndSetToZero()
{
 int l = lconteo;
 lconteo = 0;

 return l;
}     


public static int getlconteo()
{
 return lconteo;
}   

public static int getrconteo()
{
  	 return rconteo;
} 

public static int getconteo100()
{
 return conteo100;
}
    
public static void setconteo100(int c)
{
 conteo100 = c;
}

public static void setconteo100Zero()
{
 conteo100 = 0;
}
   
public static void addconteo100(int c)
{
 conteo100 = conteo100 + c;
}

// conteo200
public static int getconteo200()
{
 conteo200 ++;
 return (conteo200 / 3);
}
    
public static void setconteo200(int c)
{
 conteo200 = c;
}

public static void setconteo200Zero()
{
 conteo200 = 0;
}



public static boolean permitirSonido()
{
 boolean p =  permitirSonido;
 permitirSonido=false;
 return p;
}


public static boolean permitirLdisparo2s()
{
 boolean s2 =  permitirLdisparo2s;
 permitirLdisparo2s=false;
 return s2;
}




public static int getLmunicion()
{
 return vlmunicion;
}
    
public static void setLmunicion(int c)
{
 vlmunicion = c;
}

public static void addLmunicion()
{

 if (permitirVlmunicion)
 {
	 vlmunicion ++ ;	 
	 permitirVlmunicion=false;
 }
}

public static void setHeadshoot(int t)
{

 mensage00=t;
}



public static int getTexturajson()
{
 return texturajson;
}

public static void setTexturajson(int t) 
{
 texturajson = t;
}

public static int getAccion()
{
 return accion;
}

public static void setAccion(int t) 
{
 accion = t;
}

public static int getGraficaltick()
{
 return graficaltick;
}


public static void setPpx(int px) 
{
 ppx = px;
}

public static int getPpx()
{
 guiTick =2;
 return ppx;
}

public static void setPpy(int py) 
{
 ppy = py;
}

public static int getPpy()
{
 guiTick =2;
 return ppy;
}

public static void setX(int p) 
{
 x = p;
}

public static int getX()
{
 guiTick =2;
 return x;
}

public static float getXf()
{
 return xf;
}
  


public static int getPosX()
{
 return posX;
}

public static int getPosY()
{
 return posY;
} 



//####################################################################################################################3   


public static void lineaRoja(Vec3 vectorA, Vec3 vectorB)
{	  


//MovingObjectPosition mov = Minecraft.getMinecraft().objectMouseOver;
    	



//  System.out.println("vectorA="+vectorA);
//  System.out.println("vectorB="+vectorB);

     GL11.glPushMatrix();
     GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
     
     //because of the way 3D rendering is done, all coordinates are relative to the camera.  This "resets" the "0,0,0" position to the location that is (0,0,0) in the world.

     EntityPlayer playerIn = mc.thePlayer;
     Vec3 pos0 = playerIn.getPositionVector();
           
     GL11.glTranslated(-pos0.xCoord, -pos0.yCoord, -pos0.zCoord);
     
     GlStateManager.rotate(0.0F, 0.0F, 0.0F, 0.0F);
     GlStateManager.rotate(0.0F, 0.0F, 0.0F, 0.0F);
     
     GL11.glDisable(GL11.GL_LIGHTING);
     GL11.glDisable(GL11.GL_TEXTURE_2D);
     //you will need to supply your own position vectors
     //GL11.drawLineWithGL(pos, pos1);

     

     
//		int d = Math.round((float)blockA.distanceTo(blockB)+0.2f);

	GL11.glColor3f(1F, 0F, 0F);
//		float oz = (blockA.xCoord - blockB.xCoord == 0?0:-1f/16f);
//		float ox = (blockA.zCoord - blockB.zCoord == 0?0:1f/16f);

	GL11.glBegin(GL11.GL_LINE_STRIP);

	GL11.glVertex3d(vectorA.xCoord ,vectorA.yCoord ,vectorA.zCoord );
	GL11.glVertex3d(vectorB.xCoord ,vectorB.yCoord ,vectorB.zCoord );

	GL11.glEnd();
     
//     drawLineWithGL(pos0, pos1);
     
     GL11.glPopAttrib();
     GL11.glPopMatrix();
     
}
///##################################################################################################################3 
public static void miraRoja(Vec3 vectorA, Vec3 vectorB, EntityLivingBase entidad)
{	  
     GL11.glPushMatrix();
     GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
     
     //because of the way 3D rendering is done, all coordinates are relative to the camera.  This "resets" the "0,0,0" position to the location that is (0,0,0) in the world.

     EntityPlayer playerIn = mc.thePlayer;
     Vec3 pos0 = entidad.getPositionVector();
     
     
     //GL11.glTranslated(-pos0.xCoord, -pos0.yCoord, -pos0.zCoord);
     GL11.glDisable(GL11.GL_LIGHTING);
     GL11.glDisable(GL11.GL_TEXTURE_2D);


	MovingObjectPosition mov = Minecraft.getMinecraft().objectMouseOver;

	pos0 = new Vec3(pos0.xCoord, pos0.yCoord + entidad.getEyeHeight() - 0.2F , pos0.zCoord); //from the eye heigth

	Vec3 pos1 = mov.hitVec;  //bala.shootingEntity.getLookVec(); //bala.getPositionVector();//new Vec3(-4, 5, -4);


//	mercenarymod.gui.NotificationMercenaria.lineaRoja(pos0, pos1 );

     
     


	GL11.glColor3f(1F, 0F, 0F);

	GL11.glBegin(GL11.GL_LINE_STRIP);

	GL11.glVertex3d(pos0.xCoord ,pos0.yCoord ,pos0.zCoord );
	GL11.glVertex3d(pos1.xCoord ,pos1.yCoord ,pos1.zCoord );

	GL11.glEnd();
     
     GL11.glPopAttrib();
     GL11.glPopMatrix();








}
//####################################################################################################################3   
public static int[] getIntArraytag(ItemStack item, String tag)
  {	
  int[] array = new int[5];
  	
  NBTTagCompound etiquetas = item.getTagCompound();
  	if (etiquetas == null)
  	{ 
  	etiquetas = new NBTTagCompound();
  	item.setTagCompound(etiquetas);
  	array[0]=9999;
  	return array;
  	}
  			
  array=etiquetas.getIntArray(tag); 
  return array;
  }
//####################################################################################################################3
  public static void setIntArraytag(ItemStack item, String tag, int[] value)
  {
  	NBTTagCompound etiquetas = item.getTagCompound();
  		if (etiquetas == null)
  		{ 
  		etiquetas = new NBTTagCompound();
  	    }
  	
  	etiquetas.setIntArray(tag, value);
  	item.setTagCompound(etiquetas);
  		
  }
//####################################################################################################################3   
  public static float getFloattag(ItemStack item, String tag)
  {	
  	
  	NBTTagCompound etiquetas = item.getTagCompound();
  		if (etiquetas == null)
  		{ 
  		etiquetas = new NBTTagCompound();
  		item.setTagCompound(etiquetas);
  		return 999.9F;
  	    }
  		
  	float ex=etiquetas.getFloat(tag); 
  	return ex;
  }
//####################################################################################################################3
  public static void setFloattag(ItemStack item, String tag, float value)
  {
    NBTTagCompound etiquetas = item.getTagCompound();
  		if (etiquetas == null)
  		{ 
  		etiquetas = new NBTTagCompound();
  	    }
  	
  	etiquetas.setFloat(tag, value);
  	item.setTagCompound(etiquetas);
  	
  }
//####################################################################################################################3
  public static int getInttag(ItemStack item, String tag){	
  	NBTTagCompound etiquetas = item.getTagCompound();
  		if (etiquetas == null)
  		{ 
  		etiquetas = new NBTTagCompound();
  		item.setTagCompound(etiquetas);
  		return 9999;
  		}
  			
  	int ex=etiquetas.getInteger(tag); 
  	return ex;
  }
//####################################################################################################################3
  public static void setInttag(ItemStack item, String tag, int value)
  {
  NBTTagCompound etiquetas = item.getTagCompound();
  	if (etiquetas == null)
  	{ 
  	etiquetas = new NBTTagCompound();
    }
  	
  etiquetas.setInteger(tag, value);
  item.setTagCompound(etiquetas);
  		
  }
//####################################################################################################################3
  public static Boolean getBooleantag(ItemStack item, String tag)
  {	
  	NBTTagCompound etiquetas = item.getTagCompound();
  		if (etiquetas == null)
  		{ 
        etiquetas = new NBTTagCompound();
  		item.setTagCompound(etiquetas);
  		return false;
  		}
  		
  	boolean ex=etiquetas.getBoolean(tag); 
  	return ex;
  }
//####################################################################################################################3
  public static void setBooleantag(ItemStack item, String tag, boolean value)
  {
NBTTagCompound etiquetas = item.getTagCompound();
  		if (etiquetas == null)
  		{ 
  		etiquetas = item.getTagCompound();
  		}
  		
  	etiquetas.setBoolean(tag, value);
  	item.setTagCompound(etiquetas);
  }	
//####################################################################################################################3
}//fin de la classe

 

 

 

 

Link to comment
Share on other sites

When you are logging the values, do this:

 

  posX= ( (int) (displayWidth  * 0.1F) );

  posY= ( (int) (displayHeight * 0.1F) );

 

and get rid of this:

         

            //Offset added for the gui whit the buttons

//            posX = posX + ppx;

//            posY = posY + ppy;

 

 

You should always see the button at the top left of the screen and it should always start at 10% of the screen size (use a ruler in real life to check).

Link to comment
Share on other sites

E pues Nop

 

precisely the trouble is that

the gui is not always at 10% de X and 10% de Y

 

posX= ( (int) (displayWidth  * 0.1F) );

posY= ( (int) (displayHeight * 0.1F) );

 

per example in this picture im playing whith the maximed, the window size is 1680x970

the gui position is set as 10% 10% of this values so posX=168 posY=97 are the same in all the four pictures but the gui end in diferents places the closes to 10% 10% is the one when guiscale=1

and the fartest is guiscale=0 looks more like a 22% 75%

 

 

 

http://s7.postimg.org/ow0trlgmj/gui_1680x970.png

 

dont press atention the ppx ppy i made that yesterday soo i could move the gui manually whithout restarting the game in this picture i keep that values at zero

 

but  in this video is whith the values aproximated to leftBotom corner not 10% 10% is just to show the other  gui whith the buttons

 

 

 

 

Link to comment
Share on other sites

Ok so you have 168 for the 10% value when the screen is 1680 .  But what about the values when you make the screen smaller?  Did you ensure it was (for example) 70 and 700?

 

You might be using the wrong value for screen width even after the user resizes the screen.  You might be using the old width value that you calculated earlier.

Link to comment
Share on other sites

well actually not

 

i set System.outs there and there soo i could see the values all the time,

for thet is  io make the other gui whith buttons and whith that gui i get the values i post before

here is some trick needed or may the gui for the guns is wrong made or is missing something

actually i think i need tu up something whith a super() to the gui class so it return  me the right values of width and heigth

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi, i'm getting this error when trying to start a modded minecraft server with a personal modpack. Also getting a simmilar error when trying to create a singleplayer world. Can someone help me find which mod is causing this error? Forge: 47.2.0 Minecraft: 1.20.1   This is the crash report: Also have this link to the log, if you prefer it: https://mclo.gs/3fRVwOj
    • I was trying to play minecraft modded with my friend it worked yesterday until today we added new mods and now i cant load the world here is the crash log: ---- Minecraft Crash Report ---- // This doesn't make any sense! Time: 2024-04-28 15:34:36 Description: Exception in server tick loop java.lang.VerifyError: Bad local variable type Exception Details:   Location:     net/minecraft/server/level/ChunkMap.wrapOperation$zfm000$pehkui$convertToFullChunk$lambda$loadEntities$mixinextras$bridge$136(Lnet/minecraft/world/level/chunk/LevelChunk;Lcom/llamalad7/mixinextras/injector/wrapoperation/Operation;)V @3: aload_3   Reason:     Type top (current frame, locals[3]) is not assignable to reference type   Current Frame:     bci: @3     flags: { }     locals: { 'net/minecraft/server/level/ChunkMap', 'net/minecraft/world/level/chunk/LevelChunk', 'com/llamalad7/mixinextras/injector/wrapoperation/Operation' }     stack: { 'net/minecraft/server/level/ChunkMap', 'net/minecraft/world/level/chunk/LevelChunk', 'com/llamalad7/mixinextras/injector/wrapoperation/Operation' }   Bytecode:     0000000: 2a2b 2c2d b90b eb01 00c0 001f b70b edb1     0000010:                                             at net.minecraft.server.level.ServerChunkCache.<init>(ServerChunkCache.java:77) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:pehkui.mixins.json:compat117plus.compat1201minus.ServerChunkManagerMixin,pl:mixin:A}     at net.minecraft.server.level.ServerLevel.<init>(ServerLevel.java:209) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:computing_frames,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:betterendisland.mixins.json:ServerLevelMixin,pl:mixin:APP:citadel.mixins.json:ServerLevelMixin,pl:mixin:APP:zombieawareness.mixins.json:MixinPlaySound,pl:mixin:APP:zombieawareness.mixins.json:MixinLevelEvent,pl:mixin:APP:betterdeserttemples.mixins.json:ServerLevelMixin,pl:mixin:APP:ars_elemental.mixins.json:ServerLevelMixin,pl:mixin:APP:betterendisland.mixins.json:EndergeticExpansionMixins,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_129815_(MinecraftServer.java:337) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:APP:mixins.essential.json:feature.sps.Mixin_IntegratedServerResourcePack,pl:mixin:APP:mixins.essential.json:server.MinecraftServerMixin_PvPGameRule,pl:mixin:APP:mixins.essential.json:server.Mixin_PublishServerStatusResponse,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_130006_(MinecraftServer.java:308) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:APP:mixins.essential.json:feature.sps.Mixin_IntegratedServerResourcePack,pl:mixin:APP:mixins.essential.json:server.MinecraftServerMixin_PvPGameRule,pl:mixin:APP:mixins.essential.json:server.Mixin_PublishServerStatusResponse,pl:mixin:A}     at net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:83) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:mixin,xf:OptiFine:default,re:classloading,xf:OptiFine:default,pl:mixin:APP:mixins.essential.json:server.integrated.Mixin_FixDefaultOpPermissionLevel,pl:mixin:APP:mixins.essential.json:server.integrated.MixinIntegratedServer,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:APP:mixins.essential.json:feature.sps.Mixin_IntegratedServerResourcePack,pl:mixin:APP:mixins.essential.json:server.MinecraftServerMixin_PvPGameRule,pl:mixin:APP:mixins.essential.json:server.Mixin_PublishServerStatusResponse,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23313!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:APP:mixins.essential.json:feature.sps.Mixin_IntegratedServerResourcePack,pl:mixin:APP:mixins.essential.json:server.MinecraftServerMixin_PvPGameRule,pl:mixin:APP:mixins.essential.json:server.Mixin_PublishServerStatusResponse,pl:mixin:A}     at java.lang.Thread.run(Thread.java:833) ~[?:?] {re:mixin} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.20.1     Minecraft Version ID: 1.20.1     Operating System: Windows 10 (amd64) version 10.0     Java Version: 17.0.8, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 1154564648 bytes (1101 MiB) / 3254779904 bytes (3104 MiB) up to 17850957824 bytes (17024 MiB)     CPUs: 16     Processor Vendor: AuthenticAMD     Processor Name: AMD Ryzen 7 5700G with Radeon Graphics              Identifier: AuthenticAMD Family 25 Model 80 Stepping 0     Microarchitecture: Zen 3     Frequency (GHz): 3.79     Number of physical packages: 1     Number of physical CPUs: 8     Number of logical CPUs: 16     Graphics card #0 name: NVIDIA GeForce RTX 3060     Graphics card #0 vendor: NVIDIA (0x10de)     Graphics card #0 VRAM (MB): 4095.00     Graphics card #0 deviceId: 0x2504     Graphics card #0 versionInfo: DriverVersion=31.0.15.5222     Memory slot #0 capacity (MB): 16384.00     Memory slot #0 clockSpeed (GHz): 2.13     Memory slot #0 type: DDR4     Memory slot #1 capacity (MB): 16384.00     Memory slot #1 clockSpeed (GHz): 2.13     Memory slot #1 type: DDR4     Virtual memory max (MB): 46381.31     Virtual memory used (MB): 24323.54     Swap memory total (MB): 13824.00     Swap memory used (MB): 522.00     JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx17024m -Xms256m     Server Running: true     Player Count: 0 / 8; []     Data Packs: vanilla, mod:dynamiclightsreforged (incompatible), mod:additionalentityattributes (incompatible), mod:geckolib, mod:jei, mod:graveyard (incompatible), mod:pehkui (incompatible), mod:soulbound (incompatible), mod:caelus (incompatible), mod:obscure_api (incompatible), mod:apoli (incompatible), mod:neat, mod:enlightened_end, mod:citadel (incompatible), mod:travelersbackpack, mod:zombieawareness (incompatible), mod:mixinextras (incompatible), mod:cave_dweller (incompatible), mod:depthcrawler, mod:iceandfire, mod:inventorypets (incompatible), mod:jeresources, mod:spelunkers_charm, mod:twilightforest, mod:ironchest, mod:sons_of_sins, mod:lucky (incompatible), mod:terrablender, mod:ambientsounds, mod:biomesoplenty (incompatible), mod:creativecore, mod:watching, mod:calio, mod:cataclysm (incompatible), mod:curios (incompatible), mod:ars_nouveau (incompatible), mod:origins (incompatible), mod:xaerominimap (incompatible), mod:man, mod:rats, mod:forge, mod:ars_elemental (incompatible), mod:gh, mod:ftbultimine (incompatible), mod:tombstone, mod:coroutil (incompatible), mod:architectury (incompatible), mod:ftblibrary (incompatible), mod:ftbteams (incompatible), mod:ftbchunks (incompatible), mod:ftbquests (incompatible), mod:voidscape (incompatible), mod:infiniverse (incompatible), mod:phantasm (incompatible), mod:aquamirae (incompatible), mod:essential (incompatible), mod:betterdungeons, mod:betterwitchhuts, mod:betteroceanmonuments, mod:epicfight (incompatible), mod:wom (incompatible), mod:yungsapi, mod:betterdeserttemples, mod:dixtas_armory (incompatible), mod:betterfortresses, mod:nyfsspiders (incompatible), mod:yungsbridges, mod:born_in_chaos_v1, mod:arphex, mod:yungsextras, mod:betterstrongholds, mod:yungsmenutweaks, mod:deeperdarker, mod:betterendisland, mod:deep_dark_regrowth, mod:fight_or_die, mod:bettermineshafts, mod:betterjungletemples     Enabled Feature Flags: minecraft:vanilla     World Generation: Stable     Type: Integrated Server (map_client.txt)     Is Modded: Definitely; Client brand changed to 'forge'; Server brand changed to 'forge'     Launched Version: forge-47.2.20     OptiFine Version: OptiFine_1.20.1_HD_U_I6     OptiFine Build: 20231221-120401     Render Distance Chunks: 6     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.6.0 NVIDIA 552.22     OpenGlRenderer: NVIDIA GeForce RTX 3060/PCIe/SSE2     OpenGlVendor: NVIDIA Corporation     CpuCount: 16     ModLauncher: 10.0.9+10.0.9+main.dcd20f30     ModLauncher launch target: forgeclient     ModLauncher naming: srg     ModLauncher services:          mixin-0.8.5.jar mixin PLUGINSERVICE          eventbus-6.0.5.jar eventbus PLUGINSERVICE          fmlloader-1.20.1-47.2.20.jar slf4jfixer PLUGINSERVICE          fmlloader-1.20.1-47.2.20.jar object_holder_definalize PLUGINSERVICE          fmlloader-1.20.1-47.2.20.jar runtime_enum_extender PLUGINSERVICE          fmlloader-1.20.1-47.2.20.jar capability_token_subclass PLUGINSERVICE          accesstransformers-8.0.4.jar accesstransformer PLUGINSERVICE          fmlloader-1.20.1-47.2.20.jar runtimedistcleaner PLUGINSERVICE          modlauncher-10.0.9.jar mixin TRANSFORMATIONSERVICE          modlauncher-10.0.9.jar OptiFine TRANSFORMATIONSERVICE          modlauncher-10.0.9.jar essential-loader TRANSFORMATIONSERVICE          modlauncher-10.0.9.jar fml TRANSFORMATIONSERVICE      FML Language Providers:          [email protected]         lowcodefml@null         javafml@null     Mod List:          dynamiclightsreforged-1.20.1_v1.6.0.jar           |Rubidium Dynamic Lights       |dynamiclightsreforged         |1.20.1_v1.6.0       |DONE      |Manifest: NOSIGNATURE         YungsBetterDungeons-1.20-Forge-4.0.4.jar          |YUNG's Better Dungeons        |betterdungeons                |1.20-Forge-4.0.4    |DONE      |Manifest: NOSIGNATURE         YungsBetterWitchHuts-1.20-Forge-3.0.3.jar         |YUNG's Better Witch Huts      |betterwitchhuts               |1.20-Forge-3.0.3    |DONE      |Manifest: NOSIGNATURE         additionalentityattributes-forge-1.4.0.5+1.20.1.ja|Additional Entity Attributes  |additionalentityattributes    |1.4.0.5+1.20.1      |DONE      |Manifest: NOSIGNATURE         geckolib-forge-1.20.1-4.4.4.jar                   |GeckoLib 4                    |geckolib                      |4.4.4               |DONE      |Manifest: NOSIGNATURE         jei-1.20.1-forge-15.3.0.4.jar                     |Just Enough Items             |jei                           |15.3.0.4            |DONE      |Manifest: NOSIGNATURE         The_Graveyard_3.1_(FORGE)_for_1.20.1.jar          |The Graveyard                 |graveyard                     |3.1                 |DONE      |Manifest: NOSIGNATURE         Pehkui-3.8.0+1.20.1-forge.jar                     |Pehkui                        |pehkui                        |3.8.0+1.20.1-forge  |DONE      |Manifest: NOSIGNATURE         YungsBetterOceanMonuments-1.20-Forge-3.0.4.jar    |YUNG's Better Ocean Monuments |betteroceanmonuments          |1.20-Forge-3.0.4    |DONE      |Manifest: NOSIGNATURE         Soulbound-Forge-0.8+1.20.1.jar                    |Soulbound                     |soulbound                     |0.8                 |DONE      |Manifest: NOSIGNATURE         caelus-forge-3.2.0+1.20.1.jar                     |Caelus API                    |caelus                        |3.2.0+1.20.1        |DONE      |Manifest: NOSIGNATURE         obscure_api-15.jar                                |Obscure API                   |obscure_api                   |15                  |DONE      |Manifest: NOSIGNATURE         apoli-forge-1.20.1-2.9.0.6.jar                    |Apoli                         |apoli                         |1.20.1-2.9.0.6      |DONE      |Manifest: NOSIGNATURE         Neat-1.20-35-FORGE.jar                            |Neat                          |neat                          |1.20-35-FORGE       |DONE      |Manifest: NOSIGNATURE         enlightend-5.0.14-1.20.1.jar                      |Enlightend                    |enlightened_end               |5.0.14              |DONE      |Manifest: NOSIGNATURE         EpicFight-20.7.4.jar                              |Epic Fight                    |epicfight                     |20.7.4              |DONE      |Manifest: NOSIGNATURE         WeaponsOfMiracles-20.1.7.40.jar                   |Weapons of Minecraft          |wom                           |20.1.7.40           |DONE      |Manifest: NOSIGNATURE         citadel-2.5.4-1.20.1.jar                          |Citadel                       |citadel                       |2.5.4               |DONE      |Manifest: NOSIGNATURE         TravelersBackpack-1.20.1-9.1.12.jar               |Traveler's Backpack           |travelersbackpack             |9.1.12              |DONE      |Manifest: NOSIGNATURE         zombieawareness-1.20.1-1.13.1.jar                 |Zombie Awareness              |zombieawareness               |1.20.1-1.13.1       |DONE      |Manifest: NOSIGNATURE         YungsApi-1.20-Forge-4.0.4.jar                     |YUNG's API                    |yungsapi                      |1.20-Forge-4.0.4    |DONE      |Manifest: NOSIGNATURE         mixinextras-forge-0.2.0-beta.8.jar                |MixinExtras                   |mixinextras                   |0.2.0-beta.8        |DONE      |Manifest: NOSIGNATURE         YungsBetterDesertTemples-1.20-Forge-3.0.3.jar     |YUNG's Better Desert Temples  |betterdeserttemples           |1.20-Forge-3.0.3    |DONE      |Manifest: NOSIGNATURE         cave_dweller-1.20.1-1.6.4.jar                     |cave_dweller                  |cave_dweller                  |1.6.4               |DONE      |Manifest: NOSIGNATURE         deep-1.05b.jar                                    |depthcrawler                  |depthcrawler                  |1.0.0               |DONE      |Manifest: NOSIGNATURE         iceandfire-2.1.13-1.20.1-beta-4.jar               |Ice and Fire                  |iceandfire                    |2.1.13-1.20.1-beta-4|DONE      |Manifest: NOSIGNATURE         dixtas_armory-1.1.7-1.20.1-beta.jar               |dixta's Armory                |dixtas_armory                 |1.1.4-1.20.1-beta   |DONE      |Manifest: NOSIGNATURE         inventorypets-1.20.1-2.1.1.jar                    |Inventory Pets                |inventorypets                 |2.1.1               |DONE      |Manifest: NOSIGNATURE         JustEnoughResources-1.20.1-1.4.0.247.jar          |Just Enough Resources         |jeresources                   |1.4.0.247           |DONE      |Manifest: NOSIGNATURE         YungsBetterNetherFortresses-1.20-Forge-2.0.6.jar  |YUNG's Better Nether Fortresse|betterfortresses              |1.20-Forge-2.0.6    |DONE      |Manifest: NOSIGNATURE         SpelunkersCharm-3.5.9-1.20.1.jar                  |Spelunker's Charm             |spelunkers_charm              |3.5.9               |DONE      |Manifest: NOSIGNATURE         twilightforest-1.20.1-4.3.2145-universal.jar      |The Twilight Forest           |twilightforest                |4.3.2145            |DONE      |Manifest: NOSIGNATURE         ironchest-1.20.1-14.4.4.jar                       |Iron Chests                   |ironchest                     |1.20.1-14.4.4       |DONE      |Manifest: NOSIGNATURE         nyfsspiders-forge-1.20.1-2.1.1.jar                |Nyf's Spiders                 |nyfsspiders                   |2.1.1               |DONE      |Manifest: NOSIGNATURE         client-1.20.1-20230612.114412-srg.jar             |Minecraft                     |minecraft                     |1.20.1              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         sons-of-sins-1.20.1-2.1.6.jar                     |Sons of Sins                  |sons_of_sins                  |2.1.6               |DONE      |Manifest: NOSIGNATURE         lucky-block-forge-1.20.1-13.0.jar                 |Lucky Block                   |lucky                         |1.20.1-13.0         |DONE      |Manifest: NOSIGNATURE         TerraBlender-forge-1.20.1-3.0.1.4.jar             |TerraBlender                  |terrablender                  |3.0.1.4             |DONE      |Manifest: NOSIGNATURE         AmbientSounds_FORGE_v5.3.9_mc1.20.1.jar           |AmbientSounds                 |ambientsounds                 |5.3.9               |DONE      |Manifest: NOSIGNATURE         BiomesOPlenty-1.20.1-18.0.0.592.jar               |Biomes O' Plenty              |biomesoplenty                 |18.0.0.592          |DONE      |Manifest: NOSIGNATURE         CreativeCore_FORGE_v2.11.27_mc1.20.1.jar          |CreativeCore                  |creativecore                  |2.11.27             |DONE      |Manifest: NOSIGNATURE         From-The-Fog-1.20-v1.9.2-Forge-Fabric.jar         |From The Fog                  |watching                      |1.9.2               |DONE      |Manifest: NOSIGNATURE         YungsBridges-1.20-Forge-4.0.3.jar                 |YUNG's Bridges                |yungsbridges                  |1.20-Forge-4.0.3    |DONE      |Manifest: NOSIGNATURE         born_in_chaos_[Forge]1.20.1_1.2.jar               |Born in Chaos                 |born_in_chaos_v1              |1.0.0               |DONE      |Manifest: NOSIGNATURE         calio-forge-1.20.1-1.11.0.3.jar                   |Calio                         |calio                         |1.20.1-1.11.0.3     |DONE      |Manifest: NOSIGNATURE         L_Enders_Cataclysm-1.90 -1.20.1.jar               |Cataclysm Mod                 |cataclysm                     |1.0                 |DONE      |Manifest: NOSIGNATURE         curios-forge-5.9.0+1.20.1.jar                     |Curios API                    |curios                        |5.9.0+1.20.1        |DONE      |Manifest: NOSIGNATURE         ars_nouveau-1.20.1-4.10.0-all.jar                 |Ars Nouveau                   |ars_nouveau                   |4.10.0              |DONE      |Manifest: NOSIGNATURE         origins-forge-1.20.1-1.10.0.7-all.jar             |Origins                       |origins                       |1.20.1-1.10.0.7     |DONE      |Manifest: NOSIGNATURE         Xaeros_Minimap_24.1.1_Forge_1.20.jar              |Xaero's Minimap               |xaerominimap                  |24.1.1              |DONE      |Manifest: NOSIGNATURE         The-Man-From-The-Fog-1.2.4a-1.20.1.jar            |The Man From The Fog          |man                           |1.2.4               |DONE      |Manifest: NOSIGNATURE         Rats-1.20.1-8.1.2.jar                             |Rats                          |rats                          |1.20.1-8.1.2        |DONE      |Manifest: NOSIGNATURE         forge-1.20.1-47.2.20-universal.jar                |Forge                         |forge                         |47.2.20             |DONE      |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90         ArPhEx_1.8.12_1.20.1.jar                          |Arthropod Phobia Expansions   |arphex                        |1.8.12              |DONE      |Manifest: NOSIGNATURE         ars_elemental-1.20.1-0.6.5.jar                    |Ars Elemental                 |ars_elemental                 |1.20.1-0.6.5        |DONE      |Manifest: NOSIGNATURE         YungsExtras-1.20-Forge-4.0.3.jar                  |YUNG's Extras                 |yungsextras                   |1.20-Forge-4.0.3    |DONE      |Manifest: NOSIGNATURE         Gods-and-Heroes-1.6.1.jar                         |Gods and Heroes               |gh                            |1.6.1_Forge&Fabric  |DONE      |Manifest: NOSIGNATURE         ftb-ultimine-forge-2001.1.4.jar                   |FTB Ultimine                  |ftbultimine                   |2001.1.4            |DONE      |Manifest: NOSIGNATURE         YungsBetterStrongholds-1.20-Forge-4.0.3.jar       |YUNG's Better Strongholds     |betterstrongholds             |1.20-Forge-4.0.3    |DONE      |Manifest: NOSIGNATURE         tombstone-1.20.1-8.6.5.jar                        |Corail Tombstone              |tombstone                     |8.6.5               |DONE      |Manifest: NOSIGNATURE         YungsMenuTweaks-1.20.1-Forge-1.0.2.jar            |YUNG's Menu Tweaks            |yungsmenutweaks               |1.20.1-Forge-1.0.2  |DONE      |Manifest: NOSIGNATURE         coroutil-forge-1.20.1-1.3.7.jar                   |CoroUtil                      |coroutil                      |1.20.1-1.3.7        |DONE      |Manifest: NOSIGNATURE         deeperdarker-forge-1.20.1-1.2.1.jar               |Deeper and Darker             |deeperdarker                  |1.2.1               |DONE      |Manifest: NOSIGNATURE         architectury-9.2.14-forge.jar                     |Architectury                  |architectury                  |9.2.14              |DONE      |Manifest: NOSIGNATURE         ftb-library-forge-2001.1.5.jar                    |FTB Library                   |ftblibrary                    |2001.1.5            |DONE      |Manifest: NOSIGNATURE         ftb-teams-forge-2001.1.4.jar                      |FTB Teams                     |ftbteams                      |2001.1.4            |DONE      |Manifest: NOSIGNATURE         ftb-chunks-forge-2001.2.7.jar                     |FTB Chunks                    |ftbchunks                     |2001.2.7            |DONE      |Manifest: NOSIGNATURE         ftb-quests-forge-2001.3.5.jar                     |FTB Quests                    |ftbquests                     |2001.3.5            |DONE      |Manifest: NOSIGNATURE         YungsBetterEndIsland-1.20-Forge-2.0.6.jar         |YUNG's Better End Island      |betterendisland               |1.20-Forge-2.0.6    |DONE      |Manifest: NOSIGNATURE         Deep Dark Regrowth 1.2.5.1 - 1.20.1.jar           |Deep Dark: Regrowth           |deep_dark_regrowth            |1.2.5.1             |DONE      |Manifest: NOSIGNATURE         Voidscape-1.20.1-1.5.389.jar                      |Voidscape                     |voidscape                     |1.20.1-1.5.389      |DONE      |Manifest: NOSIGNATURE         infiniverse-1.20.1-1.0.0.5.jar                    |Infiniverse                   |infiniverse                   |1.0.0.5             |DONE      |Manifest: NOSIGNATURE         fight_or_die-1.20.1-1.1.4.jar                     |Fight or Die Mutations        |fight_or_die                  |1.20.1-1.1.4        |DONE      |Manifest: NOSIGNATURE         YungsBetterMineshafts-1.20-Forge-4.0.4.jar        |YUNG's Better Mineshafts      |bettermineshafts              |1.20-Forge-4.0.4    |DONE      |Manifest: NOSIGNATURE         phantasm-forge-0.1.jar                            |End's Phantasm                |phantasm                      |0.1                 |DONE      |Manifest: NOSIGNATURE         aquamirae-6.API15.jar                             |Aquamirae                     |aquamirae                     |6.API15             |DONE      |Manifest: NOSIGNATURE         Essential (forge_1.20.1).jar                      |Essential                     |essential                     |1.3.1.3+g88238d7752 |DONE      |Manifest: NOSIGNATURE         YungsBetterJungleTemples-1.20-Forge-2.0.4.jar     |YUNG's Better Jungle Temples  |betterjungletemples           |1.20-Forge-2.0.4    |DONE      |Manifest: NOSIGNATURE     Crash Report UUID: 093f2885-caf5-4a87-965d-511fd2c9d9ae     FML: 47.2     Forge: net.minecraftforge:47.2.20
    • I get a death message in chat every time I take damage example: [16:29:13] [Render thread/INFO]: [System] [CHAT] fall,Syndrick hit the ground too hard. I didn't die from that fall. I remember the exact moment it started happening, and what mods I had added. I have since removed said mods trying to fix it, and nothing has worked. I have also disabled a bunch of other mods that could be the cause, but that hasn't worked either. I've gone through the logs with chatgpt, and that hasn't helped either. This is my last resort, so if anyone can help me, that'd be insanely appreciated. Thank You.
    • The error is due to being unable to setup the server on the IP address or port number you specified in the server settings. (Failed to bind to port)  I usually get this myself when i have a VPN turned on, or if the server is already open in the background. If you do not have a VPN turned on then try changing the port number in the server.config file to use something other than the default 25565 port. Also check your firewall settings to make sure Minecraft is not blocked in any way Hope this helps!   
    • Crash log and latest.txt https://paste.ee/p/7t93I
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.