Jump to content

Athire

Members
  • Posts

    62
  • Joined

  • Last visited

Everything posted by Athire

  1. You were right! Turns out i capitalized the E in "_Essence" in the code but not in the png! I thought i triple checked that but for some reason i just didn't catch it. It's strange that it would work in eclipse though, I wonder why that is? anyway thank you so much! I'll add your name to the list of people to put in the credits
  2. Thank you so much! That just about fixed my issue! There is still one stubborn texture that refuses to load though. It's weird because it's an item texture in the same folder as my other item textures which are loading fine. I can't see anything different between the textures which are loading and this one item texture which will not Any suggestions? Here is the bit of code that initializes the item: public static final Item InrPwrWispEssence = new Item(5001).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("essenceWisp").setTextureName("innerpower:InnerPower_Essence_WispyEssence"); Thank you again!
  3. Hello all! I'm about ready to release a super early alpha version of my mod, just something my friends and I can play around with to test it out. I recompiled and reobfuscated it all, I turned it into a .zip file (I'm using forge for 1.6.4), and I tried applying it to my forge minecraft profile. The mod loads and all of the items and ores work like they should, but none of my textures load. I tried adding my textures directly to the .jar file (sorted correctly for blocks/items/gui), I even tried putting it in my zip file as just the .png's, in a textures folder, and even in a textures folder under a mod name folder (like in my mcp folder). All of my textures worked in the eclipse work space. To add my textures to an item I'm using the method .setTextureName("innerpower: InnerPower_itemname") where innerpower is the name of the folder under mcp>>src>>assets which houses the textures, and "InnerPower_itemname" is the .png. For example one line of my code is: public static final Item STFireball= new SpellTomeFireball(5000).setTextureName("innerpower:InnerPower_SpellTome_Fireball"); So is this an issue with with the function I'm using, or am i just not putting my textures in the right place? Every tutorial I've seen so far has a different place to put them (such as directly into the .jar or in the zipped folder) so it's a bit difficult to figure out D: As always thank you guys for all your help! I'm definitely adding some names to my credits section once an official release comes out! And thanks again to everyone who has helped me with my other questions so far! This mod is far from over but you guys have been a huge help in getting me this far!
  4. Thank you guys! I'll let you know how it goes!
  5. Ok here is my code, sorry if I'm not supposed to post it like this but I couldn't get the attachment thing working D: //BaseClass *************************************************************** package InnerPower; //--------------------------------- import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.*; import net.minecraftforge.common.MinecraftForge; //----------------------------------- import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid= "AthInrPwr", name= "Inner Power", version= "Alpha 1.0") @NetworkMod(clientSideRequired= true, serverSideRequired= false) public class BaseClass { // The instance of your mod that Forge uses. @Instance(value = "AthInrPwr") public static BaseClass instance1; //*********** Defining blocks/items public static final Block InrPwrCrystal = new crystalBlock(550, Material.ground).setHardness(45.0f).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("crystalBlock").setCreativeTab(CreativeTabs.tabBlock).setTextureName("InnerPower_Block_Crystal"); public static final Item InrPwrWispEssence = new Item(5001).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("essenceWisp").setTextureName("InnerPower_Essence_WispyEssence"); public static final Item STFireball= new SpellTomeFireball(5000).setTextureName("InnerPower_SpellTome_Fireball"); //From new tutorial //instance of mod forge uses @Instance("AthInrPwr") public static BaseClass instance; //says where the client and server proxy code is loaded @SidedProxy(clientSide= "InnerPower.client.ClientProxy",serverSide="InnerPower.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { //Adding to registry GameRegistry.registerBlock(InrPwrCrystal, "crystal" ); LanguageRegistry.addName(InrPwrCrystal, "crystal"); MinecraftForge.setBlockHarvestLevel(InrPwrCrystal, "pickaxe", 3); LanguageRegistry.addName(InrPwrWispEssence, "Wispy Essence"); LanguageRegistry.addName(STFireball, "Spell Tome: Fireball"); GameRegistry.addRecipe(new ItemStack(STFireball, 1), new Object[]{ "xx","xx", 'x', Block.dirt }); //test recipie GameRegistry.addRecipe(new ItemStack(Item.diamond, 1), new Object[]{ "x x", " x ", "x x", 'x', Block.dirt }); } @EventHandler public void postInit(FMLPostInitializationEvent event) { //Stub Method } @EventHandler public void load(FMLInitializationEvent event) { //block and item initializations moved to preInit() } } //Spell book class *********************************************************************** package InnerPower; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.projectile.EntitySmallFireball; import java.util.Random; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SpellTomeFireball extends Item { //Default Constructor public SpellTomeFireball(int id) { super(id); setMaxStackSize(1); setCreativeTab(CreativeTabs.tabCombat); setUnlocalizedName("STfireball"); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayerMP par3EntityPlayer) { if (!par2World.isRemote) { par3EntityPlayer.addChatMessage("This line is being hit"); Vec3 look = par3EntityPlayer.getLookVec(); EntitySmallFireball fireball2 = new EntitySmallFireball(par2World, par3EntityPlayer, 500, 500, 500); fireball2.setPosition(par3EntityPlayer.posX + look.xCoord * par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posY + look.yCoord * par3EntityPlayer.getEyeHeight()+1, par3EntityPlayer.posZ + look.zCoord * par3EntityPlayer.getEyeHeight()); fireball2.accelerationX = look.xCoord * 0.5; fireball2.accelerationY = look.yCoord * 0.5; fireball2.accelerationZ = look.zCoord * 0.5; par2World.spawnEntityInWorld(fireball2); } return par1ItemStack; } public String getVersion() { return "1.0"; } } // Common Proxy ************************************************************* package InnerPower; public class CommonProxy { // Client stuff public void registerRenderers() { // Nothing here as the server doesn't render graphics or entities! } } //Client Proxy Class**************************** package InnerPower.client; //extra imports were from expiraments i did trying to get my item to work in MP import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.client.MinecraftForgeClient; import InnerPower.CommonProxy; import InnerPower.SpellTomeFireball; public class ClientProxy extends CommonProxy { @Override public void registerRenderers() { // This is for rendering entities and so forth later on } }
  6. Hello! I posted on here a few days ago and you guys helped me out a lot, and now I'm having another issue so hopefully you guys can help me out again! So I'm still in the learning phases of my Minecraft mod, I'm really just testing how to add custom items and things right now. In single player I was able to make a "spellbook" sort of thing that would shoot fireballs when right clicked. Now that I'm trying to test it out for multiplayer, I can't get the right click functionality to work. I put breakpoints in the function and it never even seemed to hit them, unless I'm just using the breakpoints wrong. Over the last few days I've been searching the internet for some explanation as to what I need to change to get it working for multiplayer, but I haven't been able to find much. For awhile I suspected my issue was that the fireball entities weren't being recognized by the server, but looking through the minecraft source code I can't see any difference between how I call the function and how ghasts or blazes use it, and both of those work in multiplayer. Anyway, If any of you guys could help me figure out what I need to do differently, or can point me in the direction of a good article or tutorial, it would be much appreciated! And just like my last post, I can't get attachments to work so I will post the relevant bits of my code below! Thank you for taking the time to help me out!
  7. Oh wow! That got it working! Thank you! And thanks to everyone who replied to me!
  8. Ok, so I found where to put my mod, but my issue is now that I've been just using the run button on eclipse to test my mod builds on the MCP test server (in the MCP file in forge), I haven't been recompiling and reobfuscating it because I've only added like 1 recipe so far. So I don't really have a mod folder. I did find the folder containing my .class files under MCP>>src>>minecraft, but when I copy/pasted it there it didn't work. I figured it wouldn't but I gave it a try anyway. So will I have to recompile and reobfuscate every time I want to test to see if something works? Will that give me the finished mod folder I need to run it on the MCP test server? Or am I just missing something (which I very well could be)? Again thanks for everything guys, you've been very helpful! Thanks for having patience with me
  9. Ok so i tried switching serverSideRequired to true, which made no change unfortunately. Then I moved all of my blocks and items to the preInit function, which also made no change. I checked the server console and found that it said "3 mods loaded" which it lists as MCP, Forge, and ForgeModLoader. So I guess the server isn't registering my mod? Any ideas on how to fix this? That's weird though because my custom recipes are recognized to a degree, my spell book thing appears in the crafting output, if I hover over it it reads the name "Spell Tome: Fireball". When I click it it fidgets like it's going into my inventory but then doesn't, the same with my dirt to diamond test recipe. Is that because the recipes are registered client side, so they appear, but the server doesn't recognize them, so nothing happens when it is clicked? Thank you all for your help so far, even if the prior suggestions didn't pan out I'm super grateful for your input!
  10. Thanks guys! I'll try these out and get back to you! Thank you all for the help!
  11. So for the life of me I can't get attachments to work, I'm gonna have to just copy/paste my code. Sorry if this isn't the correct thing to do on this site, again I'm new //************************ Base Class ***************************** package InnerPower; //--------------------------------- import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.*; import net.minecraftforge.common.MinecraftForge; //----------------------------------- import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid= "AthInrPwr", name= "Inner Power", version= "Alpha 1.0") @NetworkMod(clientSideRequired= true, serverSideRequired= false) public class BaseClass { //*********** Defining blocks/items public static final Block InrPwrCrystal = new crystalBlock(550, Material.ground).setHardness(45.0f).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("crystalBlock").setCreativeTab(CreativeTabs.tabBlock).setTextureName("InnerPower_Block_Crystal"); public static final Item InrPwrWispEssence = new Item(5001).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("essenceWisp").setTextureName("InnerPower_Essence_WispyEssence"); public static final Item STFireball= new SpellTomeFireball(5000).setTextureName("InnerPower_SpellTome_Fireball"); //From new tutorial //instance of mod forge uses @Instance("AthInrPwr") public static BaseClass instance; //says where the client and server proxy code is loaded @SidedProxy(clientSide= "InnerPower.client.ClientProxy",serverSide="InnerPower.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } @EventHandler public void load(FMLInitializationEvent event) { GameRegistry.registerBlock(InrPwrCrystal, "crystal" ); LanguageRegistry.addName(InrPwrCrystal, "crystal"); MinecraftForge.setBlockHarvestLevel(InrPwrCrystal, "pickaxe", 3); LanguageRegistry.addName(InrPwrWispEssence, "Wispy Essence"); LanguageRegistry.addName(STFireball, "Spell Tome: Fireball"); GameRegistry.addRecipe(new ItemStack(STFireball, 1), new Object[]{ "xx","xx", 'x', Block.dirt }); //test recipie GameRegistry.addRecipe(new ItemStack(Item.diamond, 1), new Object[]{ "x x", " x ", "x x", 'x', Block.dirt }); } } //******************************** Spell Tome Class *********************************************** package InnerPower; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.projectile.EntitySmallFireball; import java.util.Random; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; public class SpellTomeFireball extends Item { //Default Constructor public SpellTomeFireball(int id) { super(id); setMaxStackSize(1); setCreativeTab(CreativeTabs.tabCombat); setUnlocalizedName("STfireball"); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityMagicPlayerMP par3EntityPlayer) { if (!par2World.isRemote) { if(par3EntityPlayer.getMana() >= 1) { Vec3 look = par3EntityPlayer.getLookVec(); EntitySmallFireball fireball2 = new EntitySmallFireball(par2World, par3EntityPlayer, 500, 500, 500); fireball2.setPosition(par3EntityPlayer.posX + look.xCoord * par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posY + look.yCoord * par3EntityPlayer.getEyeHeight()+1, par3EntityPlayer.posZ + look.zCoord * par3EntityPlayer.getEyeHeight()); fireball2.accelerationX = look.xCoord * 0.5; fireball2.accelerationY = look.yCoord * 0.5; fireball2.accelerationZ = look.zCoord * 0.5; par2World.spawnEntityInWorld(fireball2); par3EntityPlayer.setMana(par3EntityPlayer.getMana()-1); } else par3EntityPlayer.addChatMessage("I don't have enough mana to do that!"); } return par1ItemStack; } public String getVersion() { return "1.0"; } } //******************************************* Common Proxy Class ********************************************** package InnerPower; public class CommonProxy { // Client stuff public void registerRenderers() { // Nothing here as the server doesn't render graphics or entities! } } // ********************************************** Client Proxy Class ***************************************************** package InnerPower.client; import net.minecraftforge.client.MinecraftForgeClient; import InnerPower.CommonProxy; public class ClientProxy extends CommonProxy { @Override public void registerRenderers() { // This is for rendering entities and so forth later on } } //************************************** EntityMagicPlayerMP class, which is inherited from EntityPlayerMP ************************
  12. Hello all! I'm a bit new to Minecraft modding so please bare with me, as this is probably an easy fix. I'm working on a basic spells mod, and I've run into an issue.In single player I made a spell book that would shoot a fireball when right clicked, but when I try to get it working in multiplayer the crafting recipe for it does not work! The book appears in the crafting output, but when I click it it does not go into my inventory. To verify that the issue isn't just my book, I added another recipe that would turn a few blocks of dirt into diamond, and I got the same result. What do I have to do differently to get custom recipes working in multiplayer? I believe the issue has to do with the client server system in minecraft. I have both a clientProxy and commonProxy class, but they don't currently do anything because I don't quite know what to do with them I'll add my code in the attachments section, I used kennethbgoodin's Youtube tutorial to get my base class, client proxy and common proxy classes set up, so creadit for the structure of it goes to him! Also, I'm trying to add a mana system, so I created a player class inherited from the EntityPlayerMP class in minecraft and added a variable to store the amount of player mana, so that's why I have an "EntityMagicPlayerMP" class. Thank you so much for any help you guys can give! I'm still in the learning phases of this so anything you guys can teach me will be greatly appreciated! P.S. ok I'm having an issue uploading the attachment, I'll try attaching it in another comment (Sorry, I'm new here if you couldn't tell ) P.S.S Also it gave me an error that I uploaded this already, but my profile says I havn't posted anything yet. So if this is a re-post I'm very sorry!
×
×
  • Create New...

Important Information

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