Jump to content

DARKHAWX

Members
  • Posts

    129
  • Joined

  • Last visited

Everything posted by DARKHAWX

  1. Hi there, three questions today. 1. I want to add a block that creates particle affects upon placement. I tried adding code to Block#onBlockAdded but it appears that the world object given to that method is the server world and as such it doesn't appear to create particles (I don't need the particles to be synced across clients). How would I go about making the block display particles upon placement? 2. I have a 2 different blocks that have no bounding box. That is to say I can collide with the block, but cannot click it, and such cannot destroy it... I really need this fixed and need some help. I'll provide relevant code but im at a loss as what I did wrong or how to fix it. One block is an overly complicated spherical model, while the other is a simple rectangle.. Rectangle: Model: Sphere: Model (warning, huge. 4000 lines huge) 3. In another block, when activated it changes into a water source block. However this water source block doesn't get updated, and so doesn't spread. I tried looking at the bucket code to see if I could work it out, but all it appears to do is set the block to water using World#setBlockState, and I tried copying that buy still didn't work. Can anyone tell me the correct way of placing a water source block and then updating it so that it flows.
  2. Thanks! After a bit of work I've reached another roadblock. I'm still a little rusty on my NBT knowledge and am having trouble with the getCraftingResult() method. I've gotten the code to the point where I can 'craft' the item (the game recognises the recipe) but will crash each time getCraftingResult() is called. The way the item works is it stores, through an nbt tag, the item put in the middle of the crafting matrix for later use. The following is the code used for getCraftingResult. Crash Report: The crash occurs whenever itemstack.getTagCompound().setTag("Present", inputNBT); is called. I know its because I'm probably doing the whole NBT thing wrong. Can someone point me the right way of doing this? If another method should be used for storing the itemstack used in the middle of the recipe (remember I need to access this information from the itemstack somehow in another piece of code), let me know.
  3. Hi there, I want to make a normal shaped recipe that can take any item/block as one input in its recipe... Does anyone know how I could achieve this? The item also has a field that stores an associated itemstack, which I would like to set upon item creation (once I craft it from the recipe), but I'm not sure how to achieve this when registering the registry... Does anyone have ideas? Any help would be appreciated.
  4. Okay: FML Log: Blockstates file for item: Model file (this is in items, not blocks folder) named sandcastle_mould: Directory Structure: As you can see this produces no errors right now, however it is apparent that the block states file is useless and not doing anything as the item should theoretically be looking for the file 'sandcastle_mould_castle" and then producing an error, but it isn't. However, If I remember the item model file to be the same as the name of the model file in the blockstates file it produces an error for the item and its models as it cannot find the model in the resourcelocation "sandcastle_mould".
  5. If I understand correctly then yes. However, all the items use the same name and texture, which I don't want. There are no model missing/loading errors. (I even added the blockstate file to see if that did anything, nothing changed). So what am I doing wrong here? I would like to have the item and its states work similar to how blockstate files work if possible, but I might be doing this wrong.
  6. So, very stupid question, but I've completely forgot how to properly give items subtypes and how to setup their model files. I've got this.setHasSubtypes(true); and public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) added onto my item file, but I think I'm registering my items and their item models incorrectly. It's creating the different items, but it's not assigning them unique names based on their state... Here is the item file I have. It's a sandcastle mould with a propertyenum to store what type of mould it is: And here's how the item is being registered: And finally the model registering... What am I doing wrong here? I think I missed something stupid and simple. Let me know if I need to post more code.
  7. But I want to render the cake blocks model... Should I not be using my current method then? Should I use: Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel() instead?
  8. So I'm creating a tile entity with a special renderer and am trying to render a cake block. Unfortunately it keeps crashing upon rendering. I'm getting a nullpointer exception when rendering the cake that seems to be caused by an error in the item stacks metadata. I've tried using a few different values for the metadata and looked at the BlockCake class but nothing works. What am I doing wrong here? Code that is being executed: Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Blocks.CAKE), ItemCameraTransforms.TransformType.NONE); Error:
  9. Ah, I was not familiar with that notation, so I simply thought it was a weird way of typing ModelManager.getModel(). Thus my question becomes, how would I obtain an instance of ModelManager? My intuition says to not simply create a new instance of ModelManager but use an existing one, but I have no idea where to look...
  10. The commented out methods aren't outdated, they're for 1.9.4. If the client needs some data from the TileEntity to render your block, send it in the update (a.k.a description) packet. In 1.9, override TileEntity#getDescriptionPacket to write the data that needs syncing to a compound tag and then create and return an SPacketUpdateTileEntity with the position and NBT. Override TileEntity#onDataPacket to read from the packet's NBT. In 1.9.4, override TileEntity#getUpdateTag to write the data that needs syncing to a compound tag and return it. Override TileEntity#getUpdatePacket to create and return an SPacketUpdateTileEntity with the position and update tag. Override TileEntity#onDataPacket to read from the packet's NBT. Thanks!
  11. So I got a bit of a problem that seems really weird. My IDE (intellij) is complaining that I'm accessing a non-static method (getModel()) from a static context. But my TESR class is non-static. What am I doing wrong here? TESR (renderBlood() is the method to look at): Where I register the model, I think this might be a problem. ModelBakery.registerItemVariants(ModItems.sacrificialKnife, new ResourceLocation(PlanckMod.MODID, "block/bloodSphere"));
  12. Hi there, So I have a tile entity that upon 'crafting' will execute a countdown from 200 to 0, decreasing by one each time the tile entity is updated. At certain intervals through this countdown I change the blockstate of the attached block. However it appears that in doing so it will also 'reset' the countdown. TileEntity: How would I go about preventing this? P.S: The items that have been currently added to the TE are rendered above it. Due to the way my code is setup it turns out that the finishCraft() method only gets ran server side (a tile entities worldObj is not remote), which means to the client the items haven't disappeared. How would I go about rectifying this? Would modifying the way data is stored in the nbt work? Or would I need to somehow tell the client that the items have disappeared? P.P.S: The commented out NBT related methods were taken from some random tutorial ages ago. They seem to have some relevance to syncing data between client and server, however they are outdated and do not work.
  13. Quick question, is there an easy way to render a block model .json file in a TESR without having to create a block attached to that model?
  14. I understand how to make particle effects, play sounds, craft recipes, etc; my question is how would I got about delaying the crafting process by waiting for animations to complete? Think Thaumcraft Infusion. I would like to mimic the effect here, wherein crafting isn't done instantly, but instead animations are performed to 'delay' the crafting process.
  15. Thank you. I've just started learning about NBT's and was copying this code from somewhere esle.
  16. Hi there, just trying to make a simple block that has a GUI with inventory and I've hit a problem. Everything about the block and GUI works fine. I can place it, access it, put items into it, etc. Only problem, upon closing the server/exiting the world the inventory is not saved. I thought the NBT methods I had did the saving for me, but apparently I've missed something. I'm not sure where I've messed up. Here is all the relevant code: Block Tile Entity Container Gui Slot
  17. So I'm updating part of a mod to 1.9 and have run into a problem, apparently StatCollector doesn't exist anymore. Does anyone know the replacement?
  18. Okay, one last thing. With the way my tile entity works, it can store up to 8 items, and will display them all. To do this I created a for loop (the items are stored in a list) and then would render each item, translating and scaling each time. However, the translate and scale functions are relative, which makes it a little harder to display this sort of stuff, is there a way I can 'reset' the position and scale of the render? i.e. is there some function like GlStateManager.position(x,y,z) or do I have to make my translations/scale changes and then manually revert them afterwards?
  19. Wow, that's really cool. Just check my translations and they were off as well. Ty for the help.
  20. Hmm. I can't seem to get it to work. I can get the model loaded, but the item never renders. No errors or anything.
  21. So I want to achieve something similar to the way the Arcane Pedestals from Thaumcraft work, wherein they render the item they are holding above them, but I have no idea how to go about that. I currently have a tile entity that will store and item upon clicking it, so how would I get it so that it displays the items it has above it?
×
×
  • Create New...

Important Information

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