Jump to content

Siqhter

Members
  • Posts

    149
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Siqhter

  1. Then just loop through the slots and check if any are empty. I think you can check for ItemStack.isEmpty().
  2. By full do you mean full stacks or just an occupied slot?
  3. If you take a look at ItemEnderPearl's class, it uses a cooldown. I know this is different than what you have, but the end result should be what you're looking for. playerIn.getCooldownTracker().setCooldown(this, 20);
  4. Thanks.
  5. I had looked at it yesterday, and didn't understand what the code in the FORGE START section did, but I do know and finally got it working. For blocks with tileentities, do you really need the 3 methods all the time?
  6. I was working on this getDrops method, but everytime I broke a block the console threw a NullPointerException error. I fixed that, but now the block isn't returning the correct blockstate color from the tileentity. Not sure if the null check is the problem, here is my code:
  7. Maybe check if world is remote? I've had this problem before with duplicate events.
  8. I'm storing the color property in a tileentity. But I don't know if that's what you're asking for. This works fine for getting the block's correct color state when placed.
  9. Oh I see what you mean. When I do use metadata to get the color for the block drop, it returns a random color, not the correct one. I fixed this earlier with byDyeDamage, but I don't know how to do it in this context.
  10. So, as opposed to using a tileentity?
  11. I know, I was just showing you what method I was using previously and I'm wondering how to update it. I tried calling getColor from the tileentity, but still stuck.
  12. It worked when I was storing color in metadata, but not now that it's store in a TE. @Override public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { drops.add(new ItemStack(this, 1, this.getMetaFromState(state))); }
  13. However, would you know what I would need to use to get the correct drop? I can't seem to use byDyeDamage.
  14. If tile entity is not saving the color on quitting the map, would that be a sync issue? Not sure why it just started. Nevermind.
  15. Thank you.
  16. Sorry I had changed that method around before and I forgot it wasn't doing anything. That works now, just wondering why this method, when dye is applied, changes the block to a random color and not the corresponding one.
  17. Here is the latest block code
  18. I know, but I had used a tileentity to store facing values, and I'm just confused on how to literally swap the color and facing properties, not saying I'm going to keep it this way, just want to finish it how I started it. Could you explain what you mean here?
  19. This is everything updated in the tileentity class. I guess I'm just not understanding something.
  20. Ok, thanks that was very helpful. Everything in that post however I was already implementing, except one method, but I think it's still not syncing. Is that everything I have to do in the TE? If I'm pulling the color from the TE Then I don't know how to get the data for each color, it just returns what I defined color as
  21. Quick update, sorry but I'm still stuck on this. My tileentity for color is: and getActualState: but this only returns RED, obviously, but I don't understand how to get the data from the block.
  22. Ok, I will look into it. For now I am curious, just because I'm trying to switch color and facing so I store color in the TE. (I will end up changing it to what has been recommended). But in getActualState I'm trying to call the TE and get the data from it, but I'm not quite sure how. @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { super.getActualState(state, worldIn, pos); TileEntityCounter tileEntity = (TileEntityCounter) worldIn.getTileEntity(pos); EnumDyeColor color = tileEntity.getColor(); return state.withProperty(COLOR, color); }
  23. Ok, thanks. And just to check I defined my color in the TE as It doesn't need to be an integer or is this alright?
  24. Would this go in getActualState?
  25. Well I have heard a couple people on this post say something about switching facing and color properties so that I can store color in the TE. Right now color is in the metadata, but if I instead put it in the TE, than how exactly would I call it in the block class instead of using getMetaFromState and getStateFromMeta?
×
×
  • Create New...

Important Information

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