Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RANKSHANK

Members
  • Joined

  • Last visited

Everything posted by RANKSHANK

  1. boolean[] keyBindRepeatFlag = { (boolean)false }; WAT Aside from that, you're going to need an Object instance not a class instance to do something like that, as in how are you getting your EntityHellHound hound ?
  2. public String registerExtendedProperties(String identifier, IExtendedEntityProperties properties) Grab an isntance of the player and use this to bind your properties to them
  3. Why not use IExtendedEntityProperties? you can directly save it into the player then-
  4. well theres a variety of ways, you could store in a NBTTagCompound and then use CompressedStreamTools.writeCompressed(NBTTagCompound, OutPutStream); you'd have to set up the output stream public void write(NBTTagCompound yourData, String loc) throws Exception; File f = new File(loc + "filename.dat"); if(!f.exists() &&(!f.mkdirs() | !f.createNewFile())) throw new Exception("Failed to write @" + f.getAbsolutePath()); FileOutputStream out = new FileOuputStream(f); CompressedStreamTools.writeCompressed(yourData, out); out.close(); //ALWAYS ALWAYS ALWAYS CLOSE YOUR STREAMS WHEN THEY ARE OPEN or if you want a modifiable value in a text file you can use a BufferedWriter BufferedWriter b = new BufferedWriter(new FileWriter(File yourFile))); b.close();//ALWAYS or you could always use the plain file output stream FileOutputStream out = new FileOutputStream(File yourFile); out.write(ByteBuffer.wrap(new byte[0]).putInt(yourVal).array()); out.close();//AGAIN and theres many more methods of writing you can find. it depends on what you want. you could even go heavy on the sauce and implement Serializable and writing your whole class, of course delegating transient values- though that's a tad overkill here.
  5. umm if you bothered to look... ENUMVALUE.toString();
  6. Nope you don't need a MC .modinfo file you have to set autogenerated to false. I use: @PreInit public void randomName(FMLPreInitializationEvent event){ ModMetadata m = event.getModMetadata(); m.autogenerated = false; m.modid = ID; m.version = VERSION; m.name = NAME; m.description = description; m.authorList.add(authorNam);} and it works. for multiple mods in the same workspace /horray
  7. Nope you don't need a MC .modinfo file you have to set autogenerated to false. I use: @PreInit public void randomName(FMLPreInitializationEvent event){ ModMetadata m = event.getModMetadata(); m.autogenerated = false; m.modid = ID; m.version = VERSION; m.name = NAME; m.description = description; m.authorList.add(authorNam);} and it works. for multiple mods in the same workspace /horray
  8. Hard coding your mod info is easier
  9. Hard coding your mod info is easier
  10. If you need to set the value, look at GuiScreenBook, if the value is set by opening the Gui its done by sending the changed value. Alternatively, if you are setting the value server side, you could simply do so in your IGuiHandler like so: Random rand = new Random(); @Override public Object getServerGuiElement(int ID, EntityPlayer p, World w, int x, int y, int z) { if(ID == yourGuiID && p.getCurrentEquippedItem == yourItem){ ItemStack i = p.getCurrentEquippedItem(); if(!i.hasTagCompound()); i.setTagCompound(new NBTTagCompound); i.getTagCompound().setInteger("randVal", rand.nextInt(intYourRange); //or use your wrapper here } return null; }
  11. If you need to set the value, look at GuiScreenBook, if the value is set by opening the Gui its done by sending the changed value. Alternatively, if you are setting the value server side, you could simply do so in your IGuiHandler like so: Random rand = new Random(); @Override public Object getServerGuiElement(int ID, EntityPlayer p, World w, int x, int y, int z) { if(ID == yourGuiID && p.getCurrentEquippedItem == yourItem){ ItemStack i = p.getCurrentEquippedItem(); if(!i.hasTagCompound()); i.setTagCompound(new NBTTagCompound); i.getTagCompound().setInteger("randVal", rand.nextInt(intYourRange); //or use your wrapper here } return null; }
  12. if(world.isRemote){ so you don't want your data stored...? if it's not done serverside, the item will have its data reset... unless you have [/code]@Override public boolean shareTag(ItemStack i){ //something like this, double check the method name return false; }[/code] to prevent the server from sending an overwriting nbt packet, but whatever data you store WILL be lost when the itemstack is offloaded in any way...
  13. if(world.isRemote){ so you don't want your data stored...? if it's not done serverside, the item will have its data reset... unless you have [/code]@Override public boolean shareTag(ItemStack i){ //something like this, double check the method name return false; }[/code] to prevent the server from sending an overwriting nbt packet, but whatever data you store WILL be lost when the itemstack is offloaded in any way...
  14. use the forge tutorials on the wiki Knife.iconIndex = ModLoader.addOverride("/gui/items.png", "/item/sword.png"); Minecraft builds its own textures now, that's dead code, also, icon setting is handled in the ItemClass in a @SideOnly(Side.CLIENT);- so keep it there and that will be SMP safe
  15. use the forge tutorials on the wiki Knife.iconIndex = ModLoader.addOverride("/gui/items.png", "/item/sword.png"); Minecraft builds its own textures now, that's dead code, also, icon setting is handled in the ItemClass in a @SideOnly(Side.CLIENT);- so keep it there and that will be SMP safe
  16. It's dependent on the modder declaring whether it's content should be required for connection or not...
  17. It's dependent on the modder declaring whether it's content should be required for connection or not...
  18. you need to take a look at grabbing accessible instances with reflection
  19. you need to take a look at grabbing accessible instances with reflection
  20. Well you'd need to send the new spawner entity ID and the minecart's ID and then when recieved grab that minecart with its ID and pseudo load it, there's a few good packet tutorials on the wiki, start with the simpler one here: http://www.minecraftforge.net/wiki/Packet_Handling ps: ALWAYS CLOSE THE STREAM
  21. Well you'd need to send the new spawner entity ID and the minecart's ID and then when recieved grab that minecart with its ID and pseudo load it, there's a few good packet tutorials on the wiki, start with the simpler one here: http://www.minecraftforge.net/wiki/Packet_Handling ps: ALWAYS CLOSE THE STREAM
  22. just a snippet from my project, probably should have left that out too I'll fix it EDIT: fixed, thanks for that
  23. just a snippet from my project, probably should have left that out too I'll fix it EDIT: fixed, thanks for that
  24. GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] { "T T", "TTT", "TTT", 'T', Crystalia.baconiteIngot, }); //tools baconiteBow = new BaconiteBow(5010).setUnlocalizedName("Crystalia:baconiteBow"); LanguageRegistry.addName(baconiteBow, "Baconite Bow"); here you are registering recipes before creating the item, which is a no. this registers a null instead of the item, since the item is set to null until you have placed an instance in it
  25. GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] { "T T", "TTT", "TTT", 'T', Crystalia.baconiteIngot, }); //tools baconiteBow = new BaconiteBow(5010).setUnlocalizedName("Crystalia:baconiteBow"); LanguageRegistry.addName(baconiteBow, "Baconite Bow"); here you are registering recipes before creating the item, which is a no. this registers a null instead of the item, since the item is set to null until you have placed an instance in it

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.