Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DrakusorU

Members
  • Joined

  • Last visited

  1. I managed to make it grow 1 more block, but I have a problem with the function updateTick I've got the function from another mod, but that mod was making the crop grow 3 blocks, so I tried to make it grow only 2 but it doesnt update corectly.. well.. it doesnt grow fully.. it looks like this http://prntscr.com/deb0g9 instead of http://i.imgur.com/dOAPPQ5.png I was trying to recreate the flax mod from 1.7.10 so the assets are taken from that mod.. I know it is because of this function because I messed around for like 2 hours trying figure out what was wrong the original code: /*public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { int j = ((Integer)state.getValue(AGE)).intValue(); if ((j != 9) && (j != 10) && (j != 11) && ((worldIn.getBlockState(pos.down()).getBlock() == this) || (canBlockStay(worldIn, pos, state)))) { if ((worldIn.isAirBlock(pos.up())) || (j == 4) || (j == 7)) { if (worldIn.getLightFromNeighbors(pos.up()) >= 9) { if ((j == 0) || (j == 1) || (j == 2)) { worldIn.setBlockState(pos, getStateFromMeta(j + 1)); } if (j == 3) { worldIn.setBlockState(pos, getStateFromMeta(4)); } if (j == 5) { worldIn.setBlockState(pos, getStateFromMeta(6)); } if (j == 6) { worldIn.setBlockState(pos, getStateFromMeta(7)); worldIn.setBlockState(pos.up(), getStateFromMeta(); } if (j == { worldIn.setBlockState(pos, getStateFromMeta(10)); worldIn.setBlockState(pos.down(), getStateFromMeta(9)); worldIn.setBlockState(pos.down(2), getStateFromMeta(9)); } if (((j == 4) || (j == 7)) && (worldIn.getBlockState(pos.up()).getBlock() == this)) { int k = ((Integer)worldIn.getBlockState(pos.up()).getValue(AGE)).intValue(); if (k == 5) { worldIn.setBlockState(pos.up(), getStateFromMeta(6)); } if (k == 6) { worldIn.setBlockState(pos.up(), getStateFromMeta(7)); worldIn.setBlockState(pos.up(2), getStateFromMeta(); } if (k == 7) { worldIn.setBlockState(pos.up(2), getStateFromMeta(11)); worldIn.setBlockState(pos.up(), getStateFromMeta(10)); worldIn.setBlockState(pos, getStateFromMeta(9)); } if (k == { worldIn.setBlockState(pos.up(), getStateFromMeta(11)); worldIn.setBlockState(pos, getStateFromMeta(10)); worldIn.setBlockState(pos.down(), getStateFromMeta(9)); } } } } } }*/ what I tried to do and have now: public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { int j = ((Integer)state.getValue(AGE)).intValue(); if (((worldIn.getBlockState(pos.down()).getBlock() == this) || (canBlockStay(worldIn, pos, state)))) { if ((worldIn.isAirBlock(pos.up()))) { if (worldIn.getLightFromNeighbors(pos.up()) >= { if ((j == 0) || (j == 1) || (j == 2)) { worldIn.setBlockState(pos, getStateFromMeta(j + 1)); } if (j == 3) { worldIn.setBlockState(pos, getStateFromMeta(4)); } if (j == 4) { worldIn.setBlockState(pos, getStateFromMeta(5)); } if (j == 5) { worldIn.setBlockState(pos, getStateFromMeta(6)); } if (j == 6) { worldIn.setBlockState(pos, getStateFromMeta(7)); worldIn.setBlockState(pos.up(), getStateFromMeta(); } if ((j == 7) && (worldIn.getBlockState(pos.up()).getBlock() == this)) { int k = ((Integer)worldIn.getBlockState(pos.up()).getValue(AGE)).intValue(); if (k == { worldIn.setBlockState(pos.up(), getStateFromMeta(9)); } if (k == 9) { worldIn.setBlockState(pos.up(), getStateFromMeta(10)); } if (k == 10) { worldIn.setBlockState(pos.up(), getStateFromMeta(11)); } if (k == 11) { worldIn.setBlockState(pos.up(), getStateFromMeta(12)); } if (k == 12) { worldIn.setBlockState(pos.up(), getStateFromMeta(13)); } if (k == 13) { worldIn.setBlockState(pos.up(), getStateFromMeta(14)); } } } } } } the crop json: { "forge_marker": 1, "defaults": { "model": "cross" }, "variants": { "age": { "0": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_0" } }, "1": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_1" } }, "2": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_2" } }, "3": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_3" } }, "4": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_4" } }, "5": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_5" } }, "6": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_6" } }, "7": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_7" } }, "8": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_8" } }, "9": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_9" } }, "10": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_10" } }, "11": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_11" } }, "12": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_12" } }, "13": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_13" } }, "14": { "textures": { "cross": "xcrops:blocks/flax/flaxBlock_stage_14" } } } } } what confuse me the most is the part where I add the second block and where I need to update it..
  2. Hi, first of all im new to java ( I know the basics, I can manage to solve myself most of the problems I encounter ).. for like 2 days im searching how to make a 2 blocks tall crop, i've been looking into other mods how they did it, i've been searching everywhere.. now i am at the stage where I created the crop, it grows, it drop the items I want, but I want to make it grow 1 more block like this http://i.imgur.com/dOAPPQ5.png for example.. exactly this mod ( flax mod from 1.7 ) I tried to recreate in 1.10 for myself.. I pretty much followed this tutorial http://shadowfacts.net/tutorials/forge-modding-1102/ to make my mod, so its almost indentical.. what I want exactly to do is once again, make it grow 2 blocks, when I break the top block to receive more items as its fully grown aswell if I break the buttom block when its fully grown, but if I break the bottom without being fully grown to receive only the seed back.. i've searched a lot how to do this for 1.10.. if there was already a topic about this, im sorry but I couldnt find it..

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.