Everything posted by Guff
-
Special Ability Tools
For pickaxe you'll want to change the way it handles blocks being harvested/destroyed. It should be handled to check whether the item being dropped has a smelting recipe, and if it does, it should drop that instead of the normal drop (look at FurnaceRecipes.java). For axe just check all above blocks and see if they are also wood/logs, etc, and have them affected as well.
-
Illegal object naming error
Show MoreTools.java.
-
Item damage on crafting
Woops try + 1 instead of - 1. Also: @Override public boolean hasContainerItem() { return true; }
-
Item damage on crafting
No need for a crafting handler. In your ItemKnife.java: @Override public ItemStack getContainerItemStack(ItemStack itemStack) { int alter = itemStack.getItemDamage() - 1; if(alter >= itemStack.getMaxDamage()) { return null; } itemStack.setItemDamage(alter); return itemStack; } Will return the same stack that was used with the damage minus 1. If the changed damage is greater/equal compared to the maximum allowed damage, will 'break' the item by returning null.
-
[Solved]get username of player from LivingHurtEvent.
Same thing. In your processing: if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; String name = player.username; }
-
[1.6.2] [SOLVED] Gui textures are not working
Show me the new ResourceLocation you are using, and the Exception it is showing in the console again.
-
[Solved]get username of player from LivingHurtEvent.
if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; //do stuff here }
-
[1.6.2] [SOLVED] Gui textures are not working
Files names should be what the file names are. Just change your mschouses to lowercase and also change the folder to lowercase.
-
Get game settings
Make sure your tick handler is Client side, and Minecraft.getMinecraft() will work fine.
-
Get game settings
Minecraft is not a variable, it is a class. getMinecraft() will return the running instance of the client which is a field.
-
[1.6.2] [SOLVED] Gui textures are not working
Anywhere you have: iconRegister.registerIcon("MscHouses:ingotcopper"); MscHouses needs to be all lowercase: iconRegister.registerIcon("mschouses:ingotcopper");
-
[1.6.2] [SOLVED] Gui textures are not working
When you package your mod, make sure your assets folder and class folders are separate from one another. I use these: com/mod/modname/.class files assets/modname/textures/items,blocks,gui/.png files So when it is packaged, the two are distinguished. I don't know about your items, I'd have to see how you are initializing them.
-
[SOLVED] [1.6.2] Recompiling Error
Do a clean install and copy over your source.
-
[SOLVED] [1.6.2] Recompiling Error
I'm asking if you did. If you didn't, something else screwed them up. I'd recommend a clean install of forge and copy over your source.
-
[1.6.2] [SOLVED] Gui textures are not working
Like I said, change: ResourceFile.houseGen_Img = new ResourceLocation("MscHouses:BlockBase.png"); to ResourceFile.houseGen_Img = new ResourceLocation("mschouses", "directory/to/BlockBase.png);
-
[SOLVED] [1.6.2] Recompiling Error
My guess is that Forge didn't set up correctly, unless you changed any of these files: Packet133TileEditorOpen.java WorldClientINNER3.java WorldClientINNER4.java
-
[1.6.2] [SOLVED] Gui textures are not working
ResourceLocation texture = new ResourceLocation("mschouses", "directory/to/BlockBase.png); And in your src, you will have a package like this: assets.mschouses.directory.to, containing BlockBase.png. Here's the setup I use: ResourceLocation texture = new ResourceLocation("mymod", "textures/gui/myGuiTexture.png") muGuiTexture.png is located in assets.mymod.textures.gui.
-
Throwable tools?
Easy. Make a class that extends ItemPickaxe, and copy the code from ItemSnowball (onItemRightClick) and paste it into your class. Then change the code to fit what you want, it changing anything like EntitySnowball, etc. to EntityPickaxe, then copy and paste EntitySnowball/RenderSnowball and name it EntityPickaxe and RenderPickaxe, and change it. it's not hard, really just a bunch of copy and paste.
-
Help with an error, null pointer?
Show me the stack trace.
-
Get game settings
Only client-side: GameSettings settings = Minecraft.getMinecraft().gameSettings; KeyBinding jump = settings.keyBindJump;
-
Illegal object naming error
You are trying to add a name to an object that is not a Block, Item, or ItemStack. LanguageRegistry.addName(Block.stone, "Stone"); //works LanguageRegistry.addName(new HashMap(), "Some Map"); //first param is not an instance of Block, Item, or ItemStack, will not work
-
[SOLVED][1.6.2] Armor Render Issue? or Code?
Here is the easiest return for you: modID:textures/armor/armorType_" + (this.armorType == 2 ? 2 : 1) + ".png"
-
Tile Entity NBT not saving when the game is quit
Did you add a mapping to your tile entity? During an FMLEvent: TileEntity.addMapping(TileEntityPipe.class, "TileEntityPipe")
-
New Modder -- Strange Errors
Did you install Risugami's ModLoader? I would assume you did and you shouldn't do that if you're using. Get the version of forge (src) you want from the downloads, extract the forge folder somewhere, then open it and run install.cmd.
-
Cookable Food
Items are static objects that are used to define behavior of that item, and ItemStacks are the actual Item. When you look in your inventory, you're actually looking at ItemStack instances that have the data of the Item or Block that is passed to them. The addSmelting() method requires an ItemStack parameter as the output, so give it one that contains the data of the item you want to receive (new ItemStack(myFoodCooked)).
IPS spam blocked by CleanTalk.