Jump to content

SureShotM

Members
  • Posts

    104
  • Joined

  • Last visited

Everything posted by SureShotM

  1. can anyone at least give me some tips or point me in the right direction.
  2. Okay this was what I had @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } before that I had @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { if(!world.isAirBlock(x -1, y, z) || !world.isAirBlock(x +1, y, z) || !world.isAirBlock(x, y - 1, z) || !world.isAirBlock(x, y +1, z) || !world.isAirBlock(x, y, z - 1) || !world.isAirBlock(x, y, z + 1)) { world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } } I'm starting to think I need to have updateTick in my block code. but not sure what needs to go in there since in the redstone torch code uses its own functions for it and I'm not sure what those functions do since there is no description for them.
  3. Draco if you read I did say it was empty because I was testing when I made this post. Now I have tried to check if a block is on side and if so to tick but that didn't work Im going to post that tomorrow after I get sleep so maybe you can help me then.
  4. and yes I know there is nothing in the onNeighborChange, this is because I took code out of it and I am currently testing. Help or advice is still wanted.
  5. So I finally have started to work with redstone and have been doing fine except for one thing which I am sorta lost on. My block that emits a signal will emit when it does meet the conditions, but the redstone itself needs me to place a block next to it for it to be powered. Now I have looked at the redstone torch code and came across the updateTick and the onNeighborChange, I only have tried the onNeighborChange since my block emits only when a block is placed next to it but that seemed to do nothing. Any help or advice would be appreciated. Block:
  6. ok that didn't work, and I even tried to make my own method for it and it still didn't work so screw it ill just keep with the plant itself having the right click method. thanks for the help though even though it never got me anywhere.
  7. So I got it sorta solved I pretty much said forget doing it the fancy way and just put the onblockactivate method into the individual bushes(not going to be bushes for much longer it was the only thing I could think of at the moment of first creation). I did think of a way I could make the new itemstack and reference it like I already am but even then it didn't work so I kinda gave up, I might try again but I want to get further into the mod before I do or ill get stuck on this forever. so I guess at this point I'm going to ask if it is okay if we keep this open so I can come back to it as needed.
  8. Would it just be better to just put my right click code in the individual bushes to and add the individual items in that entityItem part
  9. Sorry if I am agitating I am just not really understanding right now since this works with vanilla items but not my custom items.
  10. Ok thats the thing though that I guess I'm getting confused, all my individual bushes are referencing to "cropBlock", and "newItem" gets passed through the bush constructor in super(new ItemStack(...));, I decided to do it that way cause I didn't want to have to put this in every bush code. @Override public boolean onBlockActivated(World parWorld, int parX, int parY, int parZ, EntityPlayer par5EntityPlayer,int par6, float par7, float par8, float par9){ int growStage = parWorld.getBlockMetadata(parX, parY, parZ); if(growStage == 7) { if (!parWorld.isRemote) { if (par5EntityPlayer.getHeldItem() == null) { ItemStack myItemStack = newItem; EntityItem myItemEntity = new EntityItem(parWorld, parX, parY, parZ, myItemStack); parWorld.spawnEntityInWorld(myItemEntity); parWorld.setBlockMetadataWithNotify(parX, parY, parZ, 0, 2); return true; } } } return false; }
  11. Okay I'm not understanding fully, am I already doing this when in the individual bush constructor. super(new ItemStack(ModItems.quicksilver_thorn));
  12. Okay so I would do this instead to fix it? EntityItem myItemEntity = new EntityItem(parWorld, parX, parY, parZ, newItem); parWorld.spawnEntityInWorld(myItemEntity);
  13. Sorry I kinda just woke up and not functioning fully.
  14. okay so you are talking about this private final ItemStack newItem;, correct or since you mentioned item class are you talking about the ModItems class? sorry I guess I'm confused on witch exact part of the code you are talking about, O wait i think I know what your talking about, super(new ItemStack(ModItems.quicksilverThorn)); this is what is being reused right.
  15. Do you mean in here, and in that case are you suggesting that I put this code in the individual bush blocks.
  16. I tried to have the right bits of code Highlighted but that didn't work, the first code is the General block the second code is the block with the specific item I'm trying to drop to player the last 2 codes are the initializes. note I have tried to use if(world.isRemote) instead of if(!world.isRemote) it still gave same error.
  17. So ive created a block that on right click should drop my custom item, but when I try this it tells me that when it tries my item is an invalid item? Witch to me doesn't make any sense, either way here is the code.
  18. and thank you Draco18s that was it... I really shouldn't code when I have little to no sleep, do to the fact that I cant think straight.
  19. So I'm pretty sure this is possible but not sure how I would go by doing this. configuration code: So what I want to do is a String array that you have 3-4 strings that you can pass in the config file, that way I can call it to an item file that pretty much will say if(whatever == array[1] || whatever == array[2] //and so on). I'm just not sure if there is a configuration.getStringArray again how would I go by doing this. I also want to apologize because the solution might be really simple and I'm not realizing it do to the fact that I'm only running on 4 hours of sleep.
  20. I totally forgot about the has container item part duh it works i finally made the full on code thank you desbien, again I apologize I'm just a total scatter brain
  21. Wait really but I thought container item still gets used when crafted with, and if it doesn't how would I make it use the item up once it hits 0. I'm just really confused now
  22. I am guessing no help?
  23. Like I said in my first post what I am looking to do is have this item not be used up in crafting until its uses hits 0 again the reason why we were talking about the uses NBTTag, even though that part I knew how to do, the part I don't know is the item not being used up part. Not to sound rude but did any one read the first post fully, or was it just the way I worded things. If it was the way I word things I want to apologize.
×
×
  • Create New...

Important Information

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