Siqhter
Members-
Posts
149 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Siqhter
-
You mean like a separate model/blockstate file instead of subtypes?
-
Ok, that makes sense, thanks.
-
Well I just did this and it works fine. What is the reason for not overriding harvestBlock? drops.add(new ItemStack(this, 1, this.getMetaFromState(state)));
-
Sorry I do have one other question. Using harvestBlock how would I get it to drop the correct color block? Right now it just drops nothing.
-
Nevermind I actually just got that working as well. I created a SubItems interface with a ResourceLocation method, and registered items that are instances of SubItems in my RegistrationHandler under Items. Thanks for your help on this.
-
Got that working. I feel stupid, I had created a class that I planned to use for any block with subtypes, just forgot to register it in the BlockInit class as a new ItemBlock. It was the same type as ItemCloth that you just told me about. The textures in the inventory are still not registering, should I do the same with with a getSubItems subclass? I'm not sure how similar it is toSubBlocks. Thanks.
-
Ah, I didn't realize that. So I would need a separate class that sets hasSubtypes to true, overrides getMetadata, and a getUnlocalizedName method? Pretty much everything in the ItemCloth class?
-
Yeah sorry I've been meaning to do that. Something got messed up with an old mod's repository and I've been trying to fix it. Anyway this is how I register the block and itemblock, but I feel like that would only be an issue with it registering the texture in the inventory. And I should add, it does register the counter model block fine (on placed, and in the inventory), just not the subitems I create with the getSubItems method in my BlockCounter.java. So I'm pretty sure they're registered correctly. BlockInit.java RegistryHandler.java
-
On placing the block, it should be 1 of 16 different dye colors. Also the items in the creative menu should each be their own dye color. It's not a model issue, because they render when placed, just not with the correct color (they only render in white, which is the first color in the blockstates colors variants). Also the blocks work fine when applied with dyes (the blocks change to their respective color), so it's probably something in a method that I'm not adding. Below are my Block and TileEntity classes, as well as the blockstate file.
-
That's exactly what I thought. I'm assuming my problem is elsewhere then? I wasn't sure if maybe it's in onBlockPlaced or something.
-
Ok thanks. I was a little unclear because I thought I was only supposed to store FACING properties in the TE. This makes sense now.
-
So specify the color, with maybe, "dyeColor.get()"? I don't know what else to use.
-
Ok, but I'm still not sure what it wants me to pass in in addition to COLOR property.
-
I assume just the method?
-
Well, this is what it says it expects in the error: block.properties.IProperty<T>. But I don't think I really understand what it actually wants, other than COLOR, or rather what I'd pass in.
-
Sorry, I meant the IDE, as in the red underline. It still compiles. The only error I get is "withProperty()" in IBlockState cannot be applied to: IProperty<T> COLOR (EnumDyeColor)".
-
Ok, so would I return COLOR and FACING? Because right now it gives an error if I pass in COLOR.
-
I've been having issues with the repo right now. I duplicated some files accidentally, and some of the old files are still in it. Here is the blockstate and model file. The java classes are the ones posted above. Thanks.
-
Still stuck on this, I thought I figured out but the proper textures for each blockstate were not rendering properly. Just seeing if anyone has any ideas. Thanks.
-
Yeah, I've been getting a repository set up. For now, I'll just post the code directly. These are the two java classes for the Block itself, and then the TileEntity.
-
Nevermind, I was able to get it working. However, using the getSubBlocks method, the textures for all other 15 blocks are not registering.
-
Huh, I looked through that, and my JSON file is formatted the same way, but it gives me an Exception loading model for variant error. I made sure to register the tileentity, but maybe I'm missing something else with the actual model?
-
Can you explain what writeToNBT and readFromNBT are?
-
I'm wondering how this guy did it. https://github.com/MrCrayfish/MrCrayfishFurnitureMod/blob/master/src/main/resources/assets/cfm/blockstates/counter.json He uses this for multiple different blocks for different color variants.
-
I have read past forum posts addressing this, but I still can't seem to figure it out. I have a block that should create a variant for each EnumDyeColor. (So, 16 altogether.) I have already gotten this same block to work using a "facing" property so that it faces the player when placed, but I can't seem to get the "color" property to work. It generates 16 items without textures in the inventory and without textures when placed. I am pretty sure it's a JSON thing, because of the error which I will post below. Thanks. The console also says "suppressed 59 additional model loading errors." Here is my JSON file. And just to clarify, the block model is loading a "test_block" in, just not generating the blockstate variants for the other 16 colors.