
Yagoki
Members-
Posts
290 -
Joined
-
Last visited
Everything posted by Yagoki
-
Not got too many Ideas I'm afraid you could try changing your @Instance to @Instance(Flora.modid) new Flora instance; that may be worth a shot, currently just comparing differences between my main file and yours. [EDIT] also you can change the @PreInit to @EventHandler.
-
could you paste your current main class here, the package declaration in the one you posted below is not the same as the one in your zip, it's confusing me and is stopping me from being able to help properly
-
I think I understand what you're saying, if I've massively misinterpreted it then sorry, it's late where I am. the zip folder can be called anything. normally you call it something logical, such as modname_version.zip but it could be anything. In there you put the packages exactly as they are in eclipse. so you would have "assets.*" and all other packages at that level. this should all work. but let me know if it doesn't work and provide me with logs and screenshots of the packages and zip folders.
-
should be the same, if you look at the zip for the builds for my mod that should give show you. Make sure yours are the same, but with your paths. link in the sig below
-
This question has been asked way too many times. You guys do realize there is a search bar on this forum? http://www.minecraftforge.net/forum/index.php/topic,10549.msg54130.html ^^^ for all your texturing needs, just skip down to my first few comments on that post. [EDIT] also after reading your code I need to inform you that your blocks and everything else should all be done in preInit
-
[1.6] [HELP]Custom furnace not working outside of eclipse minecraft
Yagoki replied to xcoopergangx's topic in Modder Support
are you remembering to include the texture in your zip file (with the correct path)? just saying it's been done before... -
I just had a look at asm, It dosen't seem that bad compared to some things I've seen... I have a feeling that as soon as I try to do anything with it however that will be a different story. here's where I started looking if you're interested: http://download.forge.objectweb.org/asm/asm4-guide.pdf
-
or just use ASM to add the required methods to the onBlock broken method...
-
If you could strip some of those down to basics you could probably submit them to be included in forge (not too sure about how you go about this, but it is a thing) I know there are times where I've wished there was a block break event. block break event, called when the player breaks a block nested inside PlayerEvent there seems to bee quite a few nested in various places which you could try checking to see if they hold any relevance to what you're doing you could also possibly try ASM, if you're willing to dip your feet in those waters
-
just out of curiosity, what are you doing to the base class? The change happened in 1.6.2 apparently from the change log: Build 1.6.2-9.10.0.780 LexManos Updated FML: MinecraftForge/FML@c997f2adbc4c11cd8c2abe5f82ccd00b0e954b68 FML now verifies that the minecraft jar is correct and intact. This is intended to discourage those who think that modifying the minecraft jar is still acceptable. MinecraftForge/FML@0db4624b27a5ecf59ed506ccfc26459ca26ee408 Don't initialize the server. MinecraftForge/FML@4fa375683fdb7edff67c951fb371ab4a23435308 Fix NPE in new debug line when patch targets don't exist.
-
forge will not boot with your mod installed in the jar, which is a required if you edit base classes (it checks through all the classes there before starting to see if they match). so your mod will cause the game not to run. I'm not sure mojang will do too much about it as there are far too many people doing it anyway (modloader ect). You can build an installer like the forge one which will allow you to do this, i'm pretty sure optifine is working on this/has done this. the forge installer is open source so you can look through this if you want to do this. There are normally ways you could do things without base edits, but I know it's not always possible. how am I supposed to know here's a tutorial on forge events, just replace the event with the one you've been told to use, and you should be able to access the required fields from the parameter.
-
He means that rather than going in and changing the base classes to add your string, you can use the method he said to add the overlay instead. Editing base classes directly is very bad practice, as it causes incompatibility with other mods, as well as breaching mojangs TOU (when you distribute their source code), hence they asked forge to stop doing it meaning forge now has an installer which ships with no minecraft source code
-
Here's one of my GUIs you can use as a sample to figure this out. I would much rather you look through that and see if you can tell what is required, than just give you the answers and help you limp along. PLEASE DO NOT COPY AND PASTE CODE WITHOUT UNDERSTANDING IT FULLY, you will only be setting yourself up to fail.
-
It will be referenced as a resource location, which looks like the following: private static final ResourceLocation backgroundLocation = new ResourceLocation("modid:path_to_texture_from_assets"); so say I had a mod called animals, and I had a crow texture. The path could be assets/animals/textures/entities/crow.png the resource location would look something like: private static final ResourceLocation crowSkin = new ResourceLocation("animals:textures/entities/crow.png"); hope I made that clear enough
-
Dev environment mis-naming some of the items(?!) ?
Yagoki replied to mickey695's topic in Modder Support
no... a.) language registry works just fine with item stacks. b.) you are omitting the item damage, which is what he is trying to use. You can NOT use the LanguageRegistry for this, you have to override this method in the item class: @Override public String getItemDisplayName(ItemStack itemStack) { return "This is the Item Name"; } language registry works from the unlocalized names of the item, and adds the localization if it exists, what you are adding with the language registry is a specific localization for that which it will use by default (I think anyways) Alternatively you may be able to override the following method and keep your existing code, this should also be more friendly when you come to add localization to your mod, i.e. you add support for names in other languages. @Override public String getUnlocalizedName(ItemStack par1ItemStack) { return "This is the unlocalized name"; } the reason you are getting the last string in the array is because that is the last one you registered for that specific unlocalized name -
The fall damage was fixed, that's what we added the event for. we removed the fall damage statement from the on update method as it was not wanted, and is a messier way of doing it, as other mods may set fall damage after it, based on speed or whatever. using the event will guarantee that the fall damage is negated, without having problems with other mods.
-
may I ask why you decided to copy paste my code from earlier into a context to make it seem like your own? even after the topic has been effectively finished, and the code you pasted changed.
-
not a clue, If you're talking about the damage number, that increases as it get's damaged so should be high. The item i used in my first example for this works fine for me... so you sot me stumped, it should all be working so I'm not sure anymore. just play about with it a bit more, run in debug etc and see what't happening as it runs it all. good luck.
-
Easy mistake when you didn't understand how that if worked this is your if statement as you have it: if(stack != null && stack.getItem() == Items.DragonSword); // this semicolon should not exist event.setCanceled(true); so it should look like this. if(stack != null && stack.getItem() == Items.DragonSword) event.setCanceled(true); an if() written like that will end at the first semicolon, so it was effectively empty in the way you had written it.
-
did you remember to remove this line from the onUpdate method? entity.fallDistance = 0;
-
If you look at the if statement I created there are no bracers attached to it. This means that the if will only have an effect up to the next ";" the following two statements do the same thing if(stack != null && stack.getItem() == GasPoweredStick.gasStick) evt.setCanceled(true); System.out.println("Hello World"); //The above is the same as if(stack != null && stack.getItem() == GasPoweredStick.gasStick) { evt.setCanceled(true); } System.out.println("Hello World"); it's just a way of making your code a bit neater and easier to read, as there are less bracers all over the place.
-
The event is called every time you fall, but the if is only canceling the event if the item is held. I did it as a nested class as, in this example, it is a neater way of doing it (in my opinion). you could have quite easily moved the class at the end to a different file and it would do the same thing, just think of a nested class as a class which has a class as its package... wait that makes it sound more confusing... here this explains it better: http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html <-- I use this site whenever I want to lean something in java that I've heard about, It can be quite useful. (also given that oracle are java it's never incorrect)
-
I wasn't aware that <pro tip and trick> was a proper HTML format thingy ^^^ all true stuff
-
ok, I should probably have explained how forge events work. there are good tutorials here http://minecraftforgetutorials.weebly.com/event-introduction.html for an actual working example look at the following You will want to create a new class, I did mine as a nested class within my item as it seemed logical (All this is from my testing project, so every thing is a bit silly as it's not public ) This is the item class, there's a lot of extra stuff in there, all you're interested in it the public static class at the bottom package mods.gaspoweredstick.code.item; import java.util.List; import mods.gaspoweredstick.code.common.Config; import mods.gaspoweredstick.code.common.GasPoweredStick; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.common.EnumHelper; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingFallEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class Stick extends ItemSword { public static final EnumToolMaterial STICK = EnumHelper .addToolMaterial("STICK", 1, 60, 1, 9, 20); public static final EnumToolMaterial STICK2 = EnumHelper .addToolMaterial("STICK2", 3, 1000, 10, 18, 42); public Stick(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, par2EnumToolMaterial); this.hasSubtypes = !Config.infinate; } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("stick"); } public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) { if(!Config.infinate) par1ItemStack.damageItem(1, par3EntityLiving); return true; } public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) { if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { if(!Config.infinate) par1ItemStack.damageItem(2, par7EntityLiving); } return true; } @Override public boolean getIsRepairable(ItemStack stack1, ItemStack stack2) { return (stack1.getItem()==GasPoweredStick.stick && stack2.getItem()==Item.stick) || (stack1.getItem()==GasPoweredStick.gasStick && stack2.getItem()==Item.ghastTear); } @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { if(this == GasPoweredStick.gasStick) list.add("Never runs out of ghast!"); } @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) { super.onUpdate(stack, world, entity, par4, par5); double x = entity.posX, y = entity.posY, z = entity.posZ; if(!(entity instanceof EntityPlayer)||entity.motionX*entity.motionX + entity.motionY*entity.motionY + entity.motionZ*entity.motionZ < 0.01)/*you may want to play with this number*/ return; if(((EntityPlayer)entity).getItemInUse() != stack) return; AxisAlignedBB box = AxisAlignedBB.getBoundingBox(x - 0.5D, y-1.0D, z-0.5D, x + 0.5D, y+1.0D, z+0.5D); List<Entity> entList = world.getEntitiesWithinAABBExcludingEntity(null, box); for(Entity ent: entList) { if(ent instanceof EntityLiving) { /*may need an if(!world.isRemote) here*/ ((EntityLiving)ent).attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)entity), 1); } } } public static class StickFallEvent { @ForgeSubscribe public void fallEvent(LivingFallEvent evt) { EntityLivingBase player = evt.entityLiving; ItemStack stack = player.getHeldItem(); if(stack != null && stack.getItem() == GasPoweredStick.gasStick) evt.setCanceled(true); } } } then in your main mod file do the following MinecraftForge.EVENT_BUS.register(new Stick.StickFallEvent()); and congrats, your first forge event and we're all noobs at some point so don't feel bad about it, at least you seem like you're trying to learn and having a go at things yourself, unlike some people here.
-
Remove my bit for the fall damage, and the thingy I did to negate it. Use a LivingFallEvent instead as diesieben07 said to do in your other post for that, It's a much better way to do it... but for some reason I always forget that event exists The rest of what I gave you should be fine.