Everything posted by Glistre
-
[Solved][1.7.10]Minecraft folder gone
that does make perfect sense when I switched it nothing happened I will try again THANKS
-
[Solved][1.7.10]Minecraft folder gone
I renamed my modding folder which contained Forge and Eclipse from Modding to Modding 1.7.10 and now when I launch eclipse the Minecraft folder with my mod is gone. I checked the file paths and all the folders and files are still there but I cannot see the Minecraft project in Eclipse. I tried renaming it back to Modding and it still will not show up. I backed up all my files and textures...but how the heck do I fix this without really messing things up more ... should I run setupDecompWorkspace ,,,debug and refresh dependencies or is there something really simple I am missing?
-
Helpme! I want Updata mod from 1.6.4 to 1.7.x
dont use languageregistry anymore...you need to create an en_lang file
-
[1.7.10]Setting enchantment to a certain item
oddly .. .no errors show up even with @Override but the item does not show as enchanted in the tab I can only get it to show with displayAllRelevantItems method in the creative tab
-
Adding a Custom Music Disc 1.7.10
I got an error Unable to play Unknown soundEvent unless I had this: @Override @SubscribeEvent public ResourceLocation getRecordResource(String name) { return new ResourceLocation(GlistreMod.MODID +":"+ name); } and my sounds json did not have "records. ' in front of wolf_howl { "records.wolf_howl": { "category": "record", "sounds": [ { "name": "wolf_howl", "stream": true } ] } } mine now works
-
Adding a Custom Music Disc 1.7.10
I'm still working on this I solved it for 1.6.4 but not 1.7.10 ...cannot seem to get the sound to play which I believe must be done using @SubscribeEvent instead of @ForgeSubscribe but the same methods no longer work This works in 1.6.4 public class SoundLoadHandler { @SideOnly(Side.CLIENT) @ForgeSubscribe public void onSoundsLoaded(SoundLoadEvent event) { SoundManager src = event.manager; src.soundPoolStreaming.addSound("glistremod:wolf_howl.ogg"); /* src.soundPoolStreaming.addSound(ref.uid + ":jingle.ogg"); */ } /* @ForgeSubscribe public void onSound(SoundLoadEvent event) { event.manager.soundPoolStreaming.addSound("glistremod:wolf_howl"); }*/ @SideOnly(Side.CLIENT) @ForgeSubscribe public void onPlayStreaming(PlayStreamingEvent event) { boolean isCont; isCont = event.name.contains("glistremod"); if (!isCont) { FMLClientHandler.instance().getClient().sndManager.playStreaming("glistremod:" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F); } } } and put on the Event bus with : MinecraftForge.EVENT_BUS.register(new SoundLoadHandler()); maybe you can work with that
-
[1.7.10]Setting enchantment to a certain item
Must because it's the German kind of fun and I'm a masochist then...lol This works for me in 1.6.4 but for some reason not 1.7.10 . . .what the heck am I missing? [1/6/4]works: @Override public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List list) { //Adds string with smite level 22 ItemStack string = new ItemStack(Main.Glistre_Sword); string.addEnchantment(Enchantment.smite, 22); list.add(string); } [1.7.10] not working: public void getSubItems(Item itemIn, CreativeTabs tab, List subItems){ // subItems.add(new ItemStack(itemIn, 1, 0)); ItemStack string = new ItemStack(GlistreMod.Glistre_Sword); string.addEnchantment(Enchantment.fireAspect, 7); subItems.add(string); The only difference I see is that the method in 1.7.10 has Item for the first parameter versus int in 1.6.4???
-
[Solved]Text repeated over and over in hotbar 1.6.4 mod
I do not really get the NBT stuff but here's what did work for me: @Override public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List list) { //super (par1, par2CreativeTabs, list, EnumEnchantmentType.weapon); // list.add(new ItemStack(par1, 1, 0));} // list.add(new ItemStack(Main.Glistre_Sword, 1, 0)); //Adds string with smite level 22 ItemStack string = new ItemStack(Main.Glistre_Sword); string.addEnchantment(Enchantment.smite, 22); list.add(string); } Didnot need the super constructor even though eclipse says it needs it
-
[1.7.10]Setting enchantment to a certain item
diesenben07 I have a similar prob and lack of understanding, sadly, and question for you or the forum: How do you override the getSubItems method correctly....I am not even sure why / how that method works, really? I have no trouble with adding the echant to the item, or the recipe, but it does not show as being enchanted in the creative tab or inventory unless I craft it? Or could there be another method needed? I have extended the Item class and tried to override the method as follows: @Override public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List list) {list.add(new ItemStack(par1, 1, 0));} //overriden with the following list.add(new ItemStack(Main.Glistre_Sword, 1, 0));} That does not do anything so I am sure I have it wrong This is from my main class : ItemStack enchantglistre_sword = new ItemStack(Glistre_Sword, 1); enchantglistre_sword.addEnchantment(Enchantment.smite, 22); GameRegistry.addShapelessRecipe(enchantglistre_sword, Item.bone, Item.appleGold);
-
[1.7.10]Trubble with adding music disc
Here's thread from this forum and a tut that might help you ...there is a link to a sounds.json as well. I am working on the same thing. . .but I get an error Unable to Load Empty Sound Event ...I think my trouble is how to make the sound event get picked up by forge. My record plays but no sound. I got this to work in 1.6.4 by using @ForgeSubscribe to put the event on the Minecraft.EVENT_BUS ...I had a thread on that. So either my file path is wrong or I am not registering the sound event properly. If I get it fixed before you I will post my code and explanation here. If you get yours first then , I hope, you will do the same for me to save time... good luck happy modding http://www.minecraftforge.net/forum/index.php?topic=26910.0 http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2172652-custom-music-disc-forge-tutorial-1-7-2-1-7-10
-
@Mod annotation suddenly doesn't work
Did you try checking the file PATH under environmental settings when you set up JDK? That's a long shot but might be worth checking
-
[1.7.10]Setting enchantment to a certain item
one way I am sure not the only way should be a method to call the enchantment like .onCreated I put this in my item class and it worked for me } /** Makes your Item Enchanted when it is crafted */ public void onCreated(ItemStack item, World world, EntityPlayer player) { item.addEnchantment(Enchantment.blastProtection, 10); // Replace the "." after "Enchantment" to see options // The number is the Enchantment Level }
-
[Solved] [1.6.4] question custom record sound not playing
GOT IT ... my last problem was that I need the @ForgeSubscribe annotation over the "events" in the SoundLoadHandler class (because it has two events" that need to be uploaded to the EVENT_BUS in the registration: via MinecraftForge.EVENT-BUS.register (new SoundLoadHandler ()); Wow so happy to get this working this problem should bring back some memories for all those who used to mod 1.6.4 ..this would have been so easy if there was a good tut on this problem out there. LOL now I just have to make it work in 1.8 Thanks for helping xwerswoodx and forum! package glistremod; import java.lang.annotation.Retention; import java.lang.annotation.Target; import net.minecraft.client.audio.SoundManager; import net.minecraftforge.client.event.sound.PlayStreamingEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import cpw.mods.fml.client.FMLClientHandler; import net.minecraftforge.event.EventPriority; import net.minecraftforge.event.ForgeSubscribe; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SoundLoadHandler { @SideOnly(Side.CLIENT) @ForgeSubscribe public void onSoundsLoaded(SoundLoadEvent event) { SoundManager src = event.manager; src.soundPoolStreaming.addSound("glistremod:wolf_howl.ogg"); /* src.soundPoolStreaming.addSound(ref.uid + ":jingle.ogg"); */ } /* @ForgeSubscribe public void onSound(SoundLoadEvent event) { event.manager.soundPoolStreaming.addSound("glistremod:wolf_howl"); }*/ @SideOnly(Side.CLIENT) @ForgeSubscribe public void onPlayStreaming(PlayStreamingEvent event) { boolean isCont; isCont = event.name.contains("glistremod"); if (!isCont) { FMLClientHandler.instance().getClient().sndManager.playStreaming("glistremod:" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F); } } } http://minecraftforgetutorials.weebly.com/event-introduction.html "You should notice something over the method header, this is called an Annotation. These essentially allow a method to have extra data assigned to the method, however in this case this annotation is telling Forge that it has to subscribe this method to the Event Bus, which we will be getting to later. You should also notice this method takes an argument, which is required for events. It also allows you to access certain things the event stores, in this case the item that the player picks up. "So we have a class that has the event method within it, however if you try and run the game you will quickly realize that the code is never ran, we have the ForgeSubscribe annotation over the method but we have left out the Event Bus registration, we will now add that! Place this code into any of your init methods in your core mod class: MinecraftForge.EVENT_BUS.register(new ItemPickupHandler()); This code registers the event class with the Forge Event Bus, which is a list of all the event handlers that have been registered, which t. . ."
-
[Solved] [1.6.4] question custom record sound not playing
Thanks for your help I have tried this a hundred different ways, says its playing the record but no sound, I just cannot find the mistake: My sounds.json looks like this it is not in the sounds folder but next to it: I have tried several variations of the name such as "records/wolf_howl" and several others: { "wolf_howl": { "category": "record", "sounds": [ { "name": "wolf_howl", "stream": true } ] } } My SoundLoadHandler class: package glistremod; import java.lang.annotation.Retention; import java.lang.annotation.Target; import net.minecraft.client.audio.SoundManager; import net.minecraftforge.client.event.sound.PlayStreamingEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import cpw.mods.fml.client.FMLClientHandler; import net.minecraftforge.event.EventPriority; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SoundLoadHandler { @SideOnly(Side.CLIENT) public void onSoundsLoaded(SoundLoadEvent event) { SoundManager src = event.manager; src.soundPoolStreaming.addSound("glistremod:wolf_howl.ogg"); } @SideOnly(Side.CLIENT) public void onPlayStreaming(PlayStreamingEvent event) { boolean isCont; isCont = event.name.contains("glistremod"); if (!isCont) { FMLClientHandler.instance().getClient().sndManager.playStreaming("glistremod:" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F); } } } My MusicDisc class extends ItemRecord: package glistremod.items; import glistremod.Main; import java.util.HashMap; import java.util.List; import java.util.Map; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockJukeBox; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.client.event.sound.PlayStreamingEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; public class MusicDisc extends ItemRecord { private static final Map records = new HashMap(); public String music; public MusicDisc (int ItemID, String name, String music) { super(ItemID, music); this.setCreativeTab(CreativeTabs.tabMisc); this.setUnlocalizedName(name); this.music = music; this.setMaxStackSize(1); GameRegistry.registerItem(this, name); } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("glistremod:" + this.getUnlocalizedName()); } @Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { if (world.getBlockId(x, y, z) == Block.jukebox.blockID && world.getBlockMetadata(x, y, z) == 0) { if (world.isRemote) return true; else { ((BlockJukeBox)Block.jukebox).insertRecord(world, x, y, z, itemStack); world.playAuxSFXAtEntity((EntityPlayer)null, 1005, x, y, z, this.itemID); --itemStack.stackSize; return true; } } else return false; } /** * allows items to add custom lines of information to the mouseover description */ @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(this.getRecordTitle()); } /** * Return the title for this record. */ @Override public String getRecordTitle() { return StatCollector.translateToLocal(this.getUnlocalizedName() + ".desc"); } @Override public EnumRarity getRarity(ItemStack itemStack) { return EnumRarity.rare; } /** * Return the record item corresponding to the given name. */ public static MusicDisc getRecord(String music) { return (MusicDisc)records.get(music); } public ResourceLocation getRecordResource(String name) { return new ResourceLocation("glistremod:wolf_howl.ogg"); } public String getSoundFile() { return ("glistremod:wolf_howl.ogg"); } } My main class: before preinit identified: public static Item wolf_howl; public static int wolf_howlID; in the preinit method registered: // LOAD RECORD //.setUnlocalizedName("wolf_howl").setCreativeTab(MyCreativeTab_1) wolf_howl = new MusicDisc(wolf_howlID, "wolf_howl", "wolf_howl"); // GameRegistry.registerItem(wolf_howl, "wolf_howl"); LanguageRegistry.addName(wolf_howl, "Wolf Howl"); LanguageRegistry.instance().addStringLocalization("item.wolf_howl.desc", "en_US", "Wolf Howl"); and in init : MinecraftForge.EVENT_BUS.register(new SoundLoadHandler()); My file path is Forge\mcp\src\minecraft\assets\glistremod\records to the sound file wolf_howl.ogg. I just cannot see why in the world this is not playing a sound ...by any chance do you see any errors or is actually possible to break forge? Thank you
-
[Solved] [1.6.4] question custom record sound not playing
Thank you very much. . .for taking pity on a poor modder my brain is worn out Could you possibly post your SoundLoadHandler code ...mine is named something else, missing or something... Both your code for creating the record and mine works great, and my song seems to be playing, and no trouble seemingly to register or name the item/record. Maybe my problem perhaps is with the event: MinecraftForge.Event_Bus.register (new SoundLoadHandler()); Is SoundLoadHandler a class in forge? I have a class called SoundLoadEvent however when I try to use that I get an error .. I tried using this : @ForgeSubscribe public void onSound(SoundLoadEvent event) { event.manager.soundPoolStreaming.addSound("glistremod:wolf_howl"); } and this @ForgeSubscribe public void onSoundLoaded(SoundLoadEvent event) { event.manager.soundPoolStreaming.addSound("glistremod:wolf_howl"); } to call the sound. I am wondering if perhaps there was something wrong with my sounds.json or my record path was wrong but I have tried it one hundred different ways. Thank you for your help. I think I will see if perhaps there is a tut on the MinecraftForge.Event_Bus.
-
Adding a Custom Music Disc 1.7.10
I am having the same problem been on this for days I hope someone has some suggestions should it be io14: since that is your modid ?
-
[Solved] [1.6.4] question custom record sound not playing
I did not have a SoundLoadHandler class. there is a "SoundLoadEvent" class ...should I have just added your methods from the SoundLoadHandler class like you have to my SoundLoadEvent class? I was not sure so I created a SoundLoadHandler class ...should not it extend another class ? Here's what mine looks like ...I did not use "ref.uid" have no idea what that is I assumed it denotes your MODID or main class.. Anyway this is what I created it does not work/play the record...still says it is playing but no sound... package glistremod; import java.lang.annotation.Retention; import java.lang.annotation.Target; //import net.extend.mod.ref; import net.minecraft.client.audio.SoundManager; import net.minecraftforge.client.event.sound.PlayStreamingEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import cpw.mods.fml.client.FMLClientHandler; import net.minecraftforge.event.EventPriority; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SoundLoadHandler { @SideOnly(Side.CLIENT) public void onSoundsLoaded(SoundLoadEvent event) { SoundManager src = event.manager; src.soundPoolStreaming.addSound("glistremod" + ":Wolf_Howl.ogg"); /* src.soundPoolStreaming.addSound(ref.uid + ":jingle.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":wish.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":birgoruskabininde.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":ahsensiz.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":konewyear.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":numb.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":beautifulmind.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":somebodytoldme.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":kids.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":ghostsnstuff.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":vivalavida.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":applause.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":diamonds.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":moveslikejagger.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":rapgod.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":setfiretorain.ogg"); src.soundPoolStreaming.addSound(ref.uid + ":survival.ogg");*/ } @SideOnly(Side.CLIENT) public void onPlayStreaming(PlayStreamingEvent event) { boolean isCont; isCont = event.name.contains("glistre:"); if (!isCont) { FMLClientHandler.instance().getClient().sndManager.playStreaming("glistremod" + ":" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F); } } }
-
[Solved][1.7.10] [1.6.4] custom record will not play sound
[solved this problem I put the answer in in earlier thread I know I am probably doing something really, really , really dumb, but I have been working on this for days and I would subject myself to ridicule from the forum and be anyone's whipping boy if they can set my on the right path. My custom record seems to be called no problem but no matter WHAT i do I absolutely cannot get it to play...it does not play in either 1.6.4 or 1.7.10, I have tried it in BOTH versions there is not that much code difference but to no avail in either. My record is : Wolf_Howl.ogg in the package assets.glistremod.sounds My sounds.json is in assets/glistremod This forum has some brilliant people could anyone help? package glistremod.items; import glistremod.Main; import java.util.HashMap; import java.util.List; import java.util.Map; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockJukeBox; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.client.event.sound.PlayStreamingEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; public class MusicDisc extends ItemRecord { private static final Map records = new HashMap(); public final String recordName; public MusicDisc(int ItemID, String recordName) { super(ItemID, recordName); this.setCreativeTab(CreativeTabs.tabMisc); this.recordName = recordName; this.maxStackSize = 1; records.put(recordName, this); } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister iconRegister) { itemIcon = iconRegister.registerIcon("glistremod:" + recordName); } @Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { if (world.getBlockId(x, y, z) == Block.jukebox.blockID && world.getBlockMetadata(x, y, z) == 0) { if (world.isRemote) return true; else { ((BlockJukeBox)Block.jukebox).insertRecord(world, x, y, z, itemStack); //world.playAuxSFX(1005, x, y, z, this.itemID); world.playAuxSFXAtEntity((EntityPlayer)null, 1005, x, y, z, this.itemID); --itemStack.stackSize; return true; } } else return false; } /** * allows items to add custom lines of information to the mouseover description */ @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(this.getRecordTitle()); } /** * Return the title for this record. */ @Override public String getRecordTitle() { return StatCollector.translateToLocal(this.getUnlocalizedName() + ".desc"); } /** * *Possibly returns record titles from Vanilla minecraft */ /* public String getRecordTitle() { return "C418 - " + this.recordName; }*/ @Override public EnumRarity getRarity(ItemStack itemStack) { return EnumRarity.rare; } /** * Return the record item corresponding to the given name. */ public static MusicDisc getRecord(String recordName) { return (MusicDisc)records.get(recordName); } public ResourceLocation getRecordResource(String name) { return new ResourceLocation("glistremod:sounds/Wolf_Howl.ogg"); } public String getSoundFile() { return ("glistremod:sounds/Wolf_Howl.ogg"); } @ForgeSubscribe public void onSound(SoundLoadEvent event) { event.manager.soundPoolStreaming.addSound("glistremod:sounds/Wolf_Howl"); } // event.manager.soundPoolSounds.addSound("x/sound2.ogg", mod_ModName.class.getResource("/x/sound2.ogg")); public void onPlayStreaming(PlayStreamingEvent event) { boolean isCont; isCont = event.name.contains("Wolf_Howl"); if (!isCont) { FMLClientHandler.instance().getClient().sndManager.playStreaming("glistremod"+ ":" + event.name, event.x + 0.5F, event.y + 0.5F, event.z + 0.5F); } } } sounds.json file: { "record_Glistre": { "category":"master", "sounds": [ { "name": "Wolf_Howl", "stream": true } ] } } my main file before preInit: public static ItemRecord record_Glistre; my main file in the preInit method: // LOAD RECORD record_Glistre=(ItemRecord) new MusicDisc(2003, "Wolf_Howl").setUnlocalizedName("Wolf_Howl").setCreativeTab(MyCreativeTab_1); GameRegistry.registerItem(record_Glistre, "Wolf_Howl"); // MinecraftForge.EVENT_BUS.register(new SoundEvent());
-
[Solved] [1.6.4] question custom record sound not playing
I was not able to get that to work, what is ref.uid? also the .SoundManager does not allow me to import Thanks for your help though I am just lost. I cannot find any .ogg files in any folders. Seems like my record is registered fine but it either does not call the sound or cannot find it I added this streaming method but does not call it public void onSound(SoundLoadEvent event) { event.manager.soundPoolStreaming.addSound("glistremod:records/record_Glistre"); } I do not want to give up yet and move to 1.7.10 until I finish this record thing. Any help would be appreciated
-
[Solved] [1.6.4] question custom record sound not playing
Thanks I also have the same mod in 1.7.10 I just wanted to be complete in both versions then going to upgrade it to 1.8
-
[Solved] [1.6.4] question custom record sound not playing
my custom record ..sound is not playing . this is 1.6.4 but I wanted to update that version. The record seems to work perfect and plays in the jukebox and says it is playing , however the sound is not coming out. I have tried three methods to pull/play the sound "getRecordResource" seems to only be a 1.7.10 method not 1.6.4, onSound which does not work I think my setup would be different? ; and getSoundFile and that seems like it is working but not pulling the sound . I put my .ogg file in several places ...still not playing Would anyone know what I need to do to make this work and pull the sound? package glistremod.items; import glistremod.Main; import java.util.HashMap; import java.util.List; import java.util.Map; import net.minecraft.block.Block; import net.minecraft.block.BlockJukeBox; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.client.event.sound.SoundLoadEvent; public class MusicDisc extends ItemRecord { private static final Map records = new HashMap(); public final String recordName; public MusicDisc(int ItemID, String recordName) { super(ItemID, recordName); this.setCreativeTab(CreativeTabs.tabMisc); this.recordName = recordName; this.maxStackSize = 1; records.put(recordName, this); } @Override public void registerIcons(IconRegister iconRegister) { itemIcon = iconRegister.registerIcon("glistremod:" + "record_" + recordName); } @Override public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { if (world.getBlockId(x, y, z) == Block.jukebox.blockID && world.getBlockMetadata(x, y, z) == 0) { if (world.isRemote) return true; else { ((BlockJukeBox)Block.jukebox).insertRecord(world, x, y, z, itemStack); world.playAuxSFXAtEntity((EntityPlayer)null, 1005, x, y, z, this.itemID); --itemStack.stackSize; return true; } } else return false; } @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(this.getRecordTitle()); } @Override public String getRecordTitle() { return StatCollector.translateToLocal(this.getUnlocalizedName() + ".desc"); } @Override public EnumRarity getRarity(ItemStack itemStack) { return EnumRarity.rare; } public static MusicDisc getRecord(String par0Str) { return (MusicDisc)records.get(par0Str); } public String getSoundFile() { // return "/assets/glistremod/records/record_Glistre.ogg"; return ("glistremod:" + "record_Glistre.ogg"); } } /*public void onSound(SoundLoadEvent event) { try { event.manager.soundPoolSounds.addSound("x/record_Glistre.ogg"); // event.manager.soundPoolSounds.addSound("x/sound2.ogg", mod_ModName.class.getResource("/x/sound2.ogg")); } }*/ /* public ResourceLocation getRecordResource(String name) { return new ResourceLocation("glistremod:" + name); } }*/
-
[Solved]Text repeated over and over in hotbar 1.6.4 mod
""To do that you will need to override: Code: [select] @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { subItems.add(new ItemStack(itemIn, 1, 0)); } And add any kind of ItemStack with alredy set NBT tag you want."" Sorry I do not really understand ....I am very new at this ..is that code in the Item file and I override it? I can see that the onUpdate keeps updating every so many ticks or something
-
[Solved]Text repeated over and over in hotbar 1.6.4 mod
just be there as the sword already enchanted in creative ...ie, even if you did not craft it
-
[Solved]Text repeated over and over in hotbar 1.6.4 mod
Would it still add on startup/ launch or only after crafting?
-
[Solved]Text repeated over and over in hotbar 1.6.4 mod
Thank you ...do you know how I would add this Enchantment "smite" on startup but without adding it over and over and over and over?
IPS spam blocked by CleanTalk.