Everything posted by Siqhter
-
1.12.2 check if inventory is full
Then just loop through the slots and check if any are empty. I think you can check for ItemStack.isEmpty().
-
1.12.2 check if inventory is full
By full do you mean full stacks or just an occupied slot?
-
1.12.2 How to make a cooldown for item?
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);
- getDrops() Null Error
-
getDrops() Null Error
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?
-
getDrops() Null Error
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:
-
Troubles With Many Nbt/Idk Things
Maybe check if world is remote? I've had this problem before with duplicate events.
-
Blockstates Property for a Block
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.
-
Blockstates Property for a Block
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.
-
Blockstates Property for a Block
So, as opposed to using a tileentity?
-
Blockstates Property for a Block
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.
-
Blockstates Property for a Block
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))); }
-
Blockstates Property for a Block
However, would you know what I would need to use to get the correct drop? I can't seem to use byDyeDamage.
-
Blockstates Property for a Block
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.
-
Blockstates Property for a Block
Thank you.
-
Blockstates Property for a Block
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.
-
Blockstates Property for a Block
Here is the latest block code
-
Blockstates Property for a Block
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?
-
Blockstates Property for a Block
This is everything updated in the tileentity class. I guess I'm just not understanding something.
-
Blockstates Property for a Block
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
-
Blockstates Property for a Block
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.
-
Blockstates Property for a Block
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); }
-
Blockstates Property for a Block
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?
-
Blockstates Property for a Block
Would this go in getActualState?
-
Blockstates Property for a Block
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?
IPS spam blocked by CleanTalk.