Everything posted by RANKSHANK
-
How to trigger methods from a class file using Keybinds?
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 ?
-
[1.5.1] Saving Integers in a Config File to Be Loaded Later
public String registerExtendedProperties(String identifier, IExtendedEntityProperties properties) Grab an isntance of the player and use this to bind your properties to them
-
[1.5.1] Saving Integers in a Config File to Be Loaded Later
Why not use IExtendedEntityProperties? you can directly save it into the player then-
-
[1.5.1] Saving Integers in a Config File to Be Loaded Later
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.
-
Chat Messages Color
umm if you bothered to look... ENUMVALUE.toString();
-
[solved]Mod info n' icon?
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
-
[solved]Mod info n' icon?
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
-
[solved]Mod info n' icon?
Hard coding your mod info is easier
-
[solved]Mod info n' icon?
Hard coding your mod info is easier
-
[SOLVED] Store data with NBTTag within items
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; }
-
[SOLVED] Store data with NBTTag within items
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; }
-
[SOLVED] Store data with NBTTag within items
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...
-
[SOLVED] Store data with NBTTag within items
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...
-
CONVERTING MY MOD TO SMP?
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
-
CONVERTING MY MOD TO SMP?
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
-
Modded-Vanilla Bridge on One Server
It's dependent on the modder declaring whether it's content should be required for connection or not...
-
Modded-Vanilla Bridge on One Server
It's dependent on the modder declaring whether it's content should be required for connection or not...
-
Help Editing Vanilla Blocks and Items
you need to take a look at grabbing accessible instances with reflection
-
Help Editing Vanilla Blocks and Items
you need to take a look at grabbing accessible instances with reflection
-
edit nbt to spawned entity
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
-
edit nbt to spawned entity
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
-
[Fixed] Unregistering of RenderGameOverlayEvent does not work
just a snippet from my project, probably should have left that out too I'll fix it EDIT: fixed, thanks for that
-
[Fixed] Unregistering of RenderGameOverlayEvent does not work
just a snippet from my project, probably should have left that out too I'll fix it EDIT: fixed, thanks for that
-
[SOLVED]Armor, Dye, and Tools Crafting Recipes?
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
-
[SOLVED]Armor, Dye, and Tools Crafting Recipes?
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
IPS spam blocked by CleanTalk.