Jump to content

[1.6.4>>1.7.2]Major problems updating mod from 1.6.4 to 1.7.2


Recommended Posts

Posted

I'm currently in the process of updating my mod to 1.7.2. But, along the way, i've encountered some problems that I don't really know what's going wrong or how to fix, and that searching the internet has so far been little help with.

First, my lang file isn't working for any items except one, and I have no idea why. Here's the a snippit of the files showing what I mean:

Declaration:

 

 

public static Item ItemBeam = new ItemBeam().setUnlocalizedName(
		"itembeam").setCreativeTab(MetroidCubedBeams);

public static Item ItemCircuit = new ItemCircuit().setUnlocalizedName(
		"itemcircuit").setCreativeTab(
		MetroidCubedMaterials);

public static Item ItemLightCrystal = new ItemLightCrystal()
		.setUnlocalizedName("itemlightcrystal")

 

 

Registration:

 

 

GameRegistry.registerItem(ItemBeam, ItemBeam.getUnlocalizedName());
GameRegistry.registerItem(ItemCircuit, ItemCircuit.getUnlocalizedName());
GameRegistry.registerItem(ItemLightCrystal, ItemLightCrystal.getUnlocalizedName());

 

 

 

Lang entries:

 

 

item.itembeam.name=Power Beam

item.itemcircuit.name=Circuit

item.itemlightcrystal.name=Light Crystal

 

 

In this, only itembeam is having its name localized, and I don't know what's different between the three.

 

 

Another thing that I can't figure out is one of my keybinds is deciding to not work. Again, I can't find a difference between it and the others:

Keybindings class

 

 

public class KeyBindingsMetroid {

    
    public static KeyBinding hypermode;
    public static KeyBinding missile;
    public static KeyBinding powerbeam;
    public static KeyBinding wavebeam;
    public static KeyBinding icebeam;
    public static KeyBinding plasmabeam;
    public static KeyBinding visorhud;
    public static KeyBinding mp2beamtoggle;



    public static void init() {
        // Define the "ping" binding, with (unlocalized) name "key.ping" and
        // the category with (unlocalized) name "key.categories.mymod" and
        // key code 24 ("O", LWJGL constant: Keyboard.KEY_O)        
    	hypermode = new KeyBinding("key.hypermode", Keyboard.KEY_C, "key.categories.mymod");
        missile = new KeyBinding("key.missile", Keyboard.KEY_F, "key.categories.mymod");
        powerbeam = new KeyBinding("key.powerbeam", Keyboard.KEY_I, "key.categories.mymod");
        wavebeam = new KeyBinding("key.wavebeam", Keyboard.KEY_J, "key.categories.mymod");
        icebeam = new KeyBinding("key.icebeam", Keyboard.KEY_L, "key.categories.mymod");
        plasmabeam = new KeyBinding("key.plasmabeam", Keyboard.KEY_K, "key.categories.mymod");
        visorhud = new KeyBinding("key.visorhud", Keyboard.KEY_X, "key.categories.mymod");
       	mp2beamtoggle = new KeyBinding("key.mp2beamtoggle", Keyboard.KEY_H, "key.categories.mymod");


        ClientRegistry.registerKeyBinding(hypermode);
        ClientRegistry.registerKeyBinding(missile);
        ClientRegistry.registerKeyBinding(powerbeam);
        ClientRegistry.registerKeyBinding(wavebeam);
        ClientRegistry.registerKeyBinding(icebeam);
        ClientRegistry.registerKeyBinding(plasmabeam);
        ClientRegistry.registerKeyBinding(visorhud);
        ClientRegistry.registerKeyBinding(mp2beamtoggle);
    }

 

 

 

KeyBindingHandler class

 

 

public class KeyBindingHandlerMetroid {

        public static boolean hypermode;
public static boolean missile;
public static boolean powerbeam;
public static boolean wavebeam;
public static boolean icebeam;
public static boolean plasmabeam;
public static boolean visorhud;
public static boolean mp2beamtoggle;

@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
	if (KeyBindingsMetroid.hypermode.isPressed()) {
		hypermode = true;
	}
	if (KeyBindingsMetroid.missile.isPressed()) {
		missile = true;
	}
	if (KeyBindingsMetroid.powerbeam.isPressed()) {
		powerbeam = true;
	}
	if (KeyBindingsMetroid.wavebeam.isPressed()) {
		wavebeam = true;
	}
	if (KeyBindingsMetroid.icebeam.isPressed()) {
		icebeam = true;
	}
	if (KeyBindingsMetroid.plasmabeam.isPressed()) {
		plasmabeam = true;
	}
	if (KeyBindingsMetroid.visorhud.isPressed()) {
		visorhud = true;
	}
	if (KeyBindingsMetroid.mp2beamtoggle.isPressed()) {
		mp2beamtoggle = true;
	}

}
}

 

 

The only one that doesn't work is missile, no code that uses it responds to keypresses, (the others do), and I know it's not even registering because it's not in the list of keybinds in the settings menu (all the others are)

 

Next, I have a HUD overlay that is applied when the player is wearing a helmet from my mod. Again, for reasons I have yet to find, whenever there is a chat messsage displayed and i'm not in the chat interface (IE if I use player.addChatMessage(); ) The screen goes completely black except for the overlay is still shown over the black, and I have no idea why.

Here's my renderHUD class:

 

 

@SubscribeEvent
public void onRenderTick(RenderTickEvent event) {

	if (Minecraft.getMinecraft().thePlayer == null
			|| Minecraft.getMinecraft().currentScreen != null) {
		return;
	}
	if (Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) != null) {
		ItemStack helmet = Minecraft.getMinecraft().thePlayer
				.getCurrentArmor(3);
		if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0) {
			if (helmet.getItem() == Main.ItemPowerSuitHelmet
					|| helmet.getItem() == Main.ItemVariaSuitHelmet
					|| helmet.getItem() == Main.ItemGravitySuitHelmet
					|| helmet.getItem() == Main.ItemPhazonSuitHelmet
					|| helmet.getItem() == Main.ItemPEDSuitHelmet
					|| helmet.getItem() == Main.ItemDarkSuitHelmet
					|| helmet.getItem() == Main.ItemLightSuitHelmet) {
				GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);

				Tessellator t = Tessellator.instance;

				ScaledResolution scale = new ScaledResolution(
						Minecraft.getMinecraft().gameSettings,
						Minecraft.getMinecraft().displayWidth,
						Minecraft.getMinecraft().displayHeight);
				int width = scale.getScaledWidth();
				int height = scale.getScaledHeight();

				GL11.glDisable(GL11.GL_DEPTH_TEST);
				GL11.glDepthMask(false);
				GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
						GL11.GL_ONE_MINUS_SRC_ALPHA);
				GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
				GL11.glDisable(GL11.GL_ALPHA_TEST);
				// GL11.glBindTexture(GL11.GL_TEXTURE_2D,
				// Minecraft.getMinecraft().renderEngine.getTexture(hudtexture));
				Minecraft.getMinecraft().renderEngine
						.bindTexture(hudtexture);

				t.startDrawingQuads();
				t.addVertexWithUV(0.0D, (double) height, 90.0D, 0.0D, 1.0D);
				t.addVertexWithUV((double) width, (double) height, 90.0D,
						1.0D, 1.0D);
				t.addVertexWithUV((double) width, 0.0D, 90.0D, 1.0D, 0.0D);
				t.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D);
				t.draw();

				GL11.glPopAttrib();
			}
		}
	}

}

 

 

 

Which is registered via:

FMLCommonHandler.instance().bus().register(new RenderHUD());

in my clientproxy

 

I've been trying to fix these for quite a while now, with no luck. Anybody know what I did wrong?

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

Posted

First of all, you don't init your Items outside of the preInit, you just don't. It should look like:

public static Item item;

public void preInit(PreInitializationEvent event)
{
    item = new Item().randomshit();
    GameRegistry.registerItem(item, "sdjhflszhfl")
}

 

Can u please post your Item classes cuz I need to see the class.

 

For your HUD use the RenderOverlayEvent instead of the ticking one.

 

As for the KeyBinding I don't know, I've heard that that isn't complete, but I could be wrong.

 

 

Posted

Here's the classes for the items I showed:

ItemBeam (This one's massive, sorry....)

 

 

package com.chimera.metroidcubed2;

import java.util.List;

import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;

import com.chimera.metroidcubed2.mp2.EntityAnnihilatorBolt;
import com.chimera.metroidcubed2.mp2.EntityChargedAnnihilatorBolt;
import com.chimera.metroidcubed2.mp2.EntityChargedDarkBolt;
import com.chimera.metroidcubed2.mp2.EntityChargedLightBolt;
import com.chimera.metroidcubed2.mp2.EntityDarkBolt;
import com.chimera.metroidcubed2.mp2.EntityLightBolt;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ItemBeam extends Item {

public ItemBeam() {
	super();
	this.maxStackSize = 1;
	this.setMaxDamage(61);
}

public int mode = 1;
public boolean v2 = false;
public int t = 0;

public static int missiles;
public static int maxmissiles;
public boolean hasAnnihilatorBeam;
public boolean hasDarkBeam;
public boolean hasLightBeam;
public boolean hasNovaBeam;
public boolean hasSwitched = false;
public int tickssinceconsumed;


@Override
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer, int par4) {

	ExtendedPlayer props1 = ExtendedPlayer.get(par3EntityPlayer);
	missiles = props1.getMissiles();
	maxmissiles = props1.getMaxMissiles();
	String missilestring = String.valueOf(missiles);
	String maxmissilestring = String.valueOf(maxmissiles);

	EntityPowerBolt entitypowerbolt = new EntityPowerBolt(par2World,
			par3EntityPlayer);
	EntityChargedPowerBolt entitychargedpowerbolt = new EntityChargedPowerBolt(
			par2World, par3EntityPlayer);

	EntityIceBolt entityicebolt = new EntityIceBolt(par2World,
			par3EntityPlayer);
	EntityChargedIceBolt entitychargedicebolt = new EntityChargedIceBolt(
			par2World, par3EntityPlayer);

	EntityWaveBolt entitywavebolt = new EntityWaveBolt(par2World,
			par3EntityPlayer);
	EntityChargedWaveBolt entitychargedwavebolt = new EntityChargedWaveBolt(
			par2World, par3EntityPlayer);

	EntityPlasmaBolt entityplasmabolt = new EntityPlasmaBolt(par2World,
			par3EntityPlayer);
	EntityChargedPlasmaBolt entitychargedplasmabolt = new EntityChargedPlasmaBolt(
			par2World, par3EntityPlayer);

	EntityLightBolt entitylightbolt = new EntityLightBolt(par2World,
			par3EntityPlayer);
	EntityChargedLightBolt entitychargedlightbolt = new EntityChargedLightBolt(
			par2World, par3EntityPlayer);

	EntityDarkBolt entitydarkbolt = new EntityDarkBolt(par2World,
			par3EntityPlayer);
	EntityChargedDarkBolt entitychargeddarkbolt = new EntityChargedDarkBolt(
			par2World, par3EntityPlayer);

	EntityAnnihilatorBolt entityannihilatorbolt = new EntityAnnihilatorBolt(
			par2World, par3EntityPlayer);
	EntityChargedAnnihilatorBolt entitychargedannihilatorbolt = new EntityChargedAnnihilatorBolt(
			par2World, par3EntityPlayer);

	EntityUnchargedNovaBolt entityunchargednovabolt = new EntityUnchargedNovaBolt(
			par2World, par3EntityPlayer);

	EntityFlamethrower entityflamethrower = new EntityFlamethrower(
			par2World, par3EntityPlayer);
	EntityWaveBuster entitywavebuster = new EntityWaveBuster(par2World,
			par3EntityPlayer);
	EntityIceSpreader entityicespreader = new EntityIceSpreader(par2World,
			par3EntityPlayer);
	EntityNovaBolt entitynovabolt = new EntityNovaBolt(par2World,
			par3EntityPlayer);

	// Insert fireing sound here

	if (!par2World.isRemote) {
		ExtendedPlayer props = ExtendedPlayer.get(par3EntityPlayer);

		hasAnnihilatorBeam = props.hasAnnihilatorBeam();
		hasLightBeam = props.hasLightBeam();
		hasDarkBeam = props.hasDarkBeam();
		hasNovaBeam = props.hasNovaBeam();

		if (t < 60) {

			if (mode == 1) {
				par2World.spawnEntityInWorld(entitypowerbolt);
			}
			if (mode == 2) {
				par2World.spawnEntityInWorld(entityicebolt);
			}
			if (mode == 3) {
				par2World.spawnEntityInWorld(entitywavebolt);
			}
			if (mode == 4) {
				par2World.spawnEntityInWorld(entityplasmabolt);
			}
			if (mode == 5) {
				par2World.spawnEntityInWorld(entitydarkbolt);
			}
			if (mode == 6) {
				par2World.spawnEntityInWorld(entityannihilatorbolt);
			}
			if (mode == 7) {
				par2World.spawnEntityInWorld(entitylightbolt);
			}
			if (mode ==  {
				par2World.spawnEntityInWorld(entityunchargednovabolt);
			}
			t = 0;



		} else if (t >= 60) {

			if (mode == 1) {
				par2World.spawnEntityInWorld(entitychargedpowerbolt);
			}
			if (mode == 2) {
				par2World.spawnEntityInWorld(entitychargedicebolt);
			}
			if (mode == 3) {
				par2World.spawnEntityInWorld(entitychargedwavebolt);
			}
			if (mode == 4) {
				par2World.spawnEntityInWorld(entitychargedplasmabolt);
			}
			if (mode == 5) {
				par2World.spawnEntityInWorld(entitychargeddarkbolt);
			}
			if (mode == 6) {
				par2World.spawnEntityInWorld(entitychargedannihilatorbolt);
			}
			if (mode == 7) {
				par2World.spawnEntityInWorld(entitychargedlightbolt);
			}
			if (mode ==  {
				par2World.spawnEntityInWorld(entitynovabolt);
			}
			t = 0;

		}
	}
}

public int getMaxItemUseDuration(ItemStack par1ItemStack) {
	return 72000;
}

public EnumAction getItemUseAction(ItemStack par1ItemStack) {
	return null;
}

boolean released = false;
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer) {
	EntityPhazonBeam entityphazonbeam = new EntityPhazonBeam(par2World,
			par3EntityPlayer);
	par3EntityPlayer.setEating(false);

	ExtendedPlayer props1 = ExtendedPlayer.get(par3EntityPlayer);
	missiles = props1.getMissiles();
	maxmissiles = props1.getMaxMissiles();
	String missilestring = String.valueOf(missiles);
	String maxmissilestring = String.valueOf(maxmissiles);
	if (par3EntityPlayer.isPotionActive(Main.hypermode)
			&& !par2World.isRemote) {
		par2World.spawnEntityInWorld(entityphazonbeam);
		return par1ItemStack;
	} else {
	par3EntityPlayer.setItemInUse(par1ItemStack,
			this.getMaxItemUseDuration(par1ItemStack));
	return par1ItemStack;
	}
}

@Override
public void onCreated(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer) {

}

public int sonictimer = 0;
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
	t = t + 1;

	ExtendedPlayer props = ExtendedPlayer.get(player);

	player.setEating(false);
	if (KeyBindingHandlerMetroid.visorhud == false) {
		released = true;
	}

	if (!player.worldObj.isRemote) {

		if (sonictimer <= 11 && sonictimer != 0) {
			sonictimer++;
		}
		if (sonictimer >= 12) {
			player.worldObj.spawnEntityInWorld(new EntitySonicBoom(
					player.worldObj, player));
			sonictimer = 0;
			t = 0;
		}

		if (t < 60 && KeyBindingHandlerMetroid.visorhud && released == true
				&& !player.worldObj.isRemote) {
			if (props.consumeMissiles(1) || player.capabilities.isCreativeMode) {
				player.worldObj.spawnEntityInWorld(new EntityMissile(
						player.worldObj, player));
				t = 0;
				released = false;
			} else {
				player.addChatMessage(new ChatComponentText("No missiles!"));

			}
		}
		if (t > 60 && KeyBindingHandlerMetroid.visorhud
				&& !player.worldObj.isRemote) {

			if (mode == 1 || mode ==  {
				if (props.hasSuperMissiles()) {
					if ((props.consumeMissiles(5) || player.capabilities.isCreativeMode)
							&& released == true) {
						player.worldObj
								.spawnEntityInWorld(new EntitySuperMissile(
										player.worldObj, player));
						released = false;
						t = 0;
					} else {
						player.addChatMessage(new ChatComponentText("Not enough missiles!"));
					}
				}

				else {
					player.addChatMessage(new ChatComponentText("Super missiles not enabled"));
				}
			}

			if (mode == 2) {
				if (props.hasIceSpreader()) {
					if (released == true) {

								if(props.consumeMissiles(10) || player.capabilities.isCreativeMode){

									player.worldObj.spawnEntityInWorld(new EntityIceSpreader(player.worldObj, player));
									t = 0;
									released = false;

								} else {
									player.addChatMessage(new ChatComponentText("Not enough missiles!"));
								}

							}
				}

				else {
					player.addChatMessage(new ChatComponentText("Ice Spreader not enabled"));
				}
			}

			if (mode == 3) {
				if (props.hasWaveBuster()) {

					if ((props.consumeMissiles(1) || player.capabilities.isCreativeMode)) {

						player.worldObj
								.spawnEntityInWorld(new EntityWaveBuster(
										player.worldObj, player));

						released = false;
					} else {
						player.addChatMessage(new ChatComponentText("Not enough missiles!"));
					}

				}
			}
			if (mode == 4) {
				if (props.hasFlamethrower()) {

					if (released) {
						if ((props.consumeMissiles(10) || player.capabilities.isCreativeMode)) {

							player.worldObj.spawnEntityInWorld(new EntityFlamethrower(player.worldObj, player));
							released = false;

						} else {
							player.addChatMessage(new ChatComponentText("Not enough missiles!"));
						}
					}

					if (!released) {
						if (tickssinceconsumed == 20) {
							tickssinceconsumed = 0;
							if ((props.consumeMissiles(1) || player.capabilities.isCreativeMode)) {
								player.worldObj
										.spawnEntityInWorld(new EntityFlamethrower(
												player.worldObj, player));

							} else {
								player.addChatMessage(new ChatComponentText("Not enough missiles!"));
							}

						} else {

								player.worldObj
										.spawnEntityInWorld(new EntityFlamethrower(
												player.worldObj, player));
								tickssinceconsumed += 1;

						}

					}

				}

				else {
					player.addChatMessage(new ChatComponentText("Flamethrower not enabled"));
				}
			}

			if (mode == 5) {
				if (props.hasDarkBurst()) {
					if(released){
					if (props.consumeMissiles(10) || player.capabilities.isCreativeMode) {
						player.worldObj
								.spawnEntityInWorld(new EntityDarkBurst(
										player.worldObj, player));
						t = 0;
						released = false;
					} else {
						player.addChatMessage(new ChatComponentText("Not enough missiles!"));
					}
					}
				} else {
					player.addChatMessage(new ChatComponentText("Darkburst not enabled"));
				}
			}

			if (mode == 6) {
				if (props.hasSonicBoom()) {
					if(released){
					if (props.consumeMissiles(20) || player.capabilities.isCreativeMode) {
						sonictimer = 1;
						released = false;
					} else {
						player.addChatMessage(new ChatComponentText("Not enough missiles!"));
					}
					}
				}

				else {
					player.addChatMessage(new ChatComponentText("Sonic Boom not enabled"));
				}
			}

			if (mode == 7) {
				if (props.hasSunBurst()) {
					if(released){
					if (props.consumeMissiles(10) || player.capabilities.isCreativeMode) {
						player.worldObj
								.spawnEntityInWorld(new EntitySunBurst(
										player.worldObj, player));
						released = false;
						t = 0;

					} else {
						player.addChatMessage(new ChatComponentText("Not enough missiles!"));
					}
					}
				}

				else {
					player.addChatMessage(new ChatComponentText("Sunburst not enabled"));
				}
			}
		}
	}

	// Damages:
	// 1 = hasice
	// 2 = haswave
	// 3 = hasplasma
	// 4 = hasicewave
	// 5 = hasplasmaice
	// 6 = haswaveplasma
	// 7 = hasicewaveplasma
	// 8 = hasicewaveplasma
	// 9 = hasdarkwaveplasma
	// 10 = hasiceannihilatorplasma
	// 11 = hasicewavelight
	// 12 = hasdarkannihilatorplasma
	// 13 = hasdarkwavelight
	// 14 = hasiceannihilatorlight
	// 15 = hasdarkannihilatorlight
	// 16 = hasdarkannihilatornova

	if (KeyBindingHandlerMetroid.mp2beamtoggle && !hasSwitched) {
		if (v2) {
			v2 = false;
		} else {
			v2 = true;
		}
		if (!props.hasNovaBeam()) {
			mode = 1;
		}
		if (props.hasNovaBeam()) {
			mode = 8;
		}
		hasSwitched = true;
	}
	if (!KeyBindingHandlerMetroid.mp2beamtoggle) {
		hasSwitched = false;
	}

	if (KeyBindingHandlerMetroid.powerbeam) {
		if (!props.hasNovaBeam()) {
			mode = 1;
		}
		if (props.hasNovaBeam()) {
			mode = 8;
		}
	}

	if (KeyBindingHandlerMetroid.icebeam) {

		if (!v2) {
			if (props.hasIceBeam()) {
				mode = 2;
			}
		}

		if (v2) {
			if (props.hasDarkBeam()) {
				mode = 5;
			}
		}

	}
	if (KeyBindingHandlerMetroid.wavebeam) {

		if (!v2) {
			if (props.hasWaveBeam()) {
				mode = 3;
			}
		}
		if (v2) {
			if (props.hasAnnihilatorBeam()) {
				mode = 6;
			}
		}

	}
	if (KeyBindingHandlerMetroid.plasmabeam) {

		if (!v2) {
			if (props.hasPlasmaBeam()) {
				mode = 4;
			}
		}
		if (v2) {
			mode = 7;

		}

	}

}

@SideOnly(Side.CLIENT)
private IIcon[] Texture = new IIcon[5];
private IIcon iconIndex;

@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)

{
	this.itemIcon = iconRegister.registerIcon("chimera27metroid:powerbeam");

	this.Texture[0] = iconRegister.registerIcon("chimera27metroid:"
			+ "powerbeam");
	this.Texture[1] = iconRegister.registerIcon("chimera27metroid:"
			+ "icebeam");
	this.Texture[2] = iconRegister.registerIcon("chimera27metroid:"
			+ "wavebeam");
	this.Texture[3] = iconRegister.registerIcon("chimera27metroid:"
			+ "plasmabeam");
	this.Texture[4] = iconRegister.registerIcon("chimera27metroid:"
			+ "hyperbeam");

}

@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player,
		ItemStack usingItem, int useRemaining) {

	if (mode == 5) {
		return Texture[4];
	} else if (mode == 4) {
		return Texture[3];
	} else if (mode == 3) {
		return Texture[2];
	} else if (mode == 2) {
		return Texture[1];
	}
	return Texture[0];
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list,
		boolean par4) {
	ExtendedPlayer props = ExtendedPlayer.get(player);

	list.add(EnumChatFormatting.DARK_BLUE
			+ "Right click with upgrades to add them to the beam!");
	list.add(EnumChatFormatting.DARK_BLUE
			+ "Hold right click and press the switch keys to switch!");
	list.add(EnumChatFormatting.DARK_BLUE
			+ "To fire a Missile, hold right click and press 'F'!");
	list.add(EnumChatFormatting.DARK_BLUE
			+ "For a Super Missile, charge up a shot then press 'F'!");

	list.add(EnumChatFormatting.BOLD + "Mode:");
	if (mode == 1) {
		list.add(EnumChatFormatting.GOLD + "Power Beam!");
	}

	if (mode == 2) {
		if (props.hasIceBeam() && !props.hasDarkBeam()) {
			list.add(EnumChatFormatting.AQUA + "Ice Beam!");
		} else {

			list.add(EnumChatFormatting.DARK_PURPLE + "Dark Beam!");

		}
	}

	if (mode == 3) {
		if (props.hasWaveBeam() && !props.hasAnnihilatorBeam()) {
			list.add(EnumChatFormatting.LIGHT_PURPLE + "Wave Beam!");
		}

		else {
			list.add(EnumChatFormatting.GRAY + "Annihilator Beam!");
		}
	}

	if (mode == 4) {
		if (props.hasPlasmaBeam() && !props.hasLightBeam()
				&& !props.hasNovaBeam()) {
			list.add(EnumChatFormatting.RED + "Plasma Beam!");
		}

		if (props.hasPlasmaBeam() && props.hasLightBeam()
				&& !props.hasNovaBeam()) {
			list.add(EnumChatFormatting.WHITE + "Light Beam!");
		}
		if (props.hasNovaBeam()) {
			list.add(EnumChatFormatting.GREEN + "Nova Beam!");
		}
	}

	if (player.isPotionActive(Main.hypermode.id)) {
		list.add(EnumChatFormatting.BLUE + "Phazon Beam!");
	}

}

public EnumRarity getRarity(ItemStack par1ItemStack) {
	return EnumRarity.rare;
}
}

 

 

 

ItemCircuit

 

 

package com.chimera.metroidcubed2;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;

public class ItemCircuit extends Item{

    public ItemCircuit()
    {
        super();
        this.maxStackSize = 64;
    }
    
   
    @SideOnly(Side.CLIENT)
    public void registerIcons(IIconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("chimera27metroid:itemcircuit");
    }

}

 

 

ItemLightCrystal

 

 

package com.chimera.metroidcubed2;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class ItemLightCrystal extends Item {

public ItemLightCrystal() {
	super();
	this.maxStackSize = 64;
}

   
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
	this.itemIcon = iconRegister
			.registerIcon("chimera27metroid:itemlightcrystal");
}

}

 

 

 

The weird thing about the keybinding is that all the others work, just not that one...

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

Posted

How was it before when you used the rendertickevent in 1.7.2, was it black as well, or just nothing. Does it work if you try to keep the rendertickevent with MinecraftForge.event_bus? Otherwise try to scale and translate stuff in the overlay and see how it's working.

Posted

Wouldn't that just open the chat? The problem happens if there is a chat message on-screen like this:

http://imgur.com/RexPHgB.png

and the overlay is trying to render. THEN it blacks out like I showed above. (The only reason it isn't in this picture is because I disabled the overlay so I could get a screenshot)

 

As soon as the chat message fades, the screen is visible again

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

Posted

Changing the type from RenderTickEvent to RenderGameOverlayEvent (and registering it with the minecraft forge event bus instead of the fml one) makes it ALWAYS black with the overlay when you have the helmet on :/

 

Have you tried only changing the type, -or- only changing the method you are registering with to see which one of these two changes might be the culprit?

 

Changing both at once makes debugging slightly harder.

Posted

Sometimes UTF-8 derps for lang files. I recommend to leave blank lines at beginning and end of the file.

 

Note that KeyInputEvent only triggers when the key is first pressed. (no continuous press, or unpress)

Also, key presses are client-side only. You need packets to send the stuff to the server side.

 

For helmet overlay, please use the item hook.

Item#renderHelmetOverlay(ItemStack, EntityPlayer, ...)

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



×
×
  • Create New...

Important Information

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