Kaneka Posted October 23, 2015 Share Posted October 23, 2015 hi everybody, I am trying to make a greenhouse which let the plants grow faster, here is the update() method of my tileentity: @Override public void update() { World world = this.getWorld(); BlockPos pos = this.pos; if(i < ticksPerItem) { i++; } if(i >= 20) { if(checkmultiblockstructure() == true) { double a,b; int c, d; a = Math.random()*9; b = Math.random()*9; c = (int)a; d = (int)b; BlockPos target = pos.up().south(4).east(4).north(c).west(d); growplant(world, target); } i = 0; } } and the growplant() method: public void growplant(World worldIn, BlockPos target) { IBlockState iblockstate = worldIn.getBlockState(target); if (iblockstate.getBlock() instanceof IGrowable) { IGrowable igrowable = (IGrowable)iblockstate.getBlock(); if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.isRemote)) { System.out.println("1"); if (!worldIn.isRemote) { System.out.println("2"); if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate)) { System.out.println("3"); ItemDye.spawnBonemealParticles(worldIn,target,0); igrowable.grow(worldIn, worldIn.rand, target, iblockstate); } } } } } I only get 1 shown in the console, but not more, when I change the !worldIn.isRemote to worldIn.isRemote it shows me 2 and 3 too. But that doesnt make sence, cause on clientside applying bonemeal don´t change anything.... Any idea to solve this problem? Quote Link to comment Share on other sites More sharing options...
Kaneka Posted October 24, 2015 Author Share Posted October 24, 2015 Noone any ideas? Quote Link to comment Share on other sites More sharing options...
Draco18s Posted October 24, 2015 Share Posted October 24, 2015 I only get 1 shown in the console, but not more, when I change the !worldIn.isRemote to worldIn.isRemote it shows me 2 and 3 too. This means your code is only running client side. The server isn't doing anything at all with your code for some reason. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
Kaneka Posted November 29, 2015 Author Share Posted November 29, 2015 Noone have any idea how i can make this to serverside?? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.