The first Line of code:
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (world.getWorldTime() < 13000) {
return stack;
}
active = true;
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}
The second line of code:
public void onUpdate(ItemStack itemstack, World world, Entity entity_, int i, boolean flag) {
block4 = world.getBlock(x, y, z);
if (active && world.getWorldTime() > 24000) {
world.setWorldTime(world.getWorldTime() - 24000);
}
if(active && world.getWorldTime() < 13000)
active =false;
if (active) {
world.setWorldTime(world.getWorldTime() + 200);
}
}