Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Thanks Are you sure that Block.colorMultiplier only works with Ambient Occlusion enabled? I see this in renderModelStandardQuads(), which is used when AO is off: if (bakedquad.hasTintIndex()) { int i1 = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex()); -TGG
  2. Hi You might find this working example useful (MBE30 and MBE31) https://github.com/TheGreyGhost/MinecraftByExample -TGG
  3. Thanks dude, sounds interesting, I'll look at it sometime in the next month or so... currently working on ISmartBlockModel...
  4. I've written a couple - the tutorial project I mentioned, as well as some overview information here http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html You can often find snippets by googling, or in here http://www.minecraftforge.net/forum/index.php/board,120.0.html I've only ever stumbled over one test case in Forge. https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/java/net/minecraftforge/debug/ModelBakeEventDebug.java I'm sure they have them for regression testing and such, but I never went looking too hard I must admit. Other mods can be good if they're open source (most of them are)... can be very hit and miss though. -TGG
  5. That should have worked. Things to watch out for: 1) setCustomStateMapper should go in clientproxy preInit 2) make sure you have initialised nileFire before the call. If that doesn't help, you'll need to troubleshoot step by step. BlockStatesMapper.putAllStateModelLocations() is a good place for a breakpoint to inspect the registered states. Or -just change your blockstates file. It will be big, but will probably take you less time to figure out.... -TGG
  6. Hi A bit of background info here http://greyminecraftcoder.blogspot.com.au/2014/12/block-models-18.html The “tintindex” flag is used for faces which get a colour from Block.colorMultiplier() to modify the rendering colour – for example used by grass to change to a brownish colour in drier biomes, or by redstone wire to change the wire brightness according to the power level. eg in BlockModelRenderer:: if (bakedquad.hasTintIndex()) { int i1 = blockIn.colorMultiplier(blockAccessIn, blockPosIn, bakedquad.getTintIndex()); if (EntityRenderer.anaglyphEnable) { i1 = TextureUtil.anaglyphColor(i1); } float f = (float)(i1 >> 16 & 255) / 255.0F; float f1 = (float)(i1 >> 8 & 255) / 255.0F; float f2 = (float)(i1 & 255) / 255.0F; worldRendererIn.putColorMultiplier(f, f1, f2, 4); worldRendererIn.putColorMultiplier(f, f1, f2, 3); worldRendererIn.putColorMultiplier(f, f1, f2, 2); worldRendererIn.putColorMultiplier(f, f1, f2, 1); } -TGG
  7. Your Block has an extra property, AGE, that is not in your blockstates json. You need to add a custom BlockStateMapping to ignore AGE when generating the list of variants it expects to find in your blockstates json. for example, a block with two properties, ON(true/false) and READY(true/false) would give rise to four variants [on=true, ready=true] [on=false, ready=true] [on=true, ready=false] [on=false, ready=false] and you would need to provide a line for each of these in your blockstates.json If you set a custom BlockStateMapping that ignores READY, then it will generate only two variants [on=true] [on=false] and so your blockstates.json only needs two lines, one for [on=true] and one for [on=false]. READY does not affect the model. See BlockModelShapes.registerAllBlocks() in particular for vanilla fire: this.registerBlockWithStateMapper(Blocks.fire, (new StateMap.Builder()).addPropertiesToIgnore(new IProperty[] {BlockFire.AGE}).build()); You can add a custom BlockStateMapper using ModelLoader.setCustomStateMapper -TGG
  8. It's not a texture problem, it's a blockstates json problem. See here for more info. http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html spot the difference: your json alt=false,east=false,flip=false,north=false,south=false,upper=0,west=false the error message age=6,alt=false,east=false,flip=false,north=false,south=false,upper=0,west=false -TGG
  9. Hi A good place to start might be to fork this tutorial project https://github.com/TheGreyGhost/MinecraftByExample --> delete the bits you don't want, and customise the rest, step by step. If you make small changes and test after each one, it will be a lot less frustrating I think. -TGG
  10. Ah well, that's not quite true I think The vanilla minecraft code has poor documentation because it changes all the time, not much to be done about that. Most of the time, it's most helpful to think of a vanilla object that does something similar to what you want, then go look at the code for it. But the "Forge" packages have patchy documentation because many of the contributors haven't taken the time to document their stuff properly. As a result, you've got to hunt through the implementation code to try and figure out how to use the classes and methods correctly. Some are a lot better than others, but it's very rare for them to be up to the standard of, say, the java.util package. The bigger picture stuff such as overviews, example implementations or test cases, etc is almost totally missing, which is where the various tutorial and sample code lying around the place can be helpful (its quality is highly variable!). Once you've amassed a certain amount of knowledge, the rest becomes easier to find, the problem is sticking with it long enough (and having the temper control to not punch your screen in after wasting an entire day chasing a red herring). You might find this tutorial project a useful base to start working from. https://github.com/TheGreyGhost/MinecraftByExample -TGG
  11. I think your approach should work if you make sure you check all the OreIDs instead of just the first one, i.e. String dye = OreDictionary.getOreName(id[0]); should be for (int idToCheck : id) { dye = OreDictionary.getOreName[idToCheck]; dye = dye.toLowerCase(); // etc } Alternatively you could use OreDictionary.getOres(dye name) instead, to get a list of all ItemStacks that correspond to each Ore dye, and check each one to see if it matches (this is how recipes work). i.e. - (1) for red, get OreDictionary.getOres("dyeRed"); to retrieve a list of all ItemStacks which are red dye (2) for each redDyeItemStack, check OreDictionary.itemMatches(heldItemStack, redDyeItemStack, true) (3) repeat for all remaining dye colours -TGG
  12. Hi Looks to me like one of your faces is wrong. I think the best way to trouble shoot tessellator stuff is to just do one face at a time. i.e. comment out everything except the first face. Then walk around it and make sure it is right. If not, fix it. If so, comment it out and uncomment the second face. Are you trying to change the appearance based on the fluid height? At the moment you're just drawing a cube? -TGG
  13. Hi Just the four metadata values that you use for items. http://greyminecraftcoder.blogspot.com.au/2014/12/item-rendering-18.html See also this tutorial project https://github.com/TheGreyGhost/MinecraftByExample MBE03 https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe03_block_variants/StartupClientOnly.java and the appropriate functions in your block class Block:: // this function returns the correct item type corresponding to the colour of our block; // i.e. when a sign is broken, it will drop the correct item. Ignores Facing, because we get the same item // no matter which way the block is facing @Override public int damageDropped(IBlockState state) { EnumColour enumColour = (EnumColour)state.getValue(PROPERTYCOLOUR); return enumColour.getMetadata(); } // create a list of the subBlocks available for this block, i.e. one for each colour // ignores facings, because the facing is calculated when we place the item. // - used to populate items for the creative inventory // - the "metadata" value of the block is set to the colours metadata @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { EnumColour[] allColours = EnumColour.values(); for (EnumColour colour : allColours) { list.add(new ItemStack(itemIn, 1, colour.getMetadata())); } } // when the block is placed, set the appropriate facing direction based on which way the player is looking // the colour of block is contained in meta, it corresponds to the values we used for getSubBlocks @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing blockFaceClickedOn, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { EnumColour colour = EnumColour.byMetadata(meta); // find the quadrant the player is facing EnumFacing enumfacing = (placer == null) ? EnumFacing.NORTH : EnumFacing.fromAngle(placer.rotationYaw); return this.getDefaultState().withProperty(PROPERTYFACING, enumfacing).withProperty(PROPERTYCOLOUR, colour); } -TGG
  14. Are you using IntelliJ 14? If so you need to add a line to your build.gradle, otherwise it won't copy your resources properly see here http://www.minecraftforge.net/forum/index.php?topic=21354.0 -TGG
  15. Hi You might find this tutorial project useful (see MBE10) https://github.com/TheGreyGhost/MinecraftByExample Also this troubleshooting guide http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
  16. Hi Your bigbrazier and raisedbrazier jsons appear to be both lit (use "fire" texture)? Your public IBlockState getStateFromMeta(int meta) { return this.getDefaultState(); //return this.getDefaultState().withProperty(ISBURNING, Boolean.valueOf(isBurning)); } should be something like return this.getDefaultState().withProperty(ISBURNING, meta == 1); Apart from that I don't see anything, sorry... -TGG
  17. Hi show your blockstates json, your Block code, your TileEntity code, and any relevant errors in the console? -TGG
  18. Hi Try this: turn the furnace on so that your particles are coming out. Then place another block (eg dirt) right next to the furnace so it is touching. Does your block model suddenly change to a lit furnace? -TGG
  19. Hi Your initial Block might work if you implement getMetaFromState() correctly, ie not just return 0. You will also need to force a block update every time the state changes- The render information is only updated when the blocks change, so the furnace will turn on (or off) and you won't see it without a block update. From memory I tried it both ways and found getActualState was easier. Vanilla uses two different blocks entirely instead of changing iblockstate. The latest fragment you posted looks like it's pretty close; I'd suggest you get rid of private boolean isBurning though, and just retrieve or set the TileEntity isBurning every time. Otherwise you run the risk of updating one and forgetting to update the other. -TGG
  20. Perhaps give this troubleshooting guide a go, might help you track things down. http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
  21. Hi You might get some clues from looking at this tutorial project, which has a custom furnace which changes its model. See MBE31. https://github.com/TheGreyGhost/MinecraftByExample If that doesn't help, let us know? -TGG
  22. Hi They use a FACING variant. You might find this tutorial project useful - see MBE03 https://github.com/TheGreyGhost/MinecraftByExample Alternatively, if you want to look at the vanilla furnace, the key bits are furnace.json:: { "variants": { "facing=north": { "model": "furnace" }, "facing=south": { "model": "furnace", "y": 180 }, "facing=west": { "model": "furnace", "y": 270 }, "facing=east": { "model": "furnace", "y": 90 } } } BlockFurnace:: public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2); // here You might need to do some background reading first if you're new to BlockStates; there are quite a few things you have to get exactly right before it will work. -TGG
  23. Is your file called harryPotterWand.json with a little h? Because that is what your code is looking for... You might find this link helpful http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
  24. Hi If there is another way, I haven't found it. If you can convert your model to the IBakedModel format, you've got plenty of options (eg ISmartItemModel, Item.getModel()) otherwise you might be stuck with TileEntity-and-dummy-block. -TGG
  25. are there any errors in your console output? -TGG
×
×
  • Create New...

Important Information

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