Mightydanp
-
Posts
225 -
Joined
-
Last visited
Posts posted by Mightydanp
-
-
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
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
-
so i am sepost to do something like this?
if (nbtDataCompund == null)
{
// do something?
}
im just confused right now
-
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
-
No ? They just started after ?
-
na not asking for any help on that stuff just telling them what happenen
-
Its not java or anything my computer os litarly crashing hard core so im having to do a system restore if that dont work then a clean whip
-
Im runing into a big problem with my eclipse and java not working
-
thats not what im talking about.... i asked is there a limit on how much metadata you can use ? for example can i have a item with 1000 metadatas?
its a yes or no quistion >.> but you responed with It's a full short, so 0-Short.MAX_VALUE.
-
what ? you just confused me
-
ok so heres a good question for later is there a limit on how much metadata you can use ? for example can i have a item with 1000 metadatas?
-
the reason i'm not making it gain damage with 1 is because i want it to lose damage because the bar on the bottom of the item represents how much is left and thanks for the help i got it to work.
-
true i did not see it , so you said i have to set it ? i tried to set it with
nbtDataCompund.setInteger("coolDown", 0); is that right ?
-
Its not crashing as o sead its not working meaning its not changing anything after i changed
nbtDataCompund = itemStack.stackTagCompound();
to
nbtDataCompund = itemStack.getTagCompound();
-
Not going to argue with you
-
dude ? you going to reply
-
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
-
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();
-
your talking about this ?
if (!world.isRemote){
NBTTagCompound nbtDataCompund = itemStack.stackTagCompound;
if (nbtDataCompund == null)
{
itemStack.stackTagCompound = new NBTTagCompound();
nbtDataCompund = itemStack.getTagCompound();
}
-
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; }
-
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
-
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
-
and i seem to be having a small issue for some reason client side it is killing the mobs but server side it doesnt do anything at all to the server they are still alive and can hit me which puzzles me.
-
ernio i am getting a dead code in 1.7.10 in this
if(data== null){
itemStack.stackTagCompound = new NBTTagCompound();
data= itemStack.stackTagCompound;
}
-
What other ways could i do this ? You sead if i wanted to make it visable to use in my addinformation i would have to do something else then what you put on it ?
Cool down not working afte4 changing
in Modder Support
Posted
You mean tinkers.conf