Jump to content

Briggybros

Members
  • Posts

    155
  • Joined

  • Last visited

Everything posted by Briggybros

  1. Firstly, would it be easier to use Packet5PlayerInventory to send the packet to update the inventory? Finally, where would the line be likely to be? I can't seem to find it.
  2. Hello, I'm trying to set up a system which changes the item in your hand when you press a bound key. However when I press the key it comes up with; 2012-09-15 20:58:02 [sEVERE] [ForgeModLoader] A critical server error occured handling a packet, kicking net.minecraft.src.NetServerHandler@4cd5bf My packet handler is as follows; package info.mineverse.willow.sabers; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import net.minecraft.src.EntityClientPlayerMP; import net.minecraft.src.EntityPlayerMP; import net.minecraft.src.ItemStack; import net.minecraft.src.NetworkManager; import net.minecraft.src.Packet250CustomPayload; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; public class PacketHandler implements IPacketHandler { @Override public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player) { if (packet.channel.equals("SaberDraw")) { handleDraw(packet, player); } } private void handleDraw(Packet250CustomPayload packet, Player player) { DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); int id; try { id = inputStream.readInt(); } catch (IOException e) { e.printStackTrace(); return; } EntityClientPlayerMP packetSender = (EntityClientPlayerMP)player; packetSender.inventory.setInventorySlotContents(packetSender.inventory.currentItem, new ItemStack(id, 1, packetSender.inventory.getCurrentItem().getItemDamage())); } } and the construction for the packet is; ByteArrayOutputStream bos = new ByteArrayOutputStream(; DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeInt(SaberBase.saberPurpleOn.shiftedIndex); } catch (Exception ex) { ex.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "SaberDraw"; packet.data = bos.toByteArray(); packet.length = bos.size(); Side side = FMLCommonHandler.instance().getSide(); if (side == Side.CLIENT) { mc.thePlayer.sendQueue.addToSendQueue(packet); } where mc is Minecraft and initialized with; mc = ModLoader.getMinecraftInstance(); As far as I can see the error is most likely to be how I tried and failed to update the item in the packet handler, can anyone point me in the right direction?
  3. You've done this in the 1.2.5 structure, it has completely changed for 1.3.2 see this
  4. Did you install forge into the client?
  5. Hello, I have a mod that changes an item on a keybinding, the item changed has different variables than the item that it changes to. This works fine in singleplayer. However, when used in multiplayer, the server doesn't register the new item, so it still has the same properties of the first. I need to create a packet, or send one that is already defined to tell the server, and thus other connected clients that the item has changed. I have no experience with packets so I don't know where to start, can someone help?
  6. Hello, I'm wanting to set up a modification which is compatible with bukkit, however, I have no idea of what needs to be done for this, I've created a BukkitProxy class, but I don't know what I need in it, can anyone help?
  7. There are dependencies, but no parent, the only place I can find parent is in the mcmod.info, and I don't know how to use it.
  8. There is no parent attribute of @Mod
  9. Hello, I'm wanting to set up multiple mods that are dependent on one base mod. I've noticed that there's both a parent and dependencies section in the mcmod.info file, and also in the mod annotation there is a dependencies variable. How would I use these to make one mod a child of another and not let the child run without the parent?
  10. Even if you do just numbers it's a lot more difficult as you also have to define the renderer whereas addArmor defines the renderer and assigns it.
  11. The problem is fixed, and I know there is always a log, but nothing was printed to it.
  12. From what you've said I'm assuming you're testing from eclipse, therefore I guess your problem is that you haven't added your images. go to your jars file in mcp, then bin and open minecraft.jar from there add your images to the directory defined in the main class.
  13. I'm trying to create a universal mod with armors. I define the armour inline as so; helmetAmethyst = (new WillowItemArmor(1048, 0, enumAmethystArmour, ModLoader.addArmor("Amethyst"), 0)).setItemName("amethystHelmet"); With the id, textureindex, enum, renderer and type. However, on the server side there is no need to use the ModLoader.addArmor method and it throws an invalid method error. How would I make it so that the armor is still registered in multiplayer, but it doesn't use the ModLoader.addArmor method?
  14. Or go to the tutorials on the Wiki
  15. There are no errors, the mod just doesn't load
  16. I have tried that and it doesn't work, I can test it in eclipse, but not in the actual game. Here is my mod: https://dl.dropbox.com/u/70605402/Willow.zip and here is the src: https://dl.dropbox.com/u/70605402/src.zip
  17. When defining your blocks, you also need to make the enum as so; static EnumToolMaterial enumAmethystTool = EnumHelper.addToolMaterial("Amethyst", 3, 1561, 8, 3, 10); and then it's included in the tool as so; swordAmethyst = (new WillowItemSword(1008, 64, enumAmethystTool)).setItemName("amethystSword");
  18. I have completed the first part of my mod and obfuscated it in mcp, how do I go about adding my mod to my game?
  19. preloaded the textures: MinecraftForgeClient.preloadTexture("/Willow/Base/Armor/amethyst_1.png"); MinecraftForgeClient.preloadTexture("/Willow/Base/Armor/amethyst_2.png"); In the armor file: @Override public String getArmorTextureFile(ItemStack itemstack) { //Amethyst if(itemstack.itemID == WillowBase.helmetAmethyst.shiftedIndex || itemstack.itemID == WillowBase.chestplateAmethyst.shiftedIndex || itemstack.itemID == WillowBase.bootsAmethyst.shiftedIndex) { return "/Willow/Base/Armor/amethyst_1.png"; } if(itemstack.itemID == WillowBase.leggingsAmethyst.shiftedIndex) { return "/Willow/Base/Armor/amethyst_2.png"; } } The problem I was having is that the armour wasn't registered as a render, so I had to register it; helmetAmethyst = (new WillowItemArmor(1048, 0, enumAmethystArmour, ModLoader.addArmor("Amethyst"), 0)).setItemName("amethystHelmet");
  20. Problem solved
  21. I've not layed it out as so; with the armour images in the /armor folder. However, this still does not work for me.
  22. I know where everything is, all I am asking is if there is a method to locate armour textures outside of /armor
  23. Is there a workaround?
  24. I'm pretty sure the problem is that it's trying to find the armour texture in the /armor dirctory, how can I change this?
  25. All of the names work with ModLoader.addName(object, string) as of the new Forge update EDIT: The armour names have not worked (I have also put .setItem/BlockName to camelCase for all blocks/items) EDIT: Neither do they render when worn. EDIT: Armour code: EDIT: The ore generation works now, thanks! EDIT: Noticed the armour was never assigned a name, derp
×
×
  • Create New...

Important Information

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