Jump to content

Mightydanp

Members
  • Posts

    225
  • Joined

  • Last visited

Posts posted by Mightydanp

  1. yes i do know what i am doing with the getItemDamage() and such, i do have a quistion, after a built my jar, put some of the class files like this

    laTLmJU.png

     

    basicly the class files are out of the com folder...

     

    when i started it up with regurlar client forge and opened my inventory it crashed with

     

    This doesn't make any sense!

     

     

     

    Time: 10/10/15 7:30 PM

    Description: Unexpected error

     

    java.lang.IllegalAccessError: tried to access field net.minecraft.client.gui.GuiScreen.field_146292_n from class tconstruct.client.tabs.TabRegistry

    at tconstruct.client.tabs.TabRegistry.guiPostInit(TabRegistry.java:44)

    at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_TabRegistry_guiPostInit_Post.invoke(.dynamic)

    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)

    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)

    at net.minecraft.client.gui.GuiScreen.func_146280_a(GuiScreen.java:257)

    at net.minecraft.client.Minecraft.func_147108_a(Minecraft.java:808)

    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1895)

    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)

    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)

    at net.minecraft.client.main.Main.main(SourceFile:148)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:483)

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

     

     

     

    this is the code that says its crashing

     

    public void preInit(FMLPreInitializationEvent event) {

    MinecraftForge.EVENT_BUS.register(new TabRegistry());

    }

     

    am i doing something wrong in my code to cause this or? glaticraft does the same thing in there class

     

    https://github.com/micdoodle8/Galacticraft/blob/master/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java

     

  2. after i got a new hard drive reinstalled , i start crashing .. this wasn't happening before this.

     

     

    Caused by: java.lang.NullPointerException

    at com.mightydanp.eot.item.ItemMagicalStone.addInformation(ItemMagicalStone.java:90) ~[itemMagicalStone.class:?]

    at net.minecraft.item.ItemStack.getTooltip(ItemStack.java:641) ~[itemStack.class:?]

    at net.minecraft.client.gui.GuiScreen.renderToolTip(GuiScreen.java:124) ~[GuiScreen.class:?]

    at net.minecraft.client.gui.inventory.GuiContainerCreative.renderToolTip(GuiContainerCreative.java:769) ~[GuiContainerCreative.class:?]

    at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:186) ~[GuiContainer.class:?]

    at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) ~[inventoryEffectRenderer.class:?]

    at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) ~[GuiContainerCreative.class:?]

    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) ~[EntityRenderer.class:?]

     

     

     

    code

     

    http://pastebin.com/H74hDjeC

  3. im still having the issue where the cooldown still isnt working

     

    @Override
        public void onUpdate(ItemStack itemStack, World world, Entity entity, int i, boolean flag){
        	super.onUpdate(itemStack, world, entity, i, flag);
        	
        	if (!world.isRemote){
        		NBTTagCompound nbtDataCompund = itemStack.stackTagCompound;
        		if (nbtDataCompund == null)
        		{
        			itemStack.stackTagCompound = new NBTTagCompound();
        			nbtDataCompund = itemStack.getTagCompound();
        		}
        		
        		int coolDown = nbtDataCompund.getInteger("coolDown");
        		if(coolDown > 0){
        			--coolDown;
        			nbtDataCompund.setInteger("coolDown", coolDown);
            	}
        	}
        }
    

     

    @Override
        public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityplayer, EntityLivingBase entity ){ 
        	
            int coolDown = itemStack.stackTagCompound.getInteger("coolDown");
        	
            if(coolDown > 0){
            	return false;
            }
            if(coolDown == 0){
            	if (entity instanceof EntityMob){
                    if(itemStack.getItemDamage() > 0){
                    	entity.setHealth(0.0F);
                    	if(!entity.worldObj.isRemote){
                    		entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY +"Soul Absurbed!"));
                    	}
                    	itemStack.damageItem(-1, entityplayer);
                        return true;
                    }else{
                    	if(!entity.worldObj.isRemote){
                    		entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The  Magical Stone seems to be full?"));
                            entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "It seems to be useless now."));
                            entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "I wonder whats inside?"));
                        }
                        return true;
                    }
                }else{
                	if(!entity.worldObj.isRemote){
                		entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "Why has this stoped working?"));
                    }
                }
            }
            itemStack.stackTagCompound.setInteger("coolDown", 180);;
            return false;
        }
    

     

    im not trying to copy past but for most people they know nothing about tagCompounds and id rather you yell as me and tell me what im doing wrong and learn it then trying to figure it out myself

  4. you told me to change itemStack.stackTagCompound to something that can go and get the stack compound

    so i looked thow there was only stacktagcompound and

    getstacktagcompound...

    so on this line

    nbtDataCompund = itemStack.stackTagCompound();

    i changed it to

    nbtDataCompund = itemStack.getTagCompound();

  5. i looked up who helped me and it was you who helped me with this.. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1437156-i-need-help-with-a-iteminteractionforentity

    @Override
        public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityplayer, EntityLivingBase entity ){ 
            if(!entity.worldObj.isRemote){
                return false;
            }
            
            int coolDown = itemStack.stackTagCompound.getInteger("coolDown");
        	
            if(coolDown > 0){
            	return false;
            }
            if(coolDown == 0){
            	if (entity instanceof EntityMob){
                    if(itemStack.getItemDamage() > 0){
                    	entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY +"Soul Absurbed!"));
                    	itemStack.damageItem(-1, entityplayer);
                        entity.setHealth(0.0F);
                        return true;
                    }else{
                    	entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The  Magical Stone seems to be full?"));
                        entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "It seems to be useless now."));
                        entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "I wonder whats inside?"));
                        return true;
                    }
                }else{
                	
                    entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "Why has this stoped working?"));
                }
            }
            itemStack.stackTagCompound.setInteger("coolDown", 180);;
            return false;
        }
    
    

  6. ernio posted this

     

     

     

     

     

     

    i am telling him that there is a dead line in it... as he said

    "" This code will try to decrement cooldown to zero whenever it's positive (positive = item has cooldown).

    It also has lazy initialization and will work like charm (mind I wrote it here and am on 1.8, so might made mistake).  ""

     

    seeing that he just wrote it on here and not cheeking if it works via forge i know that there is something wrong so i am telling him about it.....

    for the mysterious stone i wrote that maybe maybe 7 or 8 months ago i have no clue what i was thinking but it worked before i changed it to a metadata class so i was seeing if there was a reason it stopped working on me

  7. For

    NBTTagCompound nbtTagCompound = new NBTTagCompound();

    if(nbtTagCompound == null) {

      // dead code - how can it be null when you just initialized it??? it can't.

    }

     

    i was telling him that i is dead code that his version for 1.8 doesn't work for 1.7.10, that's why i said ernio.....

     

    and i realize the nbt portion and im fiddling with it right now

×
×
  • Create New...

Important Information

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