Jump to content

spda

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by spda

  1. Great! now the textures appeared Yes, i can see my textures from eclipse. Thank you very much P.S. since i didn't want my item to throw the ender eye entity i started working on customizing it as a new entity that flys towards the spawn point, i wanted it to have the same item's texture, just like the ender eye, but my entity looks like a white box , i couldn't figure out how to make it like the ender eye (the thrown entity looks like the item), i referenced the EntityEnderEye code and changed it to my liking (like the size, life time and dropping an item on its death). I might try to make a cube that has Magic Home Finder's texture in all faces and assign it to the entity but if i could do it like the way EntityEnderEye is, it would be better. Thanks again
  2. Ok, now i am not using the unlocalized name for the texture name and i have removed the override, but i still can't see the textures, my updated code is available at https://github.com/EZtouch/EZtouch/tree/master/src Thanks again
  3. Great, now i don't get the error any more, however i still can't see anything in my hand and the icon is pink and black [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [Client thread/INFO]: Created: 256x256 textures/items-atlas Here's my whole mod with the textures and everything https://github.com/EZtouch/EZtouch/tree/master/src Thanks again
  4. I've tried all of the following and none of them worked My Folder structure (as text files) is available in the attachments via the following links in many formats http://pastebin.com/7Pti45ed http://pastebin.com/fYwVSh0D third one "too long for websites to host"
  5. i tried changing my texture to 16*16 PNG, changed its name to all lower-case letters, tried both C:\Users\MyUser\Desktop\Forge Development Environment\eclipse\assets\mymod\textures\items and C:\Users\MyUser\Desktop\Forge Development Environment\src\minecraft\assets\mymod\textures\items i also tried "refreshing the textures" via clicking on the resource pack button, and it didn't work I am running minecraft from eclipse. it can't find the file, either there's something with my path or there's something in my code FMLPreInitializationEvent ItemMagicMirror = new ItemMagicMirror().setUnlocalizedName("diamond"); GameRegistry.registerItem(ItemMagicMirror, "Magic Mirror"); The code for registering the texture @SideOnly(Side.CLIENT) private IIcon icon; @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { icon = par1IconRegister.registerIcon(MyMod.MODID + ":" + (this.getUnlocalizedName().substring(5))); } On a side note, when i try to upload my texture "in this forum" as an attachment, it says "An Error Has Occurred! Cannot access attachments upload path!" running eclipse as an administrator did not help
  6. changed my Mod ID it to "mymod", still didn't work java.io.FileNotFoundException: mymod:textures/items/Magic Home Finder.png java.io.FileNotFoundException: mymod:textures/items/Magic Ender Pearl.png java.io.FileNotFoundException: mymod:textures/items/Magic Mirror.png All of my textures are 24x24 pixels, my "Forge Development Environment" contains the gradlew bat and build, my eclipse folder inside it contains my development minecraft folder, i've tried copying my images over to C:\Users\MyUser\Desktop\Forge Development Environment\eclipse\assets\mymod\textures\items\ , but it didn't work
  7. Great! , by the way, do you happen to know the directory that should contain my items' textures? I've tried "C:\Users\MyUser\Desktop\Forge Development Environment\src\minecraft\assets\MyMod\textures\items\Magic Home Finder.PNG" and i have this in my item's class @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { icon = par1IconRegister.registerIcon(MyMod.MODID + ":" + (this.getUnlocalizedName().substring(5))); } and this in my main class public void preInit(FMLPreInitializationEvent event) { ItemMagicHomeFinder = new ItemMagicHomeFinder().setUnlocalizedName("Magic Home Finder"); GameRegistry.registerItem(ItemMagicHomeFinder, "Magic Home Finder"); } I get this error, it couldn't find the textures, my Mod ID is "MyMod" [Client thread/ERROR]: Using missing texture, unable to load mymod:textures/items/Magic Home Finder.png java.io.FileNotFoundException: mymod:textures/items/Magic Home Finder.png and my items' names are not "readable for users" , i've looked for a way to let it be "readable" and i've tried adding LanguageRegistry.addName(ItemMagicHomeFinder, "Magic Home Finder"); under the FMLInitializationEvent and that did not work. Thanks in advance
  8. Thanks fixed by changing it to @Override public void func_150895_a(Item par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(this, 1, 0)); }
  9. Thanks , it got fixed by changing to public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par2World.isRemote) { ChunkCoordinates coordinates = par3EntityPlayer.getBedLocation(0); if (coordinates == null) { coordinates = par2World.getSpawnPoint(); } EntityEnderEye entityendereye = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double) par3EntityPlayer.yOffset, par3EntityPlayer.posZ); entityendereye.moveTowards((double) coordinates.posX + 0.5D, (int) coordinates.posY + 3, (double) coordinates.posZ + 0.5D); par2World.spawnEntityInWorld(entityendereye); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); par2World.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ, 0); } return par1ItemStack; } All that is left is to figure out why is it registering the item twice
  10. Hello, i have been creating my first mod and it contains an item called"magic home finder", i referenced the net.minecraft.item.ItemEnderEye class, so far it works okay but i seem to have 2 bugs that i can't seem to resolve, one is that my item flys to the global spawn point chunk, however it is expected to go to the user's spawn point "bed" and the second one is that the item is duplicated in minecraft " i can see it in the creative inventory twice". Here's the ItemMagicHomeFinder class package MyMod.items; import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityEnderEye; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import MyMod.MyMod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemMagicHomeFinder extends Item { public ItemMagicHomeFinder() { super(); this.setCreativeTab(CreativeTabs.tabMisc); this.setTextureName("Magic_Home_Finder"); this.maxStackSize = 1; } @SideOnly(Side.CLIENT) private IIcon[] icons; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[2]; for (int i = 0; i < icons.length; i++) { icons[i] = par1IconRegister.registerIcon(MyMod.MODID + ":" + (this.getUnlocalizedName().substring(5)) + i); } } public static final String names = "Magic Home Finder"; @Override public String getUnlocalizedName(ItemStack par1ItemStack) { int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15); return super.getUnlocalizedName() + "." + names; } @Override public IIcon getIconFromDamage(int par1) { return icons[par1]; } @SuppressWarnings({ "unchecked", "rawtypes" }) @SideOnly(Side.CLIENT) @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par3World.isRemote) { return true; } return false; } /** * Called whenever this item is equipped and the right mouse button is * pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par2World.isRemote) { ChunkCoordinates coordinates = par3EntityPlayer.getBedLocation(0); if (coordinates != null) { coordinates = par2World.getSpawnPoint(); EntityEnderEye entityendereye = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double) par3EntityPlayer.yOffset, par3EntityPlayer.posZ); entityendereye.moveTowards((double) coordinates.posX + 0.5D, (int) coordinates.posY + 3, (double) coordinates.posZ + 0.5D); par2World.spawnEntityInWorld(entityendereye); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); par2World.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ, 0); } } return par1ItemStack; } @Override public void func_150895_a(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int x = 0; x < 2; x++) { par3List.add(new ItemStack(this, 1, x)); } System.out.println("\n" + "\n" + "\n" + "\n" + "ItemMagicHomeFinder done" + "\n" + "\n" + "\n" + "\n"); } } and here's the main class "MyMod" package MyMod; import net.minecraft.item.Item; import MyMod.config.ConfigHandler; import MyMod.items.ItemMagicHomeFinder; import MyMod.items.ItemMagicMirror; import MyMod.job.JobHandler; import MyMod.proxies.CommonProxy; import MyMod.tests.TestsHandler; 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.registry.GameRegistry; @Mod(modid = MyMod.MODID, name = MyMod.NAME, version = MyMod.VERSION) public class MyMod { public static final String MODID = "MyMod"; public static final String NAME = "Example"; public static final String VERSION = "1.0"; @Instance(MyMod.MODID) public static MyMod instance; private static Item ItemMagicMirror = new ItemMagicMirror(); private static Item ItemMagicHomeFinder = new ItemMagicHomeFinder(); public static Item JobHandler = new JobHandler(); @SidedProxy(clientSide = "MyMod.proxies.ClientProxy", serverSide = "MyMod.proxies.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { // early things like registering items, blocks sounds ids , create // config ConfigHandler.init(event.getSuggestedConfigurationFile()); System.out.println(ConfigHandler.SOME_TEXT_VALUE); proxy.initSounds(); proxy.initRenderers(); //ItemMagicMirror = new ItemMagicMirror().setUnlocalizedName("Magical"); //GameRegistry.registerItem(ItemMagicMirror, "Magic Mirror"); ItemMagicHomeFinder = new ItemMagicHomeFinder().setUnlocalizedName("Magical"); GameRegistry.registerItem(ItemMagicHomeFinder, "Magic Home Finder"); proxy.registerRenderThings(); //JobHandler = new JobHandler(); } @EventHandler public void load(FMLInitializationEvent event) { proxy.registerRenderThings(); //JobHandler = new JobHandler(); //new JobHandler(); // MyMod.JobHandler.toast(); // JobHandler.toast() teast = new JobHadler.toast(); System.out.println("\n" + "\n" + "\n" + "\n" + "public void load(FMLInitializationEvent event) done" + "\n" + "\n" + "\n" + "\n"); } @EventHandler public void modsLoaded(FMLPostInitializationEvent event) { proxy.registerRenderThings(); //JobHandler = new JobHandler(); //new JobHandler(); // MyMod.JobHandler.toast(); // JobHandler.toast() teast = new JobHadler.toast(); System.out.println("\n" + "\n" + "\n" + "\n" + "public void load(FMLPostInitializationEvent event) done" + "\n" + "\n" + "\n" + "\n"); // TestsHandler tst = new TestsHandler TestsHandler.main(null); } } I am really new to modding, i referenced thishttp://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-updating-1-6-to-1-7-part-4-items/#comment-3221 link to create my items for 1.7.2 and inserted the code that lets an item do something on right click above that, it resulted on both items getting the same functionality which i didn't want, and so i made 2 classes for both this "Magic Home Finder" and another item which is still WIP "Magic Mirror". EDIT: for those who misunderstood me, my item flys towards the chunk where the player spawns on world creation instead of the one that contains the bed (yes, i did sleep on the bed). Feel free to let me know if anything else i am doing is wrong Thanks in advance
×
×
  • Create New...

Important Information

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