Jump to content

vroominator

Forge Modder
  • Posts

    171
  • Joined

  • Last visited

Everything posted by vroominator

  1. Hi guys, I've got a little question about rotatable blocks. By rotatable blocks I mean blocks that face you when you place them or rotate when you hit them with an item. I know one way to do this, and that's with block metadata, but I've seen mods like IC2 cram a bunch of rotatable blocks into 1 block id, so they can't be using metadata for the rotation. Example: a macerator has eight states: On & Forward, On & Backward, On & Left, & On & Right, Off & Forward &, Off & Backward, Off & Left, Off & Right. Doing this with metadata would use up 8 of the 16 available metadata slot things. How do mods like this do it? Are they using some form of witchcraft, or am I just missing something painfully obvious?
  2. Auto Building? Do you mean World Gen?
  3. Interesting. I've never seen a mod quite like this before. I'll have to check it out!
  4. I figured out what I did wrong, and as usual, dumb mistake. I was registering certain achievements before their parent achieves, and the game doesn't like it when you do that.
  5. If it doesn't work, you're doing it wrong. Show me the error.
  6. I hope these turn up in Australia soon.
  7. Hi guys, I've been getting a strange problem recently. If you've ever made a block with a Gui/TileEntity/Container before, you're probably familiar with addCraftingToCrafters(), which keeps the Tile Entity and the Container in sync. I'm having problems there. Everything works fine right up until I open the Gui. Then I crash with this error. java.lang.NullPointerException at net.minecraft.src.Slot.getStack(Slot.java:82) at net.minecraft.src.Container.getInventory(Container.java:63) at net.minecraft.src.Container.addCraftingToCrafters(Container.java:47) at vroominator.sorcery.common.ContainerRuneCrafting.addCraftingToCrafters(ContainerRuneCrafting.java:55) at cpw.mods.fml.common.network.NetworkRegistry.openRemoteGui(NetworkRegistry.java:315) at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:337) at net.minecraft.src.EntityPlayer.openGui(EntityPlayer.java:2051) at vroominator.sorcery.common.blocks.BlockRuneCraftingTable.onBlockActivated(BlockRuneCraftingTable.java:106) at net.minecraft.src.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:390) at net.minecraft.src.NetServerHandler.handlePlace(NetServerHandler.java:536) at net.minecraft.src.Packet15Place.processPacket(Packet15Place.java:78) at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:78) at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:80) at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55) at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:111) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:649) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:564) at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:110) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:470) at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:18) I realise it's traced back to getStack() on Line 82 of slot, but I just do not know why. I've made blocks like this before, and never run into this error. Any help would be greatly appreciated. If you need to see code, just ask.
  8. If by multiple players, you mean SMP, of course. The spell system I have planned will make for excellent PvP combat.
  9. [/img] Sorcery is a magic mod that adds a spell casting system, a whole heap of useful spells, and many other fun magical toys. Head over to the downloads page for downloads and resources. If you want more information, please visit the Wiki NEWS You guys here at the Minecraft Forge Forums are getting early access to Sorcery while I prepare the official Wiki. Please feel free to mess around with the mod and report any bugs you find to me via PM here at the Forge Forums. I will get around to editing the Wiki soon. CHANGELOG Beta 1.0 -Initial Release NEXT VERSION -Desks for proper manipulation of spellbooks and spell pages -A new batch of combat oriented spells -Broomsticks -Better Unicorns (They'll be more like 1.6's horses) -Bug Fixes -Magic Amour Minecraft Forum Thread
  10. Looks to me like you're trying to access stuff that only exists on the client from the server. You should use proxies to deal with stuff like that.
  11. Have you tried this? @Override public boolean interact(EntityPlayer entityplayer) { if(entityplayer.worldObj.isRemote) { if (this.riddenByEntity == null) { mountEntity(entityplayer); } } return true; } isRemote should stop it happening on the side it doesn't need to. Not sure if it'll work, but it's worth a shot.
  12. Have you looked in The Enchanting Table GUI? You'll probably find what you're looking for in there.
  13. Why exactly did you have to edit the class for the bow? There are a few events for the bow and arrow, and I'm sure you'd be able to hook in your enchantments there.
  14. It's pretty much there so that mods who have common ores, such as copper or tin, can use each others items. Say I wanted to craft an RE Battery in IC2, but I only had Redpower2 Tin ingots. The ore dictionary allows the RE Battery to be crafted with tin ingots other than those provided with IC2. It's very useful.
  15. Did you remember to link the jars under /lib? (asm, guava, etc) Check some of the files and look at the errors. If it's mainly problems with imports, you've forgotten to link those jars. I did this same thing the first time around.
  16. I don't think it's possible. You might just need to put a copy of the water textures in your own file.
  17. You can't just run the files with a click. You need to use the terminal.
  18. Yes, I'm having trouble with Achievement pages. Done a quick search, and found that I'm not the only one who's had this issue, but the fixes in other threads haven't worked for me. I know it has trouble if there's only 1 achievement, but I have 6, and some of them are sub-achieves of others in the same list. Achievements with parent achievements in this list also won't show what achievement they require, but instead show their description, without me having the parent achievement. Here's the code I'm using, if it's any help Sorry if this is in the wrong section, I'm not sure whether this belongs under the Bug Reports or Modder Support section.
  19. A log would be nice.
  20. Just explained this to another person in this thread.
  21. I'll go fetch the code I used to make an object like the one you're attempting to make. It's really quite simple. Like atrain said, you need a Crafting Handler class, and you need to register it in your main mod class with GameRegistry.registerCraftingHandler(new Your Crafting Handler()); and then inside the crafting handler, which implements ICraftingHandler, your onCrafting method should look a little something like this. public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) { for(int i=0; i < inv.getSizeInventory(); i++) { if(inv.getStackInSlot(i) != null) { ItemStack j = inv.getStackInSlot(i); if(j.getItem() != null && j.getItem() == Your Hammer Item) { ItemStack k = new ItemStack(Your Hammer Item, 2, (j.getItemDamage() + 1)); inv.setInventorySlotContents(i, k); } } } } Basically what this does, is run a check every time something is crafted. It looks in every slot and if it finds Your Hammer Item, it replaces that stack with a new stack of 2 of your hammer item, one of which is used up in the crafting. It also adds one damage to the item. Happy Modding
  22. Pretty sure you're referring to RedPower2 there, with it's nice miniblocks. And, yes, you'd have to get the game to allow two blocks to overlap. I'm not entirely sure if this is possible, as All the RedPower blocks that overlap use the same Block ID, and I'm assuming the way they're able to be placed in the same block space is written into the code of the miniblocks. Unless you want to edit the main Blocks class, I'm not sure it's possible to have your block sit in the same space as vanilla or other mod blocks.
  23. Well I'm not sure how to do what you're asking, but as for the Block IDs above 255 thing, Forge has a fix for 4096 Block IDs, so you can use any ID up to 4095 for your blocks. It's pretty useful when using a ton of mods.
  24. Yes, NBTTagCompounds are used to store extra data for an ItemStack. They're not particularly hard to use. You can give a tag compound to an itemstack using ItemStack.setTagCompound(new NBTTagCompound()); You can add a list to your compound using ItemStack.stackTagCompound.setTag("name", new NBTTagList("name")); and then access this list using NBTTagList list = (NBTTagList)ItemStack.stackTagCompound.getTag("name"); Once you've got your list, you can add compounds to it with NBTTagCompound compound = new NBTTagCompound(); and add data to it, like Integers or Booleans using these compound.setInteger("Integer Name", Value); compound.setBoolean("Boolean Name", true/false); And then finally to append this compound to the list, you use list.appendTag(compound); That would produce an ItemStack with a single list, which has inside it an Integer called Integer Name and a Boolean called Boolean Name. Have fun
  25. I've been working on a gui for my upcoming mod, and I'm having a few problems with client-server syncing stuff. I'll explain exactly what I'm trying to accomplish. A user hits a button in the gui, which does some neat java stuff and sends a packet off to the server, which then writes some NBT data to an ItemStack. In it's current state, it's half-working. The server knows about everything that's happened, but the clients don't, and I don't know how to go about telling them. What should I do? Here's my Tile Entity source incase you need it. Tell me if you need to see more. If I haven't explained what I'm trying to achieve particularly well, just say so and I'll try and make it clearer. Also, feel free to yell at me for being a noob.
×
×
  • Create New...

Important Information

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